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

Last PR corrections #92

Closed
wants to merge 24 commits into from
Closed

Last PR corrections #92

wants to merge 24 commits into from

Conversation

rv2931
Copy link
Collaborator

@rv2931 rv2931 commented Mar 4, 2024

Fix: Some corrections has been identified after PR #91
Fix: rollback to postgis image for postgres container, the trawlwatcher if in private repository and maybe not conform with alembic
Feat: add an init service in docker compose file
Feat: conformization of loading settings from bloom.config settings class

Feat: add BLOOM_CONFIG env variable, usefull to select .env configuration file when launch in native deployment mode (non docker). Just export BLOOM_CONFIG=.env.local; /venv/bin/python app.py

@rv2931 rv2931 changed the title Last PR corrections & Bloom config Last PR corrections Mar 4, 2024
@rv2931
Copy link
Collaborator Author

rv2931 commented Mar 4, 2024

je tombe sur une erreur dans ma PR (#92)
alembic check

INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
ERROR [alembic.util.messaging] Target database is not up to date.
  FAILED: Target database is not up to date.

Du coup je fais un alembic upgrade head
ça se passe correctement:

INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> e52b9542531c, create marine traffic positions and polygons table
INFO  [alembic.runtime.migration] Running upgrade e52b9542531c -> 68c9f220a07f, add columns in spire table
INFO  [alembic.runtime.migration] Running upgrade 68c9f220a07f -> 1fd83d22bd1e, create alert table
INFO  [alembic.runtime.migration] Running upgrade 1fd83d22bd1e -> 961cee5426d6, create amp table

Par contre quand je refait un check j'ai

INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
ERROR [alembic.util.messaging] Can't proceed with --autogenerate option; environment script /source_code/alembic/env.py does not provide a MetaData object or sequence of objects to the context.
  FAILED: Can't proceed with --autogenerate option; environment script /source_code/alembic/env.py does not provide a
  MetaData object or sequence of objects to the context.

Je m'y connais pas trop en alembic, ni le module ni l'alcool, et je ne crois pas que ça vienne de ma modif (chargement des paramètres à partir de bloom.config)

@rv2931
Copy link
Collaborator Author

rv2931 commented Mar 4, 2024

Ok. Bon en fait c'est du à différents problèmes liés à l'incohérence du model actuel avec la base de données. Globalement il manque des révisions et la déclaration (ou demander à alembic d'ignorer ?) d'autres tables (à priori)
Du coup j'ai changé ma commande check par une upgrade qui retourne ok dans mon conteneur init, mais à terme idéalement il faudrait que ce soit du alembic check pour s'assurer que la base est cohérente avec le code avant de lancer l'application

@rv2931 rv2931 marked this pull request as ready for review March 4, 2024 18:55
@rv2931 rv2931 mentioned this pull request Mar 4, 2024
@rv2931
Copy link
Collaborator Author

rv2931 commented Mar 6, 2024

Abandonned as this PR is now integrated in #93

@rv2931 rv2931 closed this Mar 6, 2024
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

Successfully merging this pull request may close these issues.

1 participant