2018-02-14 23:40:34 +00:00
|
|
|
table! {
|
|
|
|
attachments (id) {
|
|
|
|
id -> Text,
|
|
|
|
cipher_uuid -> Text,
|
|
|
|
file_name -> Text,
|
|
|
|
file_size -> Integer,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 00:00:55 +00:00
|
|
|
table! {
|
|
|
|
ciphers (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
2018-04-30 09:52:15 +00:00
|
|
|
user_uuid -> Nullable<Text>,
|
2018-02-10 00:00:55 +00:00
|
|
|
organization_uuid -> Nullable<Text>,
|
|
|
|
#[sql_name = "type"]
|
|
|
|
type_ -> Integer,
|
2018-03-05 23:02:36 +00:00
|
|
|
name -> Text,
|
|
|
|
notes -> Nullable<Text>,
|
|
|
|
fields -> Nullable<Text>,
|
2018-02-10 00:00:55 +00:00
|
|
|
data -> Text,
|
|
|
|
favorite -> Bool,
|
2018-08-27 21:08:58 +00:00
|
|
|
password_history -> Nullable<Text>,
|
2018-02-10 00:00:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-01 13:08:03 +00:00
|
|
|
table! {
|
|
|
|
ciphers_collections (cipher_uuid, collection_uuid) {
|
|
|
|
cipher_uuid -> Text,
|
|
|
|
collection_uuid -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 21:30:19 +00:00
|
|
|
table! {
|
|
|
|
collections (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 00:00:55 +00: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,
|
2018-06-01 13:08:03 +00:00
|
|
|
twofactor_remember -> Nullable<Text>,
|
2018-02-10 00:00:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
|
|
|
folders (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
created_at -> Timestamp,
|
|
|
|
updated_at -> Timestamp,
|
|
|
|
user_uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-04 18:10:35 +00:00
|
|
|
table! {
|
|
|
|
folders_ciphers (cipher_uuid, folder_uuid) {
|
|
|
|
cipher_uuid -> Text,
|
|
|
|
folder_uuid -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 21:30:19 +00:00
|
|
|
table! {
|
|
|
|
organizations (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
name -> Text,
|
|
|
|
billing_email -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:46:50 +00:00
|
|
|
table! {
|
|
|
|
twofactor (uuid) {
|
|
|
|
uuid -> Text,
|
|
|
|
user_uuid -> Text,
|
|
|
|
#[sql_name = "type"]
|
|
|
|
type_ -> Integer,
|
|
|
|
enabled -> Bool,
|
|
|
|
data -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 00:00:55 +00: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-14 23:40:34 +00:00
|
|
|
equivalent_domains -> Text,
|
|
|
|
excluded_globals -> Text,
|
2018-02-10 00:00:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-10 13:51:40 +00:00
|
|
|
table! {
|
|
|
|
invitations (email) {
|
|
|
|
email -> Text,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-17 21:30:19 +00:00
|
|
|
table! {
|
|
|
|
users_collections (user_uuid, collection_uuid) {
|
|
|
|
user_uuid -> Text,
|
|
|
|
collection_uuid -> Text,
|
2018-05-04 18:10:35 +00:00
|
|
|
read_only -> Bool,
|
2018-02-17 21:30:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
2018-04-24 20:01:55 +00:00
|
|
|
users_organizations (uuid) {
|
|
|
|
uuid -> Text,
|
2018-02-17 21:30:19 +00:00
|
|
|
user_uuid -> Text,
|
|
|
|
org_uuid -> Text,
|
2018-04-24 20:01:55 +00:00
|
|
|
access_all -> Bool,
|
2018-02-17 21:30:19 +00:00
|
|
|
key -> Text,
|
|
|
|
status -> Integer,
|
|
|
|
#[sql_name = "type"]
|
|
|
|
type_ -> Integer,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-14 23:40:34 +00:00
|
|
|
joinable!(attachments -> ciphers (cipher_uuid));
|
2018-05-04 18:10:35 +00:00
|
|
|
joinable!(ciphers -> organizations (organization_uuid));
|
2018-02-10 00:00:55 +00:00
|
|
|
joinable!(ciphers -> users (user_uuid));
|
2018-06-01 13:08:03 +00:00
|
|
|
joinable!(ciphers_collections -> ciphers (cipher_uuid));
|
|
|
|
joinable!(ciphers_collections -> collections (collection_uuid));
|
2018-02-17 21:30:19 +00:00
|
|
|
joinable!(collections -> organizations (org_uuid));
|
2018-02-10 00:00:55 +00:00
|
|
|
joinable!(devices -> users (user_uuid));
|
|
|
|
joinable!(folders -> users (user_uuid));
|
2018-05-04 18:10:35 +00:00
|
|
|
joinable!(folders_ciphers -> ciphers (cipher_uuid));
|
|
|
|
joinable!(folders_ciphers -> folders (folder_uuid));
|
2018-07-12 19:46:50 +00:00
|
|
|
joinable!(twofactor -> users (user_uuid));
|
2018-02-17 21:30:19 +00:00
|
|
|
joinable!(users_collections -> collections (collection_uuid));
|
|
|
|
joinable!(users_collections -> users (user_uuid));
|
|
|
|
joinable!(users_organizations -> organizations (org_uuid));
|
|
|
|
joinable!(users_organizations -> users (user_uuid));
|
2018-02-10 00:00:55 +00:00
|
|
|
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
2018-02-14 23:40:34 +00:00
|
|
|
attachments,
|
2018-02-10 00:00:55 +00:00
|
|
|
ciphers,
|
2018-06-01 13:08:03 +00:00
|
|
|
ciphers_collections,
|
2018-02-17 21:30:19 +00:00
|
|
|
collections,
|
2018-02-10 00:00:55 +00:00
|
|
|
devices,
|
|
|
|
folders,
|
2018-05-04 18:10:35 +00:00
|
|
|
folders_ciphers,
|
2018-02-17 21:30:19 +00:00
|
|
|
organizations,
|
2018-07-12 19:46:50 +00:00
|
|
|
twofactor,
|
2018-02-10 00:00:55 +00:00
|
|
|
users,
|
2018-02-17 21:30:19 +00:00
|
|
|
users_collections,
|
|
|
|
users_organizations,
|
2018-02-10 00:00:55 +00:00
|
|
|
);
|