Skip to content

Commit

Permalink
Feat(import) add mapping_condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Narcisi committed Mar 20, 2024
1 parent 3acdfe7 commit cc68931
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/geonature/core/imports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ class BibFields(db.Model):
nomenclature_type = relationship("BibNomenclaturesTypes")
display = db.Column(db.Boolean, nullable=False)
multi = db.Column(db.Boolean)
mapping_condition = db.Column(db.Unicode, nullable=True)

entities = relationship("EntityField", back_populates="field")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""add required conditions in import
Revision ID: 8b149244d586
Revises: fe3d0b49ee14
Create Date: 2024-03-20 11:17:57.360785
"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "8b149244d586"
down_revision = "fe3d0b49ee14"
branch_labels = None
depends_on = None


def upgrade():
op.add_column(
table_name="bib_fields",
schema="gn_imports",
column=sa.Column("mapping_condition", sa.String()),
)
pass


def downgrade():
op.drop_column(table_name="bib_fields", schema="gn_imports", column_name="mapping_condition")
pass

0 comments on commit cc68931

Please sign in to comment.