diff --git a/src/infrastructure/db.rs b/src/infrastructure/db.rs index 745283d..6c4ab7c 100644 --- a/src/infrastructure/db.rs +++ b/src/infrastructure/db.rs @@ -47,7 +47,11 @@ impl Db { ) .ok(); conn.execute_batch( - "ALTER TABLE tasks ADD COLUMN created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%d %H:%M:%S', 'now'));", + "ALTER TABLE tasks ADD COLUMN created_at TEXT NOT NULL DEFAULT '';", + ) + .ok(); + conn.execute_batch( + "UPDATE tasks SET created_at = updated_at WHERE created_at = '';", ) .ok(); Ok(Self { conn: Mutex::new(conn) })