File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[alembic]
22script_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
44prepend_sys_path = .
55output_encoding = utf-8
66# truncate_slug_length = 40
Original file line number Diff line number Diff line change 11import 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+ )
Original file line number Diff line number Diff line change 1616class 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
You can’t perform that action at this time.
0 commit comments