fix: explicitly create preferencetier enum
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
This commit is contained in:
parent
c4ba926a74
commit
ae3741c9ee
1 changed files with 5 additions and 0 deletions
|
|
@ -44,6 +44,11 @@ def upgrade() -> None:
|
|||
# 2. Add missing columns to UserVerticalPreference if they don't exist
|
||||
columns = [c['name'] for c in inspector.get_columns('userverticalpreference')]
|
||||
|
||||
# Explicitly create type execution for Postgres
|
||||
from sqlalchemy.dialects import postgresql
|
||||
enum_type = postgresql.ENUM('HEADLINER', 'MAIN_STAGE', 'SUPPORTING', name='preferencetier')
|
||||
enum_type.create(op.get_bind(), checkfirst=True)
|
||||
|
||||
with op.batch_alter_table('userverticalpreference', schema=None) as batch_op:
|
||||
if 'tier' not in columns:
|
||||
batch_op.add_column(sa.Column('tier', sa.Enum('HEADLINER', 'MAIN_STAGE', 'SUPPORTING', name='preferencetier'), server_default='MAIN_STAGE', nullable=False))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue