From c5886404efaba6ba477e6c30830115473f497706 Mon Sep 17 00:00:00 2001 From: Scott <97430840+scme0@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:23:04 +0930 Subject: [PATCH] Update DB local_user.theme type to text (#3266) * Update local_user.theme type to text * fix default value * Undo auto generate changes --- crates/db_schema/src/schema.rs | 3 +-- .../2023-06-22-101245_increase_user_theme_column_size/down.sql | 2 ++ .../2023-06-22-101245_increase_user_theme_column_size/up.sql | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 migrations/2023-06-22-101245_increase_user_theme_column_size/down.sql create mode 100644 migrations/2023-06-22-101245_increase_user_theme_column_size/up.sql diff --git a/crates/db_schema/src/schema.rs b/crates/db_schema/src/schema.rs index 6714913f..aef6fbe5 100644 --- a/crates/db_schema/src/schema.rs +++ b/crates/db_schema/src/schema.rs @@ -381,8 +381,7 @@ diesel::table! { password_encrypted -> Text, email -> Nullable, show_nsfw -> Bool, - #[max_length = 20] - theme -> Varchar, + theme -> Text, default_sort_type -> SortTypeEnum, default_listing_type -> ListingTypeEnum, #[max_length = 20] diff --git a/migrations/2023-06-22-101245_increase_user_theme_column_size/down.sql b/migrations/2023-06-22-101245_increase_user_theme_column_size/down.sql new file mode 100644 index 00000000..0731e068 --- /dev/null +++ b/migrations/2023-06-22-101245_increase_user_theme_column_size/down.sql @@ -0,0 +1,2 @@ +alter table only local_user alter column theme TYPE character varying(20); +alter table only local_user alter column theme set default 'browser'::character varying; \ No newline at end of file diff --git a/migrations/2023-06-22-101245_increase_user_theme_column_size/up.sql b/migrations/2023-06-22-101245_increase_user_theme_column_size/up.sql new file mode 100644 index 00000000..cbab2566 --- /dev/null +++ b/migrations/2023-06-22-101245_increase_user_theme_column_size/up.sql @@ -0,0 +1,2 @@ +alter table only local_user alter column theme type text; +alter table only local_user alter column theme set default 'browser'::text; -- 2.44.1