diff options
Diffstat (limited to 'db/migrations/versions/202607012255-6ebaa6ab0f48_.py')
| -rw-r--r-- | db/migrations/versions/202607012255-6ebaa6ab0f48_.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/db/migrations/versions/202607012255-6ebaa6ab0f48_.py b/db/migrations/versions/202607012255-6ebaa6ab0f48_.py new file mode 100644 index 0000000..9d4daa2 --- /dev/null +++ b/db/migrations/versions/202607012255-6ebaa6ab0f48_.py | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | """empty message | ||
| 2 | |||
| 3 | Revision ID: 6ebaa6ab0f48 | ||
| 4 | Revises: | ||
| 5 | Create Date: 2026-07-01 22:55:14.146711 | ||
| 6 | |||
| 7 | """ | ||
| 8 | from typing import Sequence, Union | ||
| 9 | |||
| 10 | from alembic import op | ||
| 11 | import sqlalchemy as sa | ||
| 12 | import sqlmodel | ||
| 13 | |||
| 14 | |||
| 15 | # revision identifiers, used by Alembic. | ||
| 16 | revision: str = '6ebaa6ab0f48' | ||
| 17 | down_revision: Union[str, Sequence[str], None] = None | ||
| 18 | branch_labels: Union[str, Sequence[str], None] = None | ||
| 19 | depends_on: Union[str, Sequence[str], None] = None | ||
| 20 | |||
| 21 | |||
| 22 | def upgrade() -> None: | ||
| 23 | """Upgrade schema.""" | ||
| 24 | # ### commands auto generated by Alembic - please adjust! ### | ||
| 25 | op.create_table('user', | ||
| 26 | sa.Column('id', sa.Integer(), nullable=False), | ||
| 27 | sa.Column('username', sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
| 28 | sa.PrimaryKeyConstraint('id') | ||
| 29 | ) | ||
| 30 | op.create_index(op.f('ix_user_username'), 'user', ['username'], unique=True) | ||
| 31 | # ### end Alembic commands ### | ||
| 32 | |||
| 33 | |||
| 34 | def downgrade() -> None: | ||
| 35 | """Downgrade schema.""" | ||
| 36 | # ### commands auto generated by Alembic - please adjust! ### | ||
| 37 | op.drop_index(op.f('ix_user_username'), table_name='user') | ||
| 38 | op.drop_table('user') | ||
| 39 | # ### end Alembic commands ### | ||
