43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
"""Initial migration
|
|
|
|
Revision ID: edca9d8e52b5
|
|
Revises:
|
|
Create Date: 2026-11-07 19:23:14.677545
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'edca9d8e52b5'
|
|
down_revision: Union[str, Sequence[str], None] = None
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_users_id'), table_name='users')
|
|
op.drop_index(op.f('ix_users_username'), table_name='users')
|
|
op.drop_table('users')
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('users',
|
|
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
|
sa.Column('username', sa.VARCHAR(length=128), autoincrement=False, nullable=False),
|
|
sa.Column('hashed_password', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
|
|
sa.Column('isAdmin', sa.BOOLEAN(), autoincrement=False, nullable=False),
|
|
sa.PrimaryKeyConstraint('id', name=op.f('users_pkey'))
|
|
)
|
|
op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=True)
|
|
op.create_index(op.f('ix_users_id'), 'users', ['id'], unique=False)
|
|
# ### end Alembic commands ###
|