habitmove/loop/migration.py

17 lines
349 B
Python
Raw Normal View History

2021-08-29 07:46:55 +00:00
import loop.schema as schema
2021-08-28 07:54:41 +00:00
import loop.habits as habits
2021-08-28 21:03:12 +00:00
import loop.repetitions as rep
2021-08-27 08:55:31 +00:00
def migrate(trackers, events):
2021-08-29 07:46:55 +00:00
db = schema.migrate("output.db")
2021-08-27 08:55:31 +00:00
if trackers is not None:
2021-08-28 21:03:12 +00:00
habitlist = habits.migrate(db, trackers)
if events is not None:
rep.migrate(db, habitlist, events)
2021-08-27 08:55:31 +00:00
db.commit()
2021-08-27 21:33:21 +00:00
db.close()