Some initial work on organizations, nothing works yet

This commit is contained in:
Daniel García
2018-02-17 22:30:19 +01:00
parent d6a1a9b274
commit 1bc346688c
7 changed files with 357 additions and 12 deletions

View File

@@ -22,6 +22,14 @@ table! {
}
}
table! {
collections (uuid) {
uuid -> Text,
org_uuid -> Text,
name -> Text,
}
}
table! {
devices (uuid) {
uuid -> Text,
@@ -46,6 +54,14 @@ table! {
}
}
table! {
organizations (uuid) {
uuid -> Text,
name -> Text,
billing_email -> Text,
}
}
table! {
users (uuid) {
uuid -> Text,
@@ -68,16 +84,43 @@ table! {
}
}
table! {
users_collections (user_uuid, collection_uuid) {
user_uuid -> Text,
collection_uuid -> Text,
}
}
table! {
users_organizations (user_uuid, org_uuid) {
user_uuid -> Text,
org_uuid -> Text,
key -> Text,
status -> Integer,
#[sql_name = "type"]
type_ -> Integer,
}
}
joinable!(attachments -> ciphers (cipher_uuid));
joinable!(ciphers -> folders (folder_uuid));
joinable!(ciphers -> users (user_uuid));
joinable!(collections -> organizations (org_uuid));
joinable!(devices -> users (user_uuid));
joinable!(folders -> users (user_uuid));
joinable!(users_collections -> collections (collection_uuid));
joinable!(users_collections -> users (user_uuid));
joinable!(users_organizations -> organizations (org_uuid));
joinable!(users_organizations -> users (user_uuid));
allow_tables_to_appear_in_same_query!(
attachments,
ciphers,
collections,
devices,
folders,
organizations,
users,
users_collections,
users_organizations,
);