From: Eduardo Date: Mon, 2 Oct 2023 00:56:33 +0000 (+0200) Subject: added tasks and extra data, tested actual database X-Git-Url: http://git.edufdez.es/?a=commitdiff_plain;h=f602375e400cd21d2265543a084152c01f1f023f;p=The%20Cutests%20To-Do%20List.git added tasks and extra data, tested actual database --- diff --git a/singletons/database_dao.gd b/singletons/database_dao.gd index 978ccee..a2e57a2 100644 --- a/singletons/database_dao.gd +++ b/singletons/database_dao.gd @@ -150,7 +150,7 @@ func _migrate_database_from_0_to_1(): } var data := [ {"key": "version", "value": "1"}, - {"key": "install_time", "value": Time.get_unix_time_from_system()} + {"key": "install_time", "value": floori(Time.get_unix_time_from_system())} ] _db.create_table(table_name, columns) @@ -162,16 +162,17 @@ func _migrate_database_from_0_to_1(): table_name = "todo" columns = { "task": {"data_type": "text"}, - "done": {"data_type": "int"}, + "done": {"data_type": "int", "default": "0"}, # 0 false, 1 true "position": {"data_type": "int"}, - "priority": {"data_type": "int"}, + "priority": {"data_type": "int", "default": "1"}, "created_at": {"data_type": "text"}, "updated_at": {"data_type": "text"} } data = [ - {"task": "Pick the laundry", "priority": 2, "created_at": Time.get_unix_time_from_system()}, - {"task": "Feed the bunnuy", "priority": 3, "created_at": Time.get_unix_time_from_system()}, - {"task": "Wash the dishes", "priority": 1, "created_at": Time.get_unix_time_from_system()}, + {"task": "Pick the laundry", "priority": 2, "created_at": floori(Time.get_unix_time_from_system()), "updated_at": floori(floori(Time.get_unix_time_from_system()))}, + {"task": "Feed the bunnuy", "priority": 3, "created_at": floori(Time.get_unix_time_from_system()), "updated_at": floori(Time.get_unix_time_from_system())}, + {"task": "Wash the dishes", "created_at": floori(Time.get_unix_time_from_system()), "updated_at": floori(Time.get_unix_time_from_system())}, + {"task": "Touch me to mark me as done", "created_at": floori(Time.get_unix_time_from_system()), "updated_at": floori(Time.get_unix_time_from_system())}, ] _db.create_table(table_name, columns) @@ -186,6 +187,8 @@ func _migrate_database_from_0_to_1(): "description": {"data_type": "text"}, "start_date": {"data_type": "text"}, "end_date": {"data_type": "text"}, + "repeat": {"data_type": "int", "default": "0"}, # 0 false, 1 true + "repeat_type": {"data_type": "text"}, # weekly, monthly, annually "color": {"data_type": "text"}, "created_at": {"data_type": "text"}, "updated_at": {"data_type": "text"}