Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop bib_themes.id_droit column #550

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading