1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-05 02:28:00 +01:00
vaultwarden/src/db/schema.rs

153 Zeilen
3,5 KiB
Rust

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,
name -> Text,
notes -> Nullable<Text>,
fields -> Nullable<Text>,
2018-02-10 01:00:55 +01:00
data -> Text,
favorite -> Bool,
}
}
2018-06-01 15:08:03 +02:00
table! {
ciphers_collections (cipher_uuid, collection_uuid) {
cipher_uuid -> Text,
collection_uuid -> Text,
}
}
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,
2018-06-01 15:08:03 +02:00
twofactor_remember -> Nullable<Text>,
2018-02-10 01:00:55 +01:00
}
}
table! {
folders (uuid) {
uuid -> Text,
created_at -> Timestamp,
updated_at -> Timestamp,
user_uuid -> Text,
name -> Text,
}
}
table! {
folders_ciphers (cipher_uuid, folder_uuid) {
cipher_uuid -> Text,
folder_uuid -> Text,
}
}
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,
equivalent_domains -> Text,
excluded_globals -> Text,
2018-02-10 01:00:55 +01:00
}
}
table! {
users_collections (user_uuid, collection_uuid) {
user_uuid -> Text,
collection_uuid -> Text,
read_only -> Bool,
}
}
table! {
users_organizations (uuid) {
uuid -> Text,
user_uuid -> Text,
org_uuid -> Text,
access_all -> Bool,
key -> Text,
status -> Integer,
#[sql_name = "type"]
type_ -> Integer,
}
}
joinable!(attachments -> ciphers (cipher_uuid));
joinable!(ciphers -> organizations (organization_uuid));
2018-02-10 01:00:55 +01:00
joinable!(ciphers -> users (user_uuid));
2018-06-01 15:08:03 +02:00
joinable!(ciphers_collections -> ciphers (cipher_uuid));
joinable!(ciphers_collections -> collections (collection_uuid));
joinable!(collections -> organizations (org_uuid));
2018-02-10 01:00:55 +01:00
joinable!(devices -> users (user_uuid));
joinable!(folders -> users (user_uuid));
joinable!(folders_ciphers -> ciphers (cipher_uuid));
joinable!(folders_ciphers -> folders (folder_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));
2018-02-10 01:00:55 +01:00
allow_tables_to_appear_in_same_query!(
attachments,
2018-02-10 01:00:55 +01:00
ciphers,
2018-06-01 15:08:03 +02:00
ciphers_collections,
collections,
2018-02-10 01:00:55 +01:00
devices,
folders,
folders_ciphers,
organizations,
2018-02-10 01:00:55 +01:00
users,
users_collections,
users_organizations,
2018-02-10 01:00:55 +01:00
);