fixed migrations

This commit is contained in:
2025-06-02 16:11:56 +02:00
parent c95a1c456b
commit 4dbaa27cba
98 changed files with 399 additions and 109 deletions

View File

@@ -8,6 +8,7 @@ Create Date: 2025-05-23 19:28:16.977187
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sqlalchemy import inspect
# revision identifiers, used by Alembic.
revision = 'c21f243b3640'
@@ -19,8 +20,13 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('contact')
conn = op.get_bind()
inspector = inspect(conn)
columns = [col['name'] for col in inspector.get_columns('user')]
with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.add_column(sa.Column('profile_picture', sa.String(length=255), nullable=True))
if 'profile_picture' not in columns:
batch_op.add_column(sa.Column('profile_picture', sa.String(length=255), nullable=True))
# ### end Alembic commands ###