Skip to content

Commit f31ea94

Browse files
committed
chore(backend): Add datetime to migration filenames
1 parent 78950f2 commit f31ea94

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

app_api/app/db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from advanced_alchemy.config import AsyncSessionConfig
99
from advanced_alchemy.extensions.litestar import (
10+
AlembicAsyncConfig,
1011
EngineConfig,
1112
SQLAlchemyAsyncConfig,
1213
SQLAlchemyPlugin,
@@ -33,6 +34,9 @@ def create_sqlalchemy_config(app_settings: Settings | None = None) -> SQLAlchemy
3334
engine_config=EngineConfig(echo=False),
3435
session_config=AsyncSessionConfig(expire_on_commit=False),
3536
before_send_handler="autocommit",
37+
alembic_config=AlembicAsyncConfig(
38+
toml_file="pyproject.toml",
39+
),
3640
)
3741

3842

app_api/migrations/versions/73393d61a2f9_add_permissions.py renamed to app_api/migrations/versions/20250810-1345_73393d61a2f9_add_permissions.py

File renamed without changes.

app_api/migrations/versions/9967ec7d0829_init.py renamed to app_api/migrations/versions/20250810-1345_9967ec7d0829_init.py

File renamed without changes.

app_api/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pythonpath = ["."]
4242

4343
[tool.alembic]
4444
script_location = "%(here)s/migrations"
45-
file_template = "%%(year)d-%%(month).2d-%%(day).2d_%%(slug)s_%%(rev)s"
45+
file_template = "%%(year)d%%(month).2d%%(day).2d-%%(hour).2d%%(minute).2d_%%(rev)s_%%(slug)s"
4646
prepend_sys_path = ["."]
4747
truncate_slug_length = 40
4848
output_encoding = "utf-8"

0 commit comments

Comments
 (0)