From 0e9eba8c8b7e2b3b3ea4793ed71c6c52c6606a96 Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Sun, 2 Aug 2020 21:54:43 -0700 Subject: [PATCH] Maximize similarity between MySQL and SQLite/PostgreSQL schemas In particular, Diesel aliases `Varchar` to `Text`, and `Blob` to `Binary`: * https://docs.diesel.rs/diesel/sql_types/struct.Text.html * https://docs.diesel.rs/diesel/sql_types/struct.Binary.html --- src/db/schemas/mysql/schema.rs | 64 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/db/schemas/mysql/schema.rs b/src/db/schemas/mysql/schema.rs index 4b8fbc7d..36ee5124 100644 --- a/src/db/schemas/mysql/schema.rs +++ b/src/db/schemas/mysql/schema.rs @@ -1,7 +1,7 @@ table! { attachments (id) { - id -> Varchar, - cipher_uuid -> Varchar, + id -> Text, + cipher_uuid -> Text, file_name -> Text, file_size -> Integer, akey -> Nullable, @@ -10,11 +10,11 @@ table! { table! { ciphers (uuid) { - uuid -> Varchar, + uuid -> Text, created_at -> Datetime, updated_at -> Datetime, - user_uuid -> Nullable, - organization_uuid -> Nullable, + user_uuid -> Nullable, + organization_uuid -> Nullable, atype -> Integer, name -> Text, notes -> Nullable, @@ -28,25 +28,25 @@ table! { table! { ciphers_collections (cipher_uuid, collection_uuid) { - cipher_uuid -> Varchar, - collection_uuid -> Varchar, + cipher_uuid -> Text, + collection_uuid -> Text, } } table! { collections (uuid) { - uuid -> Varchar, - org_uuid -> Varchar, + uuid -> Text, + org_uuid -> Text, name -> Text, } } table! { devices (uuid) { - uuid -> Varchar, + uuid -> Text, created_at -> Datetime, updated_at -> Datetime, - user_uuid -> Varchar, + user_uuid -> Text, name -> Text, atype -> Integer, push_token -> Nullable, @@ -57,31 +57,31 @@ table! { table! { folders (uuid) { - uuid -> Varchar, + uuid -> Text, created_at -> Datetime, updated_at -> Datetime, - user_uuid -> Varchar, + user_uuid -> Text, name -> Text, } } table! { folders_ciphers (cipher_uuid, folder_uuid) { - cipher_uuid -> Varchar, - folder_uuid -> Varchar, + cipher_uuid -> Text, + folder_uuid -> Text, } } table! { invitations (email) { - email -> Varchar, + email -> Text, } } table! { org_policies (uuid) { - uuid -> Varchar, - org_uuid -> Varchar, + uuid -> Text, + org_uuid -> Text, atype -> Integer, enabled -> Bool, data -> Text, @@ -90,7 +90,7 @@ table! { table! { organizations (uuid) { - uuid -> Varchar, + uuid -> Text, name -> Text, billing_email -> Text, } @@ -98,8 +98,8 @@ table! { table! { twofactor (uuid) { - uuid -> Varchar, - user_uuid -> Varchar, + uuid -> Text, + user_uuid -> Text, atype -> Integer, enabled -> Bool, data -> Text, @@ -109,18 +109,18 @@ table! { table! { users (uuid) { - uuid -> Varchar, + uuid -> Text, created_at -> Datetime, updated_at -> Datetime, verified_at -> Nullable, last_verifying_at -> Nullable, login_verify_count -> Integer, - email -> Varchar, - email_new -> Nullable, - email_new_token -> Nullable, + email -> Text, + email_new -> Nullable, + email_new_token -> Nullable, name -> Text, - password_hash -> Blob, - salt -> Blob, + password_hash -> Binary, + salt -> Binary, password_iterations -> Integer, password_hint -> Nullable, akey -> Text, @@ -138,8 +138,8 @@ table! { table! { users_collections (user_uuid, collection_uuid) { - user_uuid -> Varchar, - collection_uuid -> Varchar, + user_uuid -> Text, + collection_uuid -> Text, read_only -> Bool, hide_passwords -> Bool, } @@ -147,9 +147,9 @@ table! { table! { users_organizations (uuid) { - uuid -> Varchar, - user_uuid -> Varchar, - org_uuid -> Varchar, + uuid -> Text, + user_uuid -> Text, + org_uuid -> Text, access_all -> Bool, akey -> Text, status -> Integer,