diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-03-22 19:56:47 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-03-22 20:19:27 +0300 |
| commit | 536d022e8a55f6e53f01dfb7e0fae2ef24385aad (patch) | |
| tree | 721d7195db7fc12c725b27301f77e345df64d1b4 /models/base.py | |
| download | vpn_manager_bot-536d022e8a55f6e53f01dfb7e0fae2ef24385aad.tar.gz vpn_manager_bot-536d022e8a55f6e53f01dfb7e0fae2ef24385aad.zip | |
Init project
Diffstat (limited to 'models/base.py')
| -rw-r--r-- | models/base.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/models/base.py b/models/base.py new file mode 100644 index 0000000..98f3c95 --- /dev/null +++ b/models/base.py | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | from sqlalchemy import MetaData | ||
| 2 | from sqlalchemy.orm import DeclarativeBase | ||
| 3 | |||
| 4 | |||
| 5 | class BaseTable(DeclarativeBase): | ||
| 6 | metadata = MetaData( | ||
| 7 | naming_convention={ | ||
| 8 | "ix": "ix_%(column_0_label)s", | ||
| 9 | "uq": "uq_%(table_name)s_%(column_0_name)s", | ||
| 10 | "ck": "ck_%(table_name)s_%(constraint_name)s", | ||
| 11 | "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", | ||
| 12 | "pk": "pk_%(table_name)s", | ||
| 13 | } | ||
| 14 | ) | ||
