Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DB local_user.theme type to text #3266

Merged
merged 5 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions crates/db_schema/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ diesel::table! {
}

diesel::table! {
use diesel::sql_types::{Bool, Int4, Nullable, Text, Timestamp, Varchar};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure about this and similar changes in this file. They were auto generated... Should I revert them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diesel CLI is doing this for me too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which command are you running that this happens?

Copy link
Contributor

@kartikynwa kartikynwa Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nutomic diesel migration run. This change is in my community muting PR as well. It comes from running the migrations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep and also diesel migration redo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay fixed in #3293

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted those lines in this PR 👍

use diesel::sql_types::*;
use diesel_ltree::sql_types::Ltree;

comment (id) {
Expand Down Expand Up @@ -317,7 +317,7 @@ diesel::table! {
}

diesel::table! {
use diesel::sql_types::{Bool, Int4, Nullable, Text, Timestamp, Varchar};
use diesel::sql_types::*;
use super::sql_types::ListingTypeEnum;
use super::sql_types::RegistrationModeEnum;

Expand Down Expand Up @@ -372,7 +372,7 @@ diesel::table! {
}

diesel::table! {
use diesel::sql_types::{Bool, Int4, Nullable, Text, Timestamp, Varchar};
use diesel::sql_types::*;
use super::sql_types::SortTypeEnum;
use super::sql_types::ListingTypeEnum;

Expand All @@ -382,8 +382,7 @@ diesel::table! {
password_encrypted -> Text,
email -> Nullable<Text>,
show_nsfw -> Bool,
#[max_length = 20]
theme -> Varchar,
theme -> Text,
default_sort_type -> SortTypeEnum,
default_listing_type -> ListingTypeEnum,
#[max_length = 20]
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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;