db: empty list if no rows for model, one commit per model
This commit is contained in:
parent
d28bf18ce8
commit
7e0384d698
1 changed files with 2 additions and 3 deletions
|
@ -100,8 +100,7 @@ def db_import() -> None:
|
|||
data = json.load(sys.stdin)
|
||||
# import order matters due to foreign key constraints
|
||||
for model in models:
|
||||
db_import_model(model, data[model.__name__])
|
||||
|
||||
db_import_model(model, data.get(model.__name__, []))
|
||||
db.session.commit()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue