mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 21:15:13 +00:00
18 lines
448 B
Python
18 lines
448 B
Python
import sqlalchemy as sa
|
|
|
|
from backend.utils.import_parse import get_all_models
|
|
|
|
# import all models for auto create db tables
|
|
for cls in get_all_models():
|
|
if isinstance(cls, sa.Table):
|
|
table_name = cls.name
|
|
if table_name not in globals():
|
|
globals()[table_name] = cls
|
|
else:
|
|
class_name = cls.__name__
|
|
if class_name not in globals():
|
|
globals()[class_name] = cls
|
|
|
|
|
|
__version__ = '1.12.0'
|