black migration + version 9.3.16

This commit is contained in:
Emmanuel Viennet 2022-07-07 16:39:27 +02:00
parent f2f3fd0660
commit 75923c161a
2 changed files with 50 additions and 32 deletions

View File

@ -10,49 +10,67 @@ import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '0b337376e9f7'
down_revision = 'ee21c76c8183'
revision = "0b337376e9f7"
down_revision = "ee21c76c8183"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('are_historique',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('date', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
sa.Column('authenticated_user', sa.Text(), nullable=True),
sa.Column('entreprise_id', sa.Integer(), nullable=True),
sa.Column('object', sa.Text(), nullable=True),
sa.Column('object_id', sa.Integer(), nullable=True),
sa.Column('text', sa.Text(), nullable=True),
sa.PrimaryKeyConstraint('id')
op.create_table(
"are_historique",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"date",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=True,
),
sa.Column("authenticated_user", sa.Text(), nullable=True),
sa.Column("entreprise_id", sa.Integer(), nullable=True),
sa.Column("object", sa.Text(), nullable=True),
sa.Column("object_id", sa.Integer(), nullable=True),
sa.Column("text", sa.Text(), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
op.create_table('are_taxe_apprentissage',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('entreprise_id', sa.Integer(), nullable=True),
sa.Column('annee', sa.Integer(), nullable=True),
sa.Column('montant', sa.Integer(), nullable=True),
sa.Column('notes', sa.Text(), nullable=True),
sa.ForeignKeyConstraint(['entreprise_id'], ['are_entreprises.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id')
op.create_table(
"are_taxe_apprentissage",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("entreprise_id", sa.Integer(), nullable=True),
sa.Column("annee", sa.Integer(), nullable=True),
sa.Column("montant", sa.Integer(), nullable=True),
sa.Column("notes", sa.Text(), nullable=True),
sa.ForeignKeyConstraint(
["entreprise_id"], ["are_entreprises.id"], ondelete="cascade"
),
sa.PrimaryKeyConstraint("id"),
)
op.drop_table("are_logs")
op.add_column(
"are_entreprises", sa.Column("association", sa.Boolean(), nullable=True)
)
op.drop_table('are_logs')
op.add_column('are_entreprises', sa.Column('association', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('are_entreprises', 'association')
op.create_table('are_logs',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('date', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=True),
sa.Column('authenticated_user', sa.TEXT(), autoincrement=False, nullable=True),
sa.Column('object', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('text', sa.TEXT(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='are_logs_pkey')
op.drop_column("are_entreprises", "association")
op.create_table(
"are_logs",
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column(
"date",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=True,
),
sa.Column("authenticated_user", sa.TEXT(), autoincrement=False, nullable=True),
sa.Column("object", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column("text", sa.TEXT(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint("id", name="are_logs_pkey"),
)
op.drop_table('are_taxe_apprentissage')
op.drop_table('are_historique')
op.drop_table("are_taxe_apprentissage")
op.drop_table("are_historique")
# ### end Alembic commands ###

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.3.15"
SCOVERSION = "9.3.16"
SCONAME = "ScoDoc"