diff --git a/CHANGELOG.md b/CHANGELOG.md index 7307cb2..941b3ac 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 + 1.5.4 (2024-10-23) ----------------------------- diff --git a/src/ref_geo/migrations/versions/c83cc2389a49_added_l_areas_description.py b/src/ref_geo/migrations/versions/c83cc2389a49_added_l_areas_description.py new file mode 100644 index 0000000..8da0dcb --- /dev/null +++ b/src/ref_geo/migrations/versions/c83cc2389a49_added_l_areas_description.py @@ -0,0 +1,32 @@ +"""Added l_areas description + +Revision ID: c83cc2389a49 +Revises: 1fdac7036dd9 +Create Date: 2025-01-15 17:41:34.764302 + +""" +from alembic import op + + +# revision identifiers, used by Alembic. +revision = 'c83cc2389a49' +down_revision = '1fdac7036dd9' +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute( + """ + ALTER TABLE ref_geo.l_areas + ADD COLUMN description TEXT default NULL; + """ + ) + +def downgrade(): + op.execute( + """ + ALTER TABLE ref_geo.l_areas + DROP COLUMN description; + """ + ) diff --git a/src/ref_geo/models.py b/src/ref_geo/models.py index ff58d66..f1e1bbd 100644 --- a/src/ref_geo/models.py +++ b/src/ref_geo/models.py @@ -63,6 +63,7 @@ class LAreas(db.Model): meta_create_date = db.Column(db.DateTime, default=datetime.now) meta_update_date = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now) area_type = db.relationship("BibAreasTypes", lazy="select") + description = db.Column(db.UnicodeText) parent_areas = db.relationship( "LAreas", secondary=cor_areas,