mirror of
https://github.com/Xevion/contest-assistant.git
synced 2025-12-06 01:14:37 -06:00
Commit Alembic 'count' column migration script
This uses `server_default` for the column creation instead of default. Perhaps it is the ALTER COLUMN or NULLABLE part of the migration causing the issue, I'm still not completely sure.
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
"""Added count column for # of votes
|
||||||
|
|
||||||
|
Revision ID: c8eed03794f7
|
||||||
|
Revises: b26551e73407
|
||||||
|
Create Date: 2021-02-18 02:49:47.900742-06:00
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'c8eed03794f7'
|
||||||
|
down_revision = 'b26551e73407'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('submission', schema=None) as batch_op:
|
||||||
|
batch_op.add_column(sa.Column('count', sa.Integer(), server_default="0", nullable=False))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('submission', schema=None) as batch_op:
|
||||||
|
batch_op.drop_column('count')
|
||||||
|
# ### end Alembic commands ###
|
||||||
Reference in New Issue
Block a user