From: Scott <97430840+scme0@users.noreply.github.com> Date: Mon, 26 Jun 2023 08:53:04 +0000 (+0930) Subject: Update DB local_user.theme type to text (#3266) X-Git-Url: http://these/git/%24%7Bsubmission.url%7D?a=commitdiff_plain;h=c5886404efaba6ba477e6c30830115473f497706;p=lemmy.git Update DB local_user.theme type to text (#3266) * Update local_user.theme type to text * fix default value * Undo auto generate changes --- 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;