41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""add user table
|
|||
|
|
|
||
|
|
Revision ID: c59e689377c2
|
||
|
|
Revises: 7f92bfc47dfc
|
||
|
|
Create Date: 2026-10-03 19:06:44.095699
|
||
|
|
|
||
|
|
"""
|
||
|
|
from typing import Sequence, Union
|
||
|
|
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision: str = 'c59e689377c2'
|
||
|
|
down_revision: Union[str, Sequence[str], None] = '7f92bfc47dfc'
|
||
|
|
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.create_table('user',
|
||
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
||
|
|
sa.Column('username', sa.String(length=80), nullable=False),
|
||
|
|
sa.Column('password_hash', sa.String(length=255), nullable=False),
|
||
|
|
sa.Column('is_admin', sa.Boolean(), nullable=False),
|
||
|
|
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||
|
|
sa.PrimaryKeyConstraint('id'),
|
||
|
|
sa.UniqueConstraint('username')
|
||
|
|
)
|
||
|
|
# ### end Alembic commands ###
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade() -> None:
|
||
|
|
"""Downgrade schema."""
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.drop_table('user')
|
||
|
|
# ### end Alembic commands ###
|