From 6200b031917e0b04169c39037ebdd63ee9fb3195 Mon Sep 17 00:00:00 2001 From: jna Date: Thu, 16 Jan 2025 15:47:45 +0100 Subject: [PATCH] feat: add description column on l_areas (#35) --- CHANGELOG.md | 5 ++++ .../31ca7fd0d2ea_added_l_areas_description.py | 29 +++++++++++++++++++ src/ref_geo/models.py | 1 + 3 files changed, 35 insertions(+) create mode 100644 src/ref_geo/migrations/versions/31ca7fd0d2ea_added_l_areas_description.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 7307cb2..ddb058b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +1.5.5 (XXXX-XX-XX) +------------------ + +- Ajout d'une colonne `description` dans la table `l_areas` (#35 par @juggler31) + 1.5.4 (2024-10-23) ----------------------------- diff --git a/src/ref_geo/migrations/versions/31ca7fd0d2ea_added_l_areas_description.py b/src/ref_geo/migrations/versions/31ca7fd0d2ea_added_l_areas_description.py new file mode 100644 index 0000000..8044632 --- /dev/null +++ b/src/ref_geo/migrations/versions/31ca7fd0d2ea_added_l_areas_description.py @@ -0,0 +1,29 @@ +"""Added l_areas description + +Revision ID: 31ca7fd0d2ea +Revises: 1fdac7036dd9 +Create Date: 2025-01-16 12:29:32.550025 + +""" + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = "1ca7fd0d2ea" +down_revision = "1fdac7036dd9" +branch_labels = None +depends_on = None + + +def upgrade(): + op.add_column( + table_name="l_areas", + schema="ref_geo", + column=sa.Column("description", sa.UnicodeText(), server_default=None), + ) + + +def downgrade(): + op.drop_column(table_name="l_areas", column_name="description", schema="ref_geo") diff --git a/src/ref_geo/models.py b/src/ref_geo/models.py index ff58d66..6efeac5 100644 --- a/src/ref_geo/models.py +++ b/src/ref_geo/models.py @@ -62,6 +62,7 @@ class LAreas(db.Model): enable = db.Column(db.Boolean, nullable=False, default=True) meta_create_date = db.Column(db.DateTime, default=datetime.now) meta_update_date = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now) + description = db.Column(db.UnicodeText) area_type = db.relationship("BibAreasTypes", lazy="select") parent_areas = db.relationship( "LAreas",