From 5024658a87ae38fc5202afc90e6edb9dde393aed Mon Sep 17 00:00:00 2001 From: Arthur ZHU Date: Fri, 24 Dec 2021 10:46:36 +0100 Subject: [PATCH] ajout colonne date_envoi --- app/entreprises/models.py | 3 ++- .../f3b62d64efa3_creation_tables_relations_entreprises.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/entreprises/models.py b/app/entreprises/models.py index b4ac1a4b..ec963be2 100644 --- a/app/entreprises/models.py +++ b/app/entreprises/models.py @@ -57,4 +57,5 @@ class EntrepriseEnvoiOffre(db.Model): __tablename__ = "entreprise_envoi_offre" id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey("user.id")) - offre_id = db.Column(db.Integer, db.ForeignKey("entreprise_offre.id")) \ No newline at end of file + offre_id = db.Column(db.Integer, db.ForeignKey("entreprise_offre.id")) + date_envoi = db.Column(db.DateTime(timezone=True), server_default=db.func.now()) \ No newline at end of file diff --git a/migrations/versions/f3b62d64efa3_creation_tables_relations_entreprises.py b/migrations/versions/f3b62d64efa3_creation_tables_relations_entreprises.py index cc524777..7d629e28 100644 --- a/migrations/versions/f3b62d64efa3_creation_tables_relations_entreprises.py +++ b/migrations/versions/f3b62d64efa3_creation_tables_relations_entreprises.py @@ -57,6 +57,7 @@ def upgrade(): sa.Column('id', sa.Integer(), nullable=False), sa.Column('user_id', sa.Integer(), nullable=True), sa.Column('offre_id', sa.Integer(), nullable=True), + sa.Column('date_envoi', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True), sa.ForeignKeyConstraint(['offre_id'], ['entreprise_offre.id'], ), sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), sa.PrimaryKeyConstraint('id')