Correction enumérations
This commit is contained in:
parent
782320652e
commit
63e2366837
|
@ -110,10 +110,10 @@ def upgrade() -> None:
|
|||
sa.Column('ordre', sa.Integer(), nullable=False),
|
||||
sa.Column('nom', sa.String(length=256), nullable=False),
|
||||
sa.Column('prenom', sa.String(length=256), nullable=False),
|
||||
sa.Column('sexe', sa.Enum('MASCULIN', 'FEMININ', name='genre'), nullable=False),
|
||||
sa.Column('sexe', sa.Enum('MASCULIN', 'FEMININ', name='europeennes_2024_genre'), nullable=False),
|
||||
sa.Column('date_naissance', sa.Date(), nullable=False),
|
||||
sa.Column('profession', sa.String(length=256), nullable=False),
|
||||
sa.Column('code_personnalite', sa.Enum('DEFAUT', 'EURODEPUTE', 'DEPUTE', 'SENATEUR', 'MINISTRE', 'PRESIDENT_CONSEIL_REGIONAL', 'PRESIDENT_CONSEIL_DEPARTEMENTAL', 'MAIRE', name='personnalite'), nullable=False),
|
||||
sa.Column('code_personnalite', sa.Enum('DEFAUT', 'EURODEPUTE', 'DEPUTE', 'SENATEUR', 'MINISTRE', 'PRESIDENT_CONSEIL_REGIONAL', 'PRESIDENT_CONSEIL_DEPARTEMENTAL', 'MAIRE', name='europeennes_2024_personnalite'), nullable=False),
|
||||
sa.Column('sortant', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['liste_id'], ['europeennes_2024_liste.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"""ajout modèles législatives 2022 + 2024
|
||||
|
||||
Revision ID: 6c0e8136b976
|
||||
Revision ID: d6a8883dd958
|
||||
Revises: c0443e979a90
|
||||
Create Date: 2024-06-20 16:46:42.696348
|
||||
Create Date: 2024-06-20 16:54:24.042835
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '6c0e8136b976'
|
||||
revision: str = 'd6a8883dd958'
|
||||
down_revision: Union[str, None] = 'c0443e979a90'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
@ -212,13 +212,13 @@ def upgrade() -> None:
|
|||
sa.Column('bloc_id', sa.Integer(), nullable=False),
|
||||
sa.Column('nom', sa.String(length=256), nullable=False),
|
||||
sa.Column('prenom', sa.String(length=256), nullable=False),
|
||||
sa.Column('sexe', sa.Enum('MASCULIN', 'FEMININ', name='genre'), nullable=False),
|
||||
sa.Column('sexe', sa.Enum('MASCULIN', 'FEMININ', name='legislatives_2022_genre'), nullable=False),
|
||||
sa.Column('date_naissance', sa.Date(), nullable=False),
|
||||
sa.Column('profession', sa.String(length=256), nullable=False),
|
||||
sa.Column('sortant', sa.Boolean(), nullable=False),
|
||||
sa.Column('nom_suppleance', sa.String(length=256), nullable=False),
|
||||
sa.Column('prenom_suppleance', sa.String(length=256), nullable=False),
|
||||
sa.Column('sexe_suppleance', sa.Enum('MASCULIN', 'FEMININ', name='genre'), nullable=False),
|
||||
sa.Column('sexe_suppleance', sa.Enum('MASCULIN', 'FEMININ', name='legislatives_2022_genre'), nullable=False),
|
||||
sa.Column('date_naissance_suppleance', sa.Date(), nullable=False),
|
||||
sa.Column('sortant_suppleance', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['bloc_id'], ['legislatives_2022_bloc.id'], ),
|
||||
|
@ -284,13 +284,13 @@ def upgrade() -> None:
|
|||
sa.Column('bloc_id', sa.Integer(), nullable=False),
|
||||
sa.Column('nom', sa.String(length=256), nullable=False),
|
||||
sa.Column('prenom', sa.String(length=256), nullable=False),
|
||||
sa.Column('sexe', sa.Enum('MASCULIN', 'FEMININ', name='genre'), nullable=False),
|
||||
sa.Column('sexe', sa.Enum('MASCULIN', 'FEMININ', name='legislatives_2024_genre'), nullable=False),
|
||||
sa.Column('date_naissance', sa.Date(), nullable=False),
|
||||
sa.Column('profession', sa.String(length=256), nullable=False),
|
||||
sa.Column('sortant', sa.Boolean(), nullable=False),
|
||||
sa.Column('nom_suppleance', sa.String(length=256), nullable=False),
|
||||
sa.Column('prenom_suppleance', sa.String(length=256), nullable=False),
|
||||
sa.Column('sexe_suppleance', sa.Enum('MASCULIN', 'FEMININ', name='genre'), nullable=False),
|
||||
sa.Column('sexe_suppleance', sa.Enum('MASCULIN', 'FEMININ', name='legislatives_2024_genre_suppl'), nullable=False),
|
||||
sa.Column('date_naissance_suppleance', sa.Date(), nullable=False),
|
||||
sa.Column('sortant_suppleance', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['bloc_id'], ['legislatives_2024_bloc.id'], ),
|
|
@ -67,10 +67,10 @@ class CandidatEuropeennes2024(Base):
|
|||
ordre: Mapped[int] = mapped_column(Integer())
|
||||
nom: Mapped[str] = mapped_column(String(256))
|
||||
prenom: Mapped[str] = mapped_column(String(256))
|
||||
sexe: Mapped[str] = mapped_column(Enum(Genre))
|
||||
sexe: Mapped[str] = mapped_column(Enum(Genre, name="europeennes_2024_genre"))
|
||||
date_naissance: Mapped[date] = mapped_column(Date())
|
||||
profession: Mapped[str] = mapped_column(String(256))
|
||||
code_personnalite: Mapped[str] = mapped_column(Enum(Personnalite))
|
||||
code_personnalite: Mapped[str] = mapped_column(Enum(Personnalite, name="europeennes_2024_personnalite"))
|
||||
sortant: Mapped[bool] = mapped_column(Boolean())
|
||||
|
||||
liste: Mapped[ListeEuropeennes2024] = relationship(ListeEuropeennes2024, back_populates="candidats")
|
||||
|
|
|
@ -56,13 +56,13 @@ class CandidatLegislatives2022(Base):
|
|||
bloc_id: Mapped[int] = mapped_column(ForeignKey("legislatives_2022_bloc.id"))
|
||||
nom: Mapped[str] = mapped_column(String(256))
|
||||
prenom: Mapped[str] = mapped_column(String(256))
|
||||
sexe: Mapped[str] = mapped_column(Enum(Genre))
|
||||
sexe: Mapped[str] = mapped_column(Enum(Genre, name="legislatives_2022_genre"))
|
||||
date_naissance: Mapped[date] = mapped_column(Date())
|
||||
profession: Mapped[str] = mapped_column(String(256))
|
||||
sortant: Mapped[bool] = mapped_column(Boolean())
|
||||
nom_suppleance: Mapped[str] = mapped_column(String(256))
|
||||
prenom_suppleance: Mapped[str] = mapped_column(String(256))
|
||||
sexe_suppleance: Mapped[str] = mapped_column(Enum(Genre))
|
||||
sexe_suppleance: Mapped[str] = mapped_column(Enum(Genre, name="legislatives_2022_genre"))
|
||||
date_naissance_suppleance: Mapped[date] = mapped_column(Date())
|
||||
sortant_suppleance: Mapped[bool] = mapped_column(Boolean())
|
||||
|
||||
|
|
|
@ -55,13 +55,13 @@ class CandidatLegislatives2024(Base):
|
|||
bloc_id: Mapped[int] = mapped_column(ForeignKey("legislatives_2024_bloc.id"))
|
||||
nom: Mapped[str] = mapped_column(String(256))
|
||||
prenom: Mapped[str] = mapped_column(String(256))
|
||||
sexe: Mapped[str] = mapped_column(Enum(Genre))
|
||||
sexe: Mapped[str] = mapped_column(Enum(Genre, name="legislatives_2024_genre"))
|
||||
date_naissance: Mapped[date] = mapped_column(Date())
|
||||
profession: Mapped[str] = mapped_column(String(256))
|
||||
sortant: Mapped[bool] = mapped_column(Boolean())
|
||||
nom_suppleance: Mapped[str] = mapped_column(String(256))
|
||||
prenom_suppleance: Mapped[str] = mapped_column(String(256))
|
||||
sexe_suppleance: Mapped[str] = mapped_column(Enum(Genre))
|
||||
sexe_suppleance: Mapped[str] = mapped_column(Enum(Genre, name="legislatives_2024_genre_suppl"))
|
||||
date_naissance_suppleance: Mapped[date] = mapped_column(Date())
|
||||
sortant_suppleance: Mapped[bool] = mapped_column(Boolean())
|
||||
|
||||
|
|
Loading…
Reference in New Issue