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

Erreur MAJ taxref #376

Closed
gildeluermoz opened this issue Mar 16, 2023 · 2 comments
Closed

Erreur MAJ taxref #376

gildeluermoz opened this issue Mar 16, 2023 · 2 comments
Assignees

Comments

@gildeluermoz
Copy link
Contributor

Lorsque l'on souhaite monter des instances avec une version de taxref initiale inférieure à V14, une erreur se produit lors de l'étape concernant la bdc_statut

Il semble qu'avant Taxref V14, la table taxonomie.bdc_statut n'existait pas. Le script suivant lève donc une erreur qui bloque la procédure à l'étape TRUNCATE taxonomie.bdc_statut puis s'arrête :

def truncate_bdc_statuts():
db.session.execute(
"""
TRUNCATE
taxonomie.bdc_statut,
taxonomie.bdc_statut_type,
taxonomie.bdc_statut_text,
taxonomie.bdc_statut_values,
taxonomie.bdc_statut_taxons,
taxonomie.bdc_statut_cor_text_values,
taxonomie.bdc_statut_cor_text_area
"""
)

Comme TRUNCATE IF EXISTS n'est pas natif dans postgres, il faudrait créer une fonction comme proposé ci-dessous :
https://stackoverflow.com/questions/63004656/truncate-if-exists-in-psql-function-and-call-function

Qu'en pensez vous ?

Pour contourner, il faut créer une table taxonomie.bdc_statut vide avant de lancer le script apply_changes

@amandine-sahl
Copy link
Contributor

Je pense que c'est peut être plus cohérent de créer la table dans une révision alembic, pour être sur de l'homogénéité des bases

@camillemonchicourt
Copy link
Member

Corrigé dans la 1.11.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants