33 lines
949 B
Python
33 lines
949 B
Python
"""fix FK
|
|
|
|
Revision ID: 3510de1e1ff1
|
|
Revises: 58cc3bbaabd1
|
|
Create Date: 2023-07-16 01:28:47.704514
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '3510de1e1ff1'
|
|
down_revision = '58cc3bbaabd1'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_foreign_key(None, 'addresses', 'persons', ['person_id'], ['id'])
|
|
op.create_foreign_key(None, 'contacts', 'persons', ['person_id'], ['id'])
|
|
op.create_foreign_key(None, 'documents', 'persons', ['person_id'], ['id'])
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(None, 'documents', type_='foreignkey')
|
|
op.drop_constraint(None, 'contacts', type_='foreignkey')
|
|
op.drop_constraint(None, 'addresses', type_='foreignkey')
|
|
# ### end Alembic commands ###
|