Spaces:
Runtime error
Runtime error
Download lib/db/mock-date.js from o134/Desinger-System: direct link, hf CLI and curl.
- Browser
- Download file 444 Bytes
-
https://huggingface.co/spaces/o134/Desinger-System/resolve/main/lib/db/mock-date.js
- Command line
-
hf download hf://spaces/o134/Desinger-System/lib/db/mock-date.js
-
curl -L -o mock-date.js https://huggingface.co/spaces/o134/Desinger-System/resolve/main/lib/db/mock-date.js
444 Bytes
| import { db, tasksTable } from './src/index.js'; | |
| import { eq } from 'drizzle-orm'; | |
| async function main() { | |
| const pastDate = new Date(); | |
| pastDate.setMonth(pastDate.getMonth() - 1); | |
| const tasks = await db.select().from(tasksTable); | |
| if (tasks.length > 0) { | |
| await db.update(tasksTable).set({ createdAt: pastDate }).where(eq(tasksTable.id, tasks[0].id)); | |
| console.log('Updated row', tasks[0].id); | |
| } | |
| } | |
| main().catch(console.error); | |