diff --git a/migrations/versions/b1e6885bae70_ajout_colonnes_tables_relations_.py b/migrations/versions/b1e6885bae70_ajout_colonnes_tables_relations_.py new file mode 100644 index 0000000000..68d6980427 --- /dev/null +++ b/migrations/versions/b1e6885bae70_ajout_colonnes_tables_relations_.py @@ -0,0 +1,34 @@ +"""ajout colonnes tables relations entreprises + +Revision ID: b1e6885bae70 +Revises: e97b2a10f86c +Create Date: 2022-04-20 21:45:42.828853 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'b1e6885bae70' +down_revision = 'e97b2a10f86c' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('are_correspondants', sa.Column('civilite', sa.String(length=1), nullable=True)) + op.add_column('are_correspondants', sa.Column('origine', sa.Text(), nullable=True)) + op.add_column('are_correspondants', sa.Column('notes', sa.Text(), nullable=True)) + op.add_column('are_entreprises', sa.Column('active', sa.Boolean(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('are_entreprises', 'active') + op.drop_column('are_correspondants', 'notes') + op.drop_column('are_correspondants', 'origine') + op.drop_column('are_correspondants', 'civilite') + # ### end Alembic commands ### diff --git a/migrations/versions/e97b2a10f86c_tables_module_gestions_relations_.py b/migrations/versions/e97b2a10f86c_tables_module_gestions_relations_.py index 3580022f9c..b4a1995e6c 100644 --- a/migrations/versions/e97b2a10f86c_tables_module_gestions_relations_.py +++ b/migrations/versions/e97b2a10f86c_tables_module_gestions_relations_.py @@ -93,7 +93,9 @@ def upgrade(): def downgrade(): # ### commands auto generated by Alembic - please adjust! ### - op.drop_constraint(None, "are_offres", type_="foreignkey") + op.drop_constraint( + "are_offres_correspondant_id_fkey", "are_offres", type_="foreignkey" + ) op.drop_column("are_offres", "correspondant_id") op.add_column( "are_contacts", @@ -121,8 +123,10 @@ def downgrade(): op.add_column( "are_contacts", sa.Column("nom", sa.TEXT(), autoincrement=False, nullable=True) ) - op.drop_constraint(None, "are_contacts", type_="foreignkey") - op.drop_constraint(None, "are_contacts", type_="foreignkey") + op.drop_constraint( + "are_contacts_entreprise_fkey", "are_contacts", type_="foreignkey" + ) + op.drop_constraint("are_contacts_user_fkey", "are_contacts", type_="foreignkey") op.create_foreign_key( "are_contacts_entreprise_id_fkey", "are_contacts",