Fix migration
This commit is contained in:
@@ -27,10 +27,10 @@ def column_exists(table_name: str, column_name: str) -> bool:
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if not column_exists('marathons', 'cover_url'):
|
||||
op.add_column('marathons', sa.Column('cover_url', sa.String(500), nullable=True))
|
||||
if not column_exists('marathons', 'cover_path'):
|
||||
op.add_column('marathons', sa.Column('cover_path', sa.String(500), nullable=True))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if column_exists('marathons', 'cover_url'):
|
||||
op.drop_column('marathons', 'cover_url')
|
||||
if column_exists('marathons', 'cover_path'):
|
||||
op.drop_column('marathons', 'cover_path')
|
||||
|
||||
Reference in New Issue
Block a user