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,9 +100,8 @@ def db_import() -> None:
|
||||||
data = json.load(sys.stdin)
|
data = json.load(sys.stdin)
|
||||||
# import order matters due to foreign key constraints
|
# import order matters due to foreign key constraints
|
||||||
for model in models:
|
for model in models:
|
||||||
db_import_model(model, data[model.__name__])
|
db_import_model(model, data.get(model.__name__, []))
|
||||||
|
db.session.commit()
|
||||||
db.session.commit()
|
|
||||||
|
|
||||||
|
|
||||||
class DbCliHandler(BaseCliHandler):
|
class DbCliHandler(BaseCliHandler):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue