2018-02-15 00:40:34 +01:00
|
|
|
table! {
|
|
|
|
attachments (id) {
|
|
|
|
id -> Text,
|
|
|
|
cipher_uuid -> Text,
|
|
|
|
file_name -> Text,
|
|
|
|
file_size -> Integer,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
table! {
|
|
|
|
ciphers (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
2018-04-30 11:52:15 +02:00
|
|
|
user_uuid -> Nullable<Text>,
|
2018-02-10 01:00:55 +01:00
|
|
|
organization_uuid -> Nullable<Text>,
|
|
|
|
#[sql_name = "type"]
|
|
|
|
type_ -> Integer,
|
2018-03-06 00:02:36 +01:00
|
|
|
name -> Text,
|
|
|
|
notes -> Nullable<Text>,
|
|
|
|
fields -> Nullable<Text>,
|
2018-02-10 01:00:55 +01:00
|
|
|
data -> Text,
|
|
|
|
favorite -> Bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:30:19 +01:00
|
|
|
table! {
|
|
|
|
collections (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
table! {
|
|
|
|
devices (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
user_uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
#[sql_name = "type"]
|
|
|
|
type_ -> Integer,
|
|
|
|
push_token -> Nullable<Text>,
|
|
|
|
refresh_token -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
|
|
|
folders (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
user_uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-04 20:10:35 +02:00
|
|
|
table! {
|
|
|
|
folders_ciphers (cipher_uuid, folder_uuid) {
|
|
|
|
cipher_uuid -> Text,
|
|
|
|
folder_uuid -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:30:19 +01:00
|
|
|
table! {
|
|
|
|
organizations (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
billing_email -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 01:00:55 +01:00
|
|
|
table! {
|
|
|
|
users (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
email -> Text,
|
|
|
|
name -> Text,
|
|
|
|
password_hash -> Binary,
|
|
|
|
salt -> Binary,
|
|
|
|
password_iterations -> Integer,
|
|
|
|
password_hint -> Nullable<Text>,
|
|
|
|
key -> Text,
|
|
|
|
private_key -> Nullable<Text>,
|
|
|
|
public_key -> Nullable<Text>,
|
|
|
|
totp_secret -> Nullable<Text>,
|
|
|
|
totp_recover -> Nullable<Text>,
|
|
|
|
security_stamp -> Text,
|
2018-02-15 00:40:34 +01:00
|
|
|
equivalent_domains -> Text,
|
|
|
|
excluded_globals -> Text,
|
2018-02-10 01:00:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:30:19 +01:00
|
|
|
table! {
|
|
|
|
users_collections (user_uuid, collection_uuid) {
|
|
|
|
user_uuid -> Text,
|
|
|
|
collection_uuid -> Text,
|
2018-05-04 20:10:35 +02:00
|
|
|
read_only -> Bool,
|
2018-02-17 22:30:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-09 12:55:05 +02:00
|
|
|
table! {
|
|
|
|
ciphers_collections (cipher_uuid, collection_uuid) {
|
|
|
|
cipher_uuid -> Text,
|
|
|
|
collection_uuid -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:30:19 +01:00
|
|
|
table! {
|
2018-04-24 22:01:55 +02:00
|
|
|
users_organizations (uuid) {
|
|
|
|
uuid -> Text,
|
2018-02-17 22:30:19 +01:00
|
|
|
user_uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
2018-04-24 22:01:55 +02:00
|
|
|
access_all -> Bool,
|
2018-02-17 22:30:19 +01:00
|
|
|
key -> Text,
|
|
|
|
status -> Integer,
|
|
|
|
#[sql_name = "type"]
|
|
|
|
type_ -> Integer,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-15 00:40:34 +01:00
|
|
|
joinable!(attachments -> ciphers (cipher_uuid));
|
2018-05-04 20:10:35 +02:00
|
|
|
joinable!(ciphers -> organizations (organization_uuid));
|
2018-02-10 01:00:55 +01:00
|
|
|
joinable!(ciphers -> users (user_uuid));
|
2018-02-17 22:30:19 +01:00
|
|
|
joinable!(collections -> organizations (org_uuid));
|
2018-02-10 01:00:55 +01:00
|
|
|
joinable!(devices -> users (user_uuid));
|
|
|
|
joinable!(folders -> users (user_uuid));
|
2018-05-04 20:10:35 +02:00
|
|
|
joinable!(folders_ciphers -> ciphers (cipher_uuid));
|
|
|
|
joinable!(folders_ciphers -> folders (folder_uuid));
|
2018-02-17 22:30:19 +01:00
|
|
|
joinable!(users_collections -> collections (collection_uuid));
|
|
|
|
joinable!(users_collections -> users (user_uuid));
|
2018-05-09 12:55:05 +02:00
|
|
|
joinable!(ciphers_collections -> collections (collection_uuid));
|
|
|
|
joinable!(ciphers_collections -> ciphers (cipher_uuid));
|
2018-02-17 22:30:19 +01:00
|
|
|
joinable!(users_organizations -> organizations (org_uuid));
|
|
|
|
joinable!(users_organizations -> users (user_uuid));
|
2018-02-10 01:00:55 +01:00
|
|
|
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
2018-02-15 00:40:34 +01:00
|
|
|
attachments,
|
2018-02-10 01:00:55 +01:00
|
|
|
ciphers,
|
2018-02-17 22:30:19 +01:00
|
|
|
collections,
|
2018-02-10 01:00:55 +01:00
|
|
|
devices,
|
|
|
|
folders,
|
2018-05-04 20:10:35 +02:00
|
|
|
folders_ciphers,
|
2018-02-17 22:30:19 +01:00
|
|
|
organizations,
|
2018-02-10 01:00:55 +01:00
|
|
|
users,
|
2018-02-17 22:30:19 +01:00
|
|
|
users_collections,
|
2018-05-09 12:55:05 +02:00
|
|
|
ciphers_collections,
|
2018-02-17 22:30:19 +01:00
|
|
|
users_organizations,
|
2018-02-10 01:00:55 +01:00
|
|
|
);
|