Skip to content

Commit

Permalink
feat: add description column on l_areas
Browse files Browse the repository at this point in the history
  • Loading branch information
juggler31 committed Jan 16, 2025
1 parent c21eb14 commit ff0faf3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
-----------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
"""
)
1 change: 1 addition & 0 deletions src/ref_geo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ff0faf3

Please sign in to comment.