Created
May 25, 2010 21:09
-
-
Save rniwa/413695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENTITY Site | |
{ | |
string url, | |
int created_at, | |
int updated_at | |
PRIMARY(url) | |
} | |
ENTITY User | |
{ | |
string login, | |
string email, | |
string crypted_password, | |
string salt, | |
int created_at, | |
int updated_at, | |
string remember_token, | |
int remember_token_expires_at, | |
string activation_code, | |
int activated_at, | |
string state, | |
int deleted_at, | |
string name_prefix, | |
string name_first, | |
string name_middle, | |
string name_last, | |
int birthdate, | |
int fb_user_id, | |
string email_hash | |
PRIMARY(login) | |
} | |
ENTITY Account | |
{ | |
string username, | |
string password, | |
int created_at, | |
int updated_at, | |
FOREIGN KEY user_id REF User, | |
FOREIGN KEY site_id REF Site, | |
string t | |
PRIMARY(username, site_id) | |
} | |
ENTITY Comment | |
{ | |
FOREIGN KEY author_id REF User, | |
string author_name, | |
string author_email, | |
string title, | |
string body, | |
int posted_at, | |
int created_at, | |
int updated_at, | |
FOREIGN KEY site_id REF Site, | |
string url, | |
string signature, | |
bool has_merit | |
PRIMARY(signature) | |
} | |
ENTITY Friendship | |
{ | |
FOREIGN KEY user_id REF User, | |
FOREIGN KEY friend_id REF User, | |
int created_at, | |
int updated_at, | |
FOREIGN KEY site_id REF Site | |
PRIMARY(user_id, friend_id) | |
} | |
ENTITY ProfileItem | |
{ | |
FOREIGN KEY user_id REF User, | |
FOREIGN KEY site_id REF Site, | |
string name, | |
string data, | |
int created_at, | |
int updated_at | |
PRIMARY(user_id, site_id, name) | |
} | |
ENTITY Viewership | |
{ | |
int rating, | |
int created_at, | |
int updated_at, | |
FOREIGN KEY user_id REF User, | |
FOREIGN KEY comment_id REF Comment | |
PRIMARY(user_id, comment_id) | |
} | |
QUERY users | |
FETCH User | |
OF Account BY user_id | |
WHERE Account = [this] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment