Try fixing database migrations
This commit is contained in:
parent
0002f66f36
commit
c3b866201b
2 changed files with 28 additions and 8 deletions
|
@ -0,0 +1,28 @@
|
|||
"""Add filter_state and update flags schema
|
||||
|
||||
Revision ID: dd9a3c418274
|
||||
Revises: 16d6335dd9a3
|
||||
Create Date: 2022-05-22 21:59:30.104333+00:00
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'dd9a3c418274'
|
||||
down_revision = '16d6335dd9a3'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('submissions', sa.Column('filter_state', sa.String(40), nullable=False))
|
||||
op.drop_constraint('flags_pkey', 'flags')
|
||||
op.add_column('flags', sa.Column('id', sa.Integer, nullable=False, primary_key=True, autoincrement=True))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column('submissions', 'filter_state')
|
||||
op.drop_column('flags', 'id')
|
||||
op.create_primary_key('flags_id_pk', 'flags', ['post_id', 'user_id'])
|
Loading…
Add table
Add a link
Reference in a new issue