Skip to content

Commit 26652a8

Browse files
committed
refactor: Normalize line endings from CRLF to LF across database and configuration files
1 parent d69ea4c commit 26652a8

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alembic]
22
script_location = app/db/migrations
3-
file_template = %%(year)d-%%(month).2d-%%(day).2d-%%(hour).2d-%%(minute).2d_%%(rev)s
3+
file_template = %%(year)d-%%(month).2d_%%(day).2d-%%(hour).2d%%(minute).2d_%%(rev)s
44
prepend_sys_path = .
55
output_encoding = utf-8
66
# truncate_slug_length = 40

app/db/meta.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
import sqlalchemy as sa
22

3-
meta = sa.MetaData()
3+
meta = sa.MetaData(
4+
naming_convention={
5+
"ix": "ix_%(column_0_label)s",
6+
"uq": "uq_%(table_name)s_%(column_0_N_name)s",
7+
"ck": "ck_%(table_name)s_%(constraint_name)s",
8+
"fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
9+
"pk": "pk_%(table_name)s",
10+
}
11+
)

app/db/models/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
class BaseMetadata(DeclarativeBase):
1717
"""BaseMetadata for all models."""
1818

19+
# see: https://alembic.sqlalchemy.org/en/latest/naming.html#integration-of-naming-conventions-into-operations-autogenerate
1920
metadata = meta
2021

2122

0 commit comments

Comments
 (0)