Download src/lib/db/migrations/001-initial.js from heyeyydss/api9nin: direct link, hf CLI and curl.
- Browser
- Download file 456 Bytes
-
https://huggingface.co/spaces/heyeyydss/api9nin/resolve/main/src/lib/db/migrations/001-initial.js
- Command line
-
hf download hf://spaces/heyeyydss/api9nin/src/lib/db/migrations/001-initial.js
-
curl -L -o 001-initial.js https://huggingface.co/spaces/heyeyydss/api9nin/resolve/main/src/lib/db/migrations/001-initial.js
456 Bytes
| // Initial schema bootstrap. For fresh DB this creates all tables/indexes. | |
| // For existing DB at version 0 (legacy unstamped), it's idempotent (IF NOT EXISTS). | |
| import { TABLES, buildCreateTableSql } from "../schema.js"; | |
| export default { | |
| version: 1, | |
| name: "initial", | |
| up(db) { | |
| for (const [name, def] of Object.entries(TABLES)) { | |
| db.exec(buildCreateTableSql(name, def)); | |
| for (const idx of def.indexes || []) db.exec(idx); | |
| } | |
| }, | |
| }; | |