Spaces:
Runtime error
Runtime error
| import Database from 'better-sqlite3'; | |
| const db = new Database('local.db'); | |
| const pastDate = new Date(); | |
| pastDate.setMonth(pastDate.getMonth() - 1); | |
| const result = db.prepare("UPDATE tasks SET created_at = ? WHERE id = (SELECT id FROM tasks ORDER BY id ASC LIMIT 1)").run(pastDate.getTime()); | |
| console.log('Updated rows:', result.changes); | |