added portfolio view

This commit is contained in:
2023-01-26 16:22:58 +01:00
parent 060b796636
commit 4a55f94551
16 changed files with 750 additions and 87 deletions

View File

@@ -0,0 +1,30 @@
"""added relationship allocation-classe
Revision ID: 42a297861f20
Revises: 19d939dbc6d0
Create Date: 2023-01-26 14:23:42.771763
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '42a297861f20'
down_revision = '19d939dbc6d0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('allocation', sa.Column('classe_id', sa.Unicode(length=45), nullable=True))
op.create_foreign_key(op.f('fk_allocation_classe_id_classes'), 'allocation', 'classes', ['classe_id'], ['classe'])
op.drop_column('allocation', 'classe')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('allocation', sa.Column('classe', sa.VARCHAR(length=45), nullable=False))
op.drop_constraint(op.f('fk_allocation_classe_id_classes'), 'allocation', type_='foreignkey')
op.drop_column('allocation', 'classe_id')
# ### end Alembic commands ###

View File

@@ -0,0 +1,34 @@
"""added relationship allocation-classe
Revision ID: bbfb79cb9dad
Revises: 42a297861f20
Create Date: 2023-01-26 14:41:29.955558
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bbfb79cb9dad'
down_revision = '42a297861f20'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('allocation',
sa.Column('no_cat', sa.Integer(), nullable=False),
sa.Column('classe_id', sa.Unicode(length=45), nullable=True),
sa.Column('pc_cible', sa.Integer(), nullable=True),
sa.Column('pc_atteint', sa.Float(), nullable=True),
sa.Column('valeur', sa.Float(), nullable=True),
sa.ForeignKeyConstraint(['classe_id'], ['classes.classe'], name=op.f('fk_allocation_classe_id_classes')),
sa.PrimaryKeyConstraint('no_cat', name=op.f('pk_allocation'))
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('allocation')
# ### end Alembic commands ###