first commit
This commit is contained in:
42
migrations/versions/84e064c18a0f_adjustmen_modules.py
Normal file
42
migrations/versions/84e064c18a0f_adjustmen_modules.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""adjustmen_modules
|
||||
|
||||
Revision ID: 84e064c18a0f
|
||||
Revises: 03baecbcb5d9
|
||||
Create Date: 2026-04-01 19:09:19.420667
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '84e064c18a0f'
|
||||
down_revision: Union[str, None] = '03baecbcb5d9'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('branches', sa.Column('user_id', sa.Integer(), nullable=True))
|
||||
op.create_index('idx_branches_user', 'branches', ['user_id'], unique=False)
|
||||
op.create_foreign_key(None, 'branches', 'users', ['user_id'], ['id'])
|
||||
op.alter_column('invoices', 'id',
|
||||
existing_type=sa.INTEGER(),
|
||||
nullable=True,
|
||||
autoincrement=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('invoices', 'id',
|
||||
existing_type=sa.INTEGER(),
|
||||
nullable=False,
|
||||
autoincrement=True)
|
||||
op.drop_constraint(None, 'branches', type_='foreignkey')
|
||||
op.drop_index('idx_branches_user', table_name='branches')
|
||||
op.drop_column('branches', 'user_id')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user