lavkach3
37 строк · 1.2 Кб
1"""init2
2
3Revision ID: 7c3c9e87f204
4Revises: 6ea1b38aba41
5Create Date: 2024-10-20 09:49:19.439688
6
7"""
8from alembic import op
9import sqlalchemy as sa
10import sqlalchemy_utils
11
12
13# revision identifiers, used by Alembic.
14revision = '7c3c9e87f204'
15down_revision = '6ea1b38aba41'
16branch_labels = None
17depends_on = None
18
19
20def upgrade():
21# ### commands auto generated by Alembic - please adjust! ###
22op.add_column('bus', sa.Column('user_id', sa.Uuid(), nullable=True))
23op.create_index(op.f('ix_bus_user_id'), 'bus', ['user_id'], unique=False)
24op.drop_index('ix_user_store_id', table_name='user')
25op.drop_constraint('user_store_id_fkey', 'user', type_='foreignkey')
26op.drop_column('user', 'store_id')
27# ### end Alembic commands ###
28
29
30def downgrade():
31# ### commands auto generated by Alembic - please adjust! ###
32op.add_column('user', sa.Column('store_id', sa.UUID(), autoincrement=False, nullable=True))
33op.create_foreign_key('user_store_id_fkey', 'user', 'store', ['store_id'], ['id'])
34op.create_index('ix_user_store_id', 'user', ['store_id'], unique=False)
35op.drop_index(op.f('ix_bus_user_id'), table_name='bus')
36op.drop_column('bus', 'user_id')
37# ### end Alembic commands ###