habitmove/loop/habit_migrator.py

19 lines
447 B
Python
Raw Normal View History

2021-08-27 08:55:31 +00:00
def create_habits(db, trackers):
print("migrating habits, yo")
c = db.cursor()
tracker = trackers["cigarette"]
print(tracker)
# for when the execute works, can be filled in its own function
habit = (
tracker["label"],
0,
0,
tracker["id"],
)
c.execute(
"""INSERT INTO
Habits(id, name, position, type, uuid)
VALUES (NULL, ?, ?, ?, ?)""",
habit,
)