You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will produce an error like below when running alembic upgrade heads
op.sync_enum_values(
File "<string>", line 8, in sync_enum_values
File "<string>", line 3, in sync_enum_values
File "/home/support/.local/lib/python3.11/site-packages/alembic_postgresql_enum/operations/sync_enum_values.py", line 190, in sync_enum_values
cls._set_enum_values(
File "/home/support/.local/lib/python3.11/site-packages/alembic_postgresql_enum/operations/sync_enum_values.py", line 85, in _set_enum_values
create_comparison_operators(connection, enum_schema, enum_name, temporary_enum_name, enum_values_to_rename)
File "/home/support/.local/lib/python3.11/site-packages/alembic_postgresql_enum/sql_commands/comparison_operators.py", line 79, in create_comparison_operators
_create_comparison_operator(
File "/home/support/.local/lib/python3.11/site-packages/alembic_postgresql_enum/sql_commands/comparison_operators.py", line 44, in _create_comparison_operator
connection.execute(
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1385, in execute
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1577, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1953, in _execute_context
self._handle_dbapi_exception(
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2134, in _handle_dbapi_exception
util.raise_(
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
raise exception
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context
self.dialect.do_execute(
File "/pipedream/local/venv/deepfield-env/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) type public.CamelCase_old does not exist
[SQL:
CREATE FUNCTION new_old_not_equals(
new_enum_val "public"."CamelCase", old_enum_val "public"."CamelCase_old"
)
RETURNS boolean AS $$
SELECT new_enum_val::text != old_enum_val::text;
$$ LANGUAGE SQL IMMUTABLE
]
(Background on this error at: https://sqlalche.me/e/14/f405)
This is because earlier this occurred - note the lack of quotes around CamelCase_old even though they got used above (also this seemed to not register an error - so it got renamed to something else?? ¯\_(ツ)_/¯ ):
2025-04-11 18:41:15,602 INFO sqlalchemy.engine.Engine ALTER TYPE "public"."CamelCase" RENAME TO CamelCase_old
2025-04-11 18:41:15,602 alembic[107459][INFO][sqlalchemy.engine.Engine]: ALTER TYPE "public"."CamelCase" RENAME TO CamelCase_old
2025-04-11 18:41:15,602 INFO sqlalchemy.engine.Engine [generated in 0.00022s] {}
2025-04-11 18:41:15,602 alembic[107459][INFO][sqlalchemy.engine.Engine]: [generated in 0.00022s] {}
2025-04-11 18:41:15,603 INFO sqlalchemy.engine.Engine CREATE TYPE "public"."CamelCase" AS ENUM('example1', 'flowspec', 'dms_ace', 'hello')
2025-04-11 18:41:15,603 alembic[107459][INFO][sqlalchemy.engine.Engine]: CREATE TYPE "public"."CamelCase" AS ENUM('active', 'passive', 'banned')
Quote the enum name in the ALTER TYPE and everything is happy.....
The text was updated successfully, but these errors were encountered:
Apteryx0
added a commit
to Apteryx0/alembic-postgresql-enum
that referenced
this issue
Apr 17, 2025
Uh oh!
There was an error while loading. Please reload this page.
Generating a migration like
Will produce an error like below when running
alembic upgrade heads
This is because earlier this occurred - note the lack of quotes around
CamelCase_old
even though they got used above (also this seemed to not register an error - so it got renamed to something else??¯\_(ツ)_/¯
):Quote the enum name in the
ALTER TYPE
and everything is happy.....The text was updated successfully, but these errors were encountered: