diff options
| author | 2026-07-01 23:06:39 +0200 | |
|---|---|---|
| committer | 2026-07-01 23:06:39 +0200 | |
| commit | 4105c3b777e82cb4b6dadf27c109dd21010ad8ce (patch) | |
| tree | ab497c0bac381d27765cff389bcf855a9e0bf0b7 /db/migrations/script.py.mako | |
| parent | d8968acab83c7a91b01eee4b35828a2b05c8dd6b (diff) | |
| download | server-4105c3b777e82cb4b6dadf27c109dd21010ad8ce.tar.gz server-4105c3b777e82cb4b6dadf27c109dd21010ad8ce.tar.bz2 server-4105c3b777e82cb4b6dadf27c109dd21010ad8ce.zip | |
Added db support
Diffstat (limited to 'db/migrations/script.py.mako')
| -rw-r--r-- | db/migrations/script.py.mako | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/db/migrations/script.py.mako b/db/migrations/script.py.mako new file mode 100644 index 0000000..697cf67 --- /dev/null +++ b/db/migrations/script.py.mako | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | """${message} | ||
| 2 | |||
| 3 | Revision ID: ${up_revision} | ||
| 4 | Revises: ${down_revision | comma,n} | ||
| 5 | Create Date: ${create_date} | ||
| 6 | |||
| 7 | """ | ||
| 8 | from typing import Sequence, Union | ||
| 9 | |||
| 10 | from alembic import op | ||
| 11 | import sqlalchemy as sa | ||
| 12 | import sqlmodel | ||
| 13 | ${imports if imports else ""} | ||
| 14 | |||
| 15 | # revision identifiers, used by Alembic. | ||
| 16 | revision: str = ${repr(up_revision)} | ||
| 17 | down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)} | ||
| 18 | branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)} | ||
| 19 | depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)} | ||
| 20 | |||
| 21 | |||
| 22 | def upgrade() -> None: | ||
| 23 | """Upgrade schema.""" | ||
| 24 | ${upgrades if upgrades else "pass"} | ||
| 25 | |||
| 26 | |||
| 27 | def downgrade() -> None: | ||
| 28 | """Downgrade schema.""" | ||
| 29 | ${downgrades if downgrades else "pass"} | ||
