Skip to content

Commit

Permalink
feat: add description column on l_areas (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
juggler31 authored Jan 16, 2025
1 parent c21eb14 commit 6200b03
Show file tree
Hide file tree
Showing 3 changed files with 35 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` (#35 par @juggler31)

1.5.4 (2024-10-23)
-----------------------------

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

0 comments on commit 6200b03

Please sign in to comment.