tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
820 stars 94 forks source link

aerich init-db create only one table but expected to create multiple tables #194

Open takan55 opened 3 years ago

takan55 commented 3 years ago

I'm trying to add multiple tables and am managing the migrations with aerich/tortoise.
However, with aerich init-db it only creates one table (in this case first_table).

I have the modules defined as:

register_tortoise(
    api,
    db_url=Settings.DATABASE_URL,
    modules={'models': ['db.models.first_table', 'db.models.second_table', 'db.models.third_table']},
    generate_schemas=False,
    add_exception_handlers=True
)

I deleted all tables including aerich table. I tested by removing first_table and third_table in the modules= and tried to recreate the tables with aerich init-db but it still creates first_table. Also, I can create multiple tables if I don't use aerich (with register_tortoise(generate_schemas=False)). Could someone help me figure this out?