Skip to content

Commit

Permalink
Drop bib_themes.id_droit column (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl authored Aug 29, 2024
1 parent 3c485fb commit 4e1875f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Drop bib_themes.id_droit column
Revision ID: 6a20cd1055ec
Revises: 44447746cacc
Create Date: 2024-08-28 15:38:36.829167
"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "6a20cd1055ec"
down_revision = "44447746cacc"
branch_labels = None
depends_on = None


def upgrade():
op.drop_column(table_name="bib_themes", column_name="id_droit", schema="taxonomie")


def downgrade():
op.add_column(
table_name="bib_themes",
column=sa.Column("id_droit", sa.Integer(), nullable=False, server_default="0"),
schema="taxonomie",
)
1 change: 0 additions & 1 deletion apptax/taxonomie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class BibThemes(db.Model):
nom_theme = db.Column(db.Unicode)
desc_theme = db.Column(db.Unicode)
ordre = db.Column(db.Integer)
id_droit = db.Column(db.Integer)
attributs = db.relationship("BibAttributs", lazy="select", back_populates="theme")

def __repr__(self):
Expand Down
4 changes: 2 additions & 2 deletions data/taxhubdata_atlas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SET client_min_messages = warning;
SET search_path = taxonomie, pg_catalog;

-- Insertion du thème regroupant les attributs utilisés par GeoNature-atlas
INSERT INTO bib_themes (nom_theme, desc_theme, ordre, id_droit)
VALUES ('Atlas', 'Informations relatives à GeoNature-atlas', 2, 3);
INSERT INTO bib_themes (nom_theme, desc_theme, ordre)
VALUES ('Atlas', 'Informations relatives à GeoNature-atlas', 2);

-- Insertion des attributs utilisés par GeoNature-atlas
INSERT INTO bib_attributs (id_attribut, nom_attribut, label_attribut, liste_valeur_attribut, obligatoire, desc_attribut, type_attribut, type_widget, regne, group2_inpn, id_theme, ordre) VALUES (100, 'atlas_description', 'Description', '{}', false, 'Donne une description du taxon pour l''atlas', 'text', 'textarea', NULL, NULL, (SELECT max(id_theme) FROM taxonomie.bib_themes), 1);
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Si vous utilisez GeoNature, TaxHub sera désormais intégré à celui-ci et il n
- Evolution migration Taxref (#382)
- MAJ UHAM 3.0.0 avec authentification externe
- Suppression de la colonne "supprime" des médias qui effectuait une suppression logique et non physique des médias (#538)
- Suppression de la colonne `id_droit` de la table `bib_themes`.


**⚠️ Notes de version**

Expand Down

0 comments on commit 4e1875f

Please sign in to comment.