mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +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()
|
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)
|
alembic_cfg.set_main_option("sqlalchemy.url", settings.database_url)
|
||||||
command.upgrade(alembic_cfg, "head")
|
command.upgrade(alembic_cfg, "head")
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
[alembic]
|
[alembic]
|
||||||
script_location = alembic
|
script_location = %(here)s
|
||||||
prepend_sys_path = .
|
prepend_sys_path = .
|
||||||
|
|
||||||
version_path_separator = os
|
version_path_separator = os
|
||||||
sqlalchemy.url = sqlite:////tmp/argos.db
|
sqlalchemy.url = sqlite:////tmp/argos.db
|
||||||
|
|
||||||
version_locations = %(here)s/argos/server/migrations/versions
|
version_locations = %(here)s/versions
|
||||||
|
|
||||||
# Logging configuration
|
# Logging configuration
|
||||||
[loggers]
|
[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.
|
you're done, you can create a new migration.
|
||||||
|
|
||||||
```bash
|
```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).
|
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