habitmove/loop/migration.py

16 lines
349 B
Python

import loop.schema as schema
import loop.habits as habits
import loop.repetitions as rep
def migrate(trackers, events):
db = schema.migrate("output.db")
if trackers is not None:
habitlist = habits.migrate(db, trackers)
if events is not None:
rep.migrate(db, habitlist, events)
db.commit()
db.close()