diff options
Diffstat (limited to 'migrations/versions/d158cf8f4950_.py')
| -rw-r--r-- | migrations/versions/d158cf8f4950_.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/migrations/versions/d158cf8f4950_.py b/migrations/versions/d158cf8f4950_.py new file mode 100644 index 0000000..392d3bf --- /dev/null +++ b/migrations/versions/d158cf8f4950_.py @@ -0,0 +1,39 @@ +"""empty message + +Revision ID: d158cf8f4950 +Revises: +Create Date: 2025-07-06 15:31:24.124657 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'd158cf8f4950' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('user', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('username', sa.String(length=64), nullable=False), + sa.Column('password_hash', sa.String(length=256), nullable=True), + sa.PrimaryKeyConstraint('id') + ) + with op.batch_alter_table('user', schema=None) as batch_op: + batch_op.create_index(batch_op.f('ix_user_username'), ['username'], unique=True) + + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('user', schema=None) as batch_op: + batch_op.drop_index(batch_op.f('ix_user_username')) + + op.drop_table('user') + # ### end Alembic commands ### |
