0
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden synced 2024-11-15 22:42:51 +01:00
bitwarden_rs/src/db/schemas/mysql/schema.rs

261 lines
6.2 KiB
Rust
Raw Normal View History

table! {
attachments (id) {
id -> Text,
cipher_uuid -> Text,
file_name -> Text,
file_size -> Integer,
2019-05-20 21:12:41 +02:00
akey -> Nullable<Text>,
}
}
2018-02-10 01:00:55 +01:00
table! {
ciphers (uuid) {
uuid -> Text,
2019-05-20 21:12:41 +02:00
created_at -> Datetime,
updated_at -> Datetime,
user_uuid -> Nullable<Text>,
organization_uuid -> Nullable<Text>,
2019-05-20 21:12:41 +02:00
atype -> Integer,
name -> Text,
notes -> Nullable<Text>,
fields -> Nullable<Text>,
2018-02-10 01:00:55 +01:00
data -> Text,
password_history -> Nullable<Text>,
2020-04-17 22:35:27 +02:00
deleted_at -> Nullable<Datetime>,
reprompt -> Nullable<Integer>,
2018-02-10 01:00:55 +01:00
}
}
2018-06-01 15:08:03 +02:00
table! {
ciphers_collections (cipher_uuid, collection_uuid) {
cipher_uuid -> Text,
collection_uuid -> Text,
2018-06-01 15:08:03 +02:00
}
}
table! {
collections (uuid) {
uuid -> Text,
org_uuid -> Text,
name -> Text,
}
}
2018-02-10 01:00:55 +01:00
table! {
devices (uuid) {
uuid -> Text,
2019-05-20 21:12:41 +02:00
created_at -> Datetime,
updated_at -> Datetime,
user_uuid -> Text,
2018-02-10 01:00:55 +01:00
name -> Text,
2019-05-20 21:12:41 +02:00
atype -> Integer,
2018-02-10 01:00:55 +01:00
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! {
favorites (user_uuid, cipher_uuid) {
user_uuid -> Text,
cipher_uuid -> Text,
}
}
2018-02-10 01:00:55 +01:00
table! {
folders (uuid) {
uuid -> Text,
2019-05-20 21:12:41 +02:00
created_at -> Datetime,
updated_at -> Datetime,
user_uuid -> Text,
2018-02-10 01:00:55 +01:00
name -> Text,
}
}
table! {
folders_ciphers (cipher_uuid, folder_uuid) {
cipher_uuid -> Text,
folder_uuid -> Text,
}
}
table! {
invitations (email) {
email -> Text,
}
}
2020-03-14 13:22:30 +01:00
table! {
org_policies (uuid) {
uuid -> Text,
org_uuid -> Text,
2020-03-14 13:22:30 +01:00
atype -> Integer,
enabled -> Bool,
data -> Text,
}
}
table! {
organizations (uuid) {
uuid -> Text,
name -> Text,
billing_email -> Text,
2021-07-04 23:02:56 +02:00
private_key -> Nullable<Text>,
public_key -> Nullable<Text>,
}
}
2021-03-14 23:35:55 +01:00
table! {
sends (uuid) {
uuid -> Text,
user_uuid -> Nullable<Text>,
organization_uuid -> Nullable<Text>,
name -> Text,
notes -> Nullable<Text>,
atype -> Integer,
data -> Text,
2021-03-15 16:42:20 +01:00
akey -> Text,
2021-03-14 23:35:55 +01:00
password_hash -> Nullable<Binary>,
password_salt -> Nullable<Binary>,
password_iter -> Nullable<Integer>,
max_access_count -> Nullable<Integer>,
access_count -> Integer,
creation_date -> Datetime,
revision_date -> Datetime,
expiration_date -> Nullable<Datetime>,
deletion_date -> Datetime,
disabled -> Bool,
hide_email -> Nullable<Bool>,
2021-03-14 23:35:55 +01:00
}
}
table! {
twofactor (uuid) {
uuid -> Text,
user_uuid -> Text,
2019-05-20 21:12:41 +02:00
atype -> Integer,
enabled -> Bool,
data -> Text,
last_used -> Integer,
}
}
table! {
twofactor_incomplete (user_uuid, device_uuid) {
user_uuid -> Text,
device_uuid -> Text,
device_name -> Text,
login_time -> Timestamp,
ip_address -> Text,
}
}
2018-02-10 01:00:55 +01:00
table! {
users (uuid) {
uuid -> Text,
enabled -> Bool,
2019-05-20 21:12:41 +02:00
created_at -> Datetime,
updated_at -> Datetime,
verified_at -> Nullable<Datetime>,
last_verifying_at -> Nullable<Datetime>,
login_verify_count -> Integer,
email -> Text,
email_new -> Nullable<Text>,
email_new_token -> Nullable<Text>,
2018-02-10 01:00:55 +01:00
name -> Text,
password_hash -> Binary,
salt -> Binary,
2018-02-10 01:00:55 +01:00
password_iterations -> Integer,
password_hint -> Nullable<Text>,
2019-05-20 21:12:41 +02:00
akey -> Text,
2018-02-10 01:00:55 +01:00
private_key -> Nullable<Text>,
public_key -> Nullable<Text>,
totp_secret -> Nullable<Text>,
totp_recover -> Nullable<Text>,
security_stamp -> Text,
stamp_exception -> Nullable<Text>,
equivalent_domains -> Text,
excluded_globals -> Text,
client_kdf_type -> Integer,
client_kdf_iter -> Integer,
api_key -> Nullable<Text>,
}
}
table! {
users_collections (user_uuid, collection_uuid) {
user_uuid -> Text,
collection_uuid -> Text,
read_only -> Bool,
hide_passwords -> Bool,
}
}
table! {
users_organizations (uuid) {
uuid -> Text,
user_uuid -> Text,
org_uuid -> Text,
access_all -> Bool,
2019-05-20 21:12:41 +02:00
akey -> Text,
status -> Integer,
2019-05-20 21:12:41 +02:00
atype -> Integer,
}
}
table! {
emergency_access (uuid) {
uuid -> Text,
grantor_uuid -> Text,
grantee_uuid -> Nullable<Text>,
email -> Nullable<Text>,
key_encrypted -> Nullable<Text>,
atype -> Integer,
status -> Integer,
wait_time_days -> Integer,
recovery_initiated_at -> Nullable<Timestamp>,
last_notification_at -> Nullable<Timestamp>,
updated_at -> Timestamp,
created_at -> Timestamp,
}
}
2019-05-20 21:30:31 +02:00
joinable!(attachments -> ciphers (cipher_uuid));
joinable!(ciphers -> organizations (organization_uuid));
joinable!(ciphers -> users (user_uuid));
joinable!(ciphers_collections -> ciphers (cipher_uuid));
joinable!(ciphers_collections -> collections (collection_uuid));
joinable!(collections -> organizations (org_uuid));
joinable!(devices -> users (user_uuid));
joinable!(folders -> users (user_uuid));
joinable!(folders_ciphers -> ciphers (cipher_uuid));
joinable!(folders_ciphers -> folders (folder_uuid));
2020-03-14 13:22:30 +01:00
joinable!(org_policies -> organizations (org_uuid));
2021-03-14 23:35:55 +01:00
joinable!(sends -> organizations (organization_uuid));
joinable!(sends -> users (user_uuid));
2019-05-20 21:30:31 +02:00
joinable!(twofactor -> 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));
joinable!(emergency_access -> users (grantor_uuid));
2019-05-20 21:30:31 +02:00
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,
invitations,
2020-03-14 13:22:30 +01:00
org_policies,
organizations,
2021-03-14 23:35:55 +01:00
sends,
twofactor,
2018-02-10 01:00:55 +01:00
users,
users_collections,
users_organizations,
emergency_access,
2018-02-10 01:00:55 +01:00
);