Skip to content

Commit

Permalink
add a dedicated migrate script
Browse files Browse the repository at this point in the history
  • Loading branch information
Camels Server committed Jan 17, 2025
1 parent 4304a4f commit 3291f43
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ RUN pip install --upgrade pip && \
#pip install poetry && \
# poetry config virtualenvs.create false && \
#cd /app && poetry install
cd /app && pip install -e .
cd /app && pip install -e . && \
pip install fire

WORKDIR /app

Expand Down
17 changes: 17 additions & 0 deletions metacatalog_api/migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os

from metacatalog_api import core


def migrate(schema: str = 'public'):
"""
Migrate the database schema to the latest version.
:param schema: The schema holding the tables, usually 'public' (default)
"""
core.migrate_db(schema=schema)


if __name__ == '__main__':
import fire
fire.Fire(migrate)

0 comments on commit 3291f43

Please sign in to comment.