added historique
This commit is contained in:
81
cao_blogr/alembic/versions/20230123_19d939dbc6d0.py
Normal file
81
cao_blogr/alembic/versions/20230123_19d939dbc6d0.py
Normal file
@@ -0,0 +1,81 @@
|
||||
"""add portfolio tables
|
||||
|
||||
Revision ID: 19d939dbc6d0
|
||||
Revises: 7995372bd306
|
||||
Create Date: 2023-01-23 14:49:31.713228
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '19d939dbc6d0'
|
||||
down_revision = '7995372bd306'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('actifs',
|
||||
sa.Column('no_id', sa.Integer(), nullable=False),
|
||||
sa.Column('symbole', sa.Unicode(length=45), nullable=False),
|
||||
sa.Column('libelle', sa.Unicode(length=45), nullable=False),
|
||||
sa.Column('classe', sa.Unicode(length=45), nullable=False),
|
||||
sa.Column('nombre', sa.Integer(), nullable=True),
|
||||
sa.Column('cours', sa.Float(), nullable=True),
|
||||
sa.Column('pru', sa.Float(), nullable=True),
|
||||
sa.Column('valeur', sa.Float(), nullable=True),
|
||||
sa.Column('plus_value', sa.Float(), nullable=True),
|
||||
sa.Column('pc_plusvalue', sa.Float(), nullable=True),
|
||||
sa.Column('rendement', sa.Float(), nullable=True),
|
||||
sa.Column('pc_rdt', sa.Float(), nullable=True),
|
||||
sa.Column('pc_allocation', sa.Float(), nullable=True),
|
||||
sa.Column('ter', sa.Float(), nullable=True),
|
||||
sa.Column('ter_pondere', sa.Float(), nullable=True),
|
||||
sa.Column('devise', sa.Unicode(length=45), nullable=True),
|
||||
sa.Column('parite', sa.Float(), nullable=True),
|
||||
sa.Column('website', sa.Unicode(length=100), nullable=True),
|
||||
sa.Column('modif_le', sa.DateTime(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('no_id', name=op.f('pk_actifs')),
|
||||
sa.UniqueConstraint('symbole', name=op.f('uq_actifs_symbole'))
|
||||
)
|
||||
op.create_index('symbole_index', 'actifs', ['symbole'], unique=False)
|
||||
op.create_table('allocation',
|
||||
sa.Column('no_cat', sa.Integer(), nullable=False),
|
||||
sa.Column('classe', sa.Unicode(length=45), nullable=False),
|
||||
sa.Column('pc_cible', sa.Integer(), nullable=True),
|
||||
sa.Column('pc_atteint', sa.Float(), nullable=True),
|
||||
sa.Column('valeur', sa.Float(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('no_cat', name=op.f('pk_allocation'))
|
||||
)
|
||||
op.create_table('classes',
|
||||
sa.Column('classe', sa.Unicode(), nullable=False),
|
||||
sa.Column('type', sa.Unicode(length=45), nullable=True),
|
||||
sa.Column('ordre', sa.Integer(), nullable=True),
|
||||
sa.Column('bg_color', sa.Unicode(length=45), nullable=True),
|
||||
sa.PrimaryKeyConstraint('classe', name=op.f('pk_classes'))
|
||||
)
|
||||
op.create_index('ordre_index', 'classes', ['ordre'], unique=False)
|
||||
op.create_table('histo',
|
||||
sa.Column('no_id', sa.Integer(), nullable=False),
|
||||
sa.Column('date', sa.DateTime(), nullable=True),
|
||||
sa.Column('mvt_cash', sa.Float(), nullable=True),
|
||||
sa.Column('valeur_pf', sa.Float(), nullable=True),
|
||||
sa.Column('nb_part', sa.Float(), nullable=True),
|
||||
sa.Column('val_part', sa.Float(), nullable=True),
|
||||
sa.Column('cours_ref', sa.Float(), nullable=True),
|
||||
sa.Column('val_part_ref', sa.Float(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('no_id', name=op.f('pk_histo'))
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('histo')
|
||||
op.drop_index('ordre_index', table_name='classes')
|
||||
op.drop_table('classes')
|
||||
op.drop_table('allocation')
|
||||
op.drop_index('symbole_index', table_name='actifs')
|
||||
op.drop_table('actifs')
|
||||
# ### end Alembic commands ###
|
||||
26
cao_blogr/alembic/versions/20230123_7995372bd306.py
Normal file
26
cao_blogr/alembic/versions/20230123_7995372bd306.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""add portfolio tables
|
||||
|
||||
Revision ID: 7995372bd306
|
||||
Revises: fe8f8a5bfdb5
|
||||
Create Date: 2023-01-23 14:43:22.632056
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7995372bd306'
|
||||
down_revision = 'fe8f8a5bfdb5'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,8 +1,8 @@
|
||||
"""init
|
||||
"""add portfolio tables
|
||||
|
||||
Revision ID: a632e375e7dc
|
||||
Revision ID: fe8f8a5bfdb5
|
||||
Revises:
|
||||
Create Date: 2023-01-21 11:25:48.517435
|
||||
Create Date: 2023-01-23 14:42:10.171291
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
@@ -10,17 +10,17 @@ import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a632e375e7dc'
|
||||
revision = 'fe8f8a5bfdb5'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('entries', 'author')
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('entries', sa.Column('author', sa.VARCHAR(length=50), nullable=True))
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user