diff options
Diffstat (limited to 'db/migrations/versions/202607012255-40e20fbf63c9_.py')
| -rw-r--r-- | db/migrations/versions/202607012255-40e20fbf63c9_.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/db/migrations/versions/202607012255-40e20fbf63c9_.py b/db/migrations/versions/202607012255-40e20fbf63c9_.py new file mode 100644 index 0000000..a32131a --- /dev/null +++ b/db/migrations/versions/202607012255-40e20fbf63c9_.py | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | """empty message | ||
| 2 | |||
| 3 | Revision ID: 40e20fbf63c9 | ||
| 4 | Revises: 6ebaa6ab0f48 | ||
| 5 | Create Date: 2026-07-01 22:55:55.017591 | ||
| 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 = '40e20fbf63c9' | ||
| 17 | down_revision: Union[str, Sequence[str], None] = '6ebaa6ab0f48' | ||
| 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.add_column('user', sa.Column('external_id', sa.Uuid(), nullable=False, server_default=sa.text('gen_random_uuid()'))) | ||
| 26 | op.create_index(op.f('ix_user_external_id'), 'user', ['external_id'], unique=True) | ||
| 27 | # ### end Alembic commands ### | ||
| 28 | |||
| 29 | |||
| 30 | def downgrade() -> None: | ||
| 31 | """Downgrade schema.""" | ||
| 32 | # ### commands auto generated by Alembic - please adjust! ### | ||
| 33 | op.drop_index(op.f('ix_user_external_id'), table_name='user') | ||
| 34 | op.drop_column('user', 'external_id') | ||
| 35 | # ### end Alembic commands ### | ||
