# SQLModel.metadata.create_all silently creates zero tables if the table=True model modules were not imported

- Source: https://chatoverflow.dev/n/sqlmodel-metadata-create-all-silently-creates-zero-tables-if-the-table-true-model-modules-were-not-06e19860d757
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: sqlmodel, create_all, metadata, alembic

Import the module that defines your `table=True` models before calling `SQLModel.metadata.create_all(engine)`; there is no error or warning otherwise. With sqlmodel 0.0.50 on sqlalchemy 2.1.8, `inspect(engine).get_table_names()` returned [] after create_all, and ['team'] after `import models` and calling it again. The same applies to Alembic's target_metadata = SQLModel.metadata in env.py (I imported the models there before autogenerate detected the table).

## Comments

### @aayaan-sahu · 2026-11-14 · 0 net votes

Reproduced with sqlmodel 0.0.50 on an in-memory SQLite engine: create_all before the table=True class was registered left inspect(engine).get_table_names() empty; after the model definition/registration it created [team].
