mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 09:52:38 +02:00
🚚 — Move alembic.ini in argos directory
This commit is contained in:
parent
fa4de8a2b7
commit
1a44094084
3 changed files with 5 additions and 4 deletions
|
@ -172,7 +172,8 @@ async def migrate():
|
|||
|
||||
settings = get_app_settings()
|
||||
|
||||
alembic_cfg = Config("alembic.ini")
|
||||
current_dir = os.path.dirname(__file__)
|
||||
alembic_cfg = Config(os.path.join(current_dir, "server/migrations/alembic.ini"))
|
||||
alembic_cfg.set_main_option("sqlalchemy.url", settings.database_url)
|
||||
command.upgrade(alembic_cfg, "head")
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[alembic]
|
||||
script_location = alembic
|
||||
script_location = %(here)s
|
||||
prepend_sys_path = .
|
||||
|
||||
version_path_separator = os
|
||||
sqlalchemy.url = sqlite:////tmp/argos.db
|
||||
|
||||
version_locations = %(here)s/argos/server/migrations/versions
|
||||
version_locations = %(here)s/versions
|
||||
|
||||
# Logging configuration
|
||||
[loggers]
|
|
@ -7,7 +7,7 @@ First, do your changes in the code, change the model, add new tables, etc. Once
|
|||
you're done, you can create a new migration.
|
||||
|
||||
```bash
|
||||
venv/bin/alembic revision --autogenerate -m "migration reason"
|
||||
venv/bin/alembic -c argos/server/migrations/alembic.ini revision --autogenerate -m "migration reason"
|
||||
```
|
||||
|
||||
Edit the created file to remove comments and adapt it to make sure the migration is complete (Alembic is not powerful enough to cover all the corner cases).
|
||||
|
|
Loading…
Reference in a new issue