ScoDoc-PE/migrations/versions/ec4f4f4ae9db_suppression_colonne_are_correspondants.py

31 lines
997 B
Python
Raw Normal View History

2022-07-11 20:17:34 +02:00
"""suppression colonne are_correspondants
Revision ID: ec4f4f4ae9db
Revises: 0b337376e9f7
Create Date: 2022-07-11 17:56:19.608275
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ec4f4f4ae9db'
down_revision = '0b337376e9f7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('are_correspondants_entreprise_id_fkey', 'are_correspondants', type_='foreignkey')
op.drop_column('are_correspondants', 'entreprise_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('are_correspondants', sa.Column('entreprise_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.create_foreign_key('are_correspondants_entreprise_id_fkey', 'are_correspondants', 'are_entreprises', ['entreprise_id'], ['id'], ondelete='CASCADE')
# ### end Alembic commands ###