We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sync_enum_values
For instance, when I have a structure like this:
create type email_template_enum as enum ( 'welcome', 'password_reset', 'email_verification' ); create table users ( id uuid default gen_random_uuid() not null primary key, disabled_emails email_template_enum[] default '{}'::email_template_enum[] not null );
And when I try to add another value to email_template_enum:
email_template_enum
op.sync_enum_values( "public", "email_template_enum", [ "welcome", "password_reset", "email_verification", "email_changed", ] [ TableReference( "users", "disabled_emails", column_type=ColumnType.ARRAY, existing_server_default="'{}'::email_template_enum[]", ), ], enum_values_to_rename=[], )
It will fail:
sqlalchemy.exc.DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.InvalidTextRepresentationError'>: invalid input value for enum email_template_enum: "{}" [SQL: ALTER TABLE public.users ALTER COLUMN disabled_emails SET DEFAULT '{}'::email_template_enum] (Background on this error at: https://sqlalche.me/e/20/dbapi)
Default value should be:
'{}'::email_template_enum[]
Not:
'{}'::email_template_enum
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
For instance, when I have a structure like this:
And when I try to add another value to
email_template_enum
:It will fail:
Default value should be:
'{}'::email_template_enum[]
Not:
'{}'::email_template_enum
The text was updated successfully, but these errors were encountered: