2021-11-27 19:04:30 +01:00
|
|
|
"""cascades sur itemsuivi
|
|
|
|
|
|
|
|
Revision ID: 39818df276aa
|
|
|
|
Revises: 1efe07413835
|
|
|
|
Create Date: 2021-11-27 19:03:09.329065
|
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
2022-07-11 13:39:50 +02:00
|
|
|
revision = '39818df276aa'
|
|
|
|
down_revision = '1efe07413835'
|
2021-11-27 19:04:30 +01:00
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
2022-07-11 13:39:50 +02:00
|
|
|
op.drop_constraint('itemsuivi_tags_assoc_tag_id_fkey', 'itemsuivi_tags_assoc', type_='foreignkey')
|
|
|
|
op.drop_constraint('itemsuivi_tags_assoc_itemsuivi_id_fkey', 'itemsuivi_tags_assoc', type_='foreignkey')
|
|
|
|
op.create_foreign_key(None, 'itemsuivi_tags_assoc', 'itemsuivi', ['itemsuivi_id'], ['id'], ondelete='CASCADE')
|
|
|
|
op.create_foreign_key(None, 'itemsuivi_tags_assoc', 'itemsuivi_tags', ['tag_id'], ['id'], ondelete='CASCADE')
|
2021-11-27 19:04:30 +01:00
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
2022-07-11 13:39:50 +02:00
|
|
|
op.drop_constraint(None, 'itemsuivi_tags_assoc', type_='foreignkey')
|
|
|
|
op.drop_constraint(None, 'itemsuivi_tags_assoc', type_='foreignkey')
|
|
|
|
op.create_foreign_key('itemsuivi_tags_assoc_itemsuivi_id_fkey', 'itemsuivi_tags_assoc', 'itemsuivi', ['itemsuivi_id'], ['id'])
|
|
|
|
op.create_foreign_key('itemsuivi_tags_assoc_tag_id_fkey', 'itemsuivi_tags_assoc', 'itemsuivi_tags', ['tag_id'], ['id'])
|
2021-11-27 19:04:30 +01:00
|
|
|
# ### end Alembic commands ###
|