1+ #!/usr/bin/env python3
12# -*- coding: utf-8 -*-
3+ # ruff: noqa: E402
24import asyncio
35import os
46from logging .config import fileConfig
2426
2527# add your model's MetaData object here
2628# for 'autogenerate' support
27- from common .msd .model import MappedBase # noqa: E402
29+ # https://alembic.sqlalchemy.org/en/latest/autogenerate.html#autogenerating-multiple-metadata-collections
30+ from app .admin .model import MappedBase as AdminModel
2831
29- target_metadata = MappedBase .metadata
32+ target_metadata = [
33+ AdminModel .metadata ,
34+ ]
3035
3136# other values from the config, defined by the needs of env.py,
32- from database .db_mysql import SQLALCHEMY_DATABASE_URL # noqa: E402
37+ from database .db_mysql import SQLALCHEMY_DATABASE_URL
3338
3439config .set_main_option ('sqlalchemy.url' , SQLALCHEMY_DATABASE_URL )
3540
@@ -49,7 +54,7 @@ def run_migrations_offline():
4954 url = config .get_main_option ('sqlalchemy.url' )
5055 context .configure (
5156 url = url ,
52- target_metadata = target_metadata ,
57+ target_metadata = target_metadata , # type: ignore
5358 literal_binds = True ,
5459 dialect_opts = {'paramstyle' : 'named' },
5560 )
@@ -59,7 +64,7 @@ def run_migrations_offline():
5964
6065
6166def do_run_migrations (connection ):
62- context .configure (connection = connection , target_metadata = target_metadata )
67+ context .configure (connection = connection , target_metadata = target_metadata ) # type: ignore
6368
6469 with context .begin_transaction ():
6570 context .run_migrations ()
0 commit comments