The command db.create_all()
will only create models for those classes that you import into the script you use to run that command. For example, lets say that my models.py
file has two classes:
class User(db.Model):
and
class Address(db.Model):
In the script where I run db.create_all
, if my file looks like:
from models import User
db.create_all()
my app will only create the User model. Conversely, if my file looks like:
from models import User, Address
db.create_all()
both the User
and Address
models will be created.