Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ npm install
GITHUB_TOKEN="your-token"
```

2. Initialize the local D1 database:
2. Apply migrations to the local D1 databases:

```bash
npm run init:db
npm run migrate:extensions-v2:local
npm run migrate:central-alerts:local
```

3. (Optional) Store an update token in KV for `/versions/v1/update`:
Expand Down
9 changes: 9 additions & 0 deletions drizzle.central-alerts.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "drizzle-kit";

// See drizzle.extensions.config.ts for why `out` matches wrangler's
// migrations_dir instead of using drizzle-kit's own D1 driver to apply.
export default defineConfig({
dialect: "sqlite",
schema: "./src/services/central-alerts/v1/db/schema.ts",
out: "./src/services/central-alerts/v1/db/migrations"
});
12 changes: 12 additions & 0 deletions drizzle.extensions.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "drizzle-kit";

// Schema source for the whole DB_EXTENSIONS database - shared by v1 (read
// only) and v2 (owns writes/migrations). Migrations are generated here but
// applied via `wrangler d1 migrations apply DB_EXTENSIONS` (see
// migrations_dir in wrangler.jsonc), not drizzle-kit's own D1 driver, so no
// Cloudflare credentials are needed just to generate a migration.
export default defineConfig({
dialect: "sqlite",
schema: "./src/services/extensions/v2/db/schema.ts",
out: "./src/services/extensions/v2/db/migrations"
});
Loading
Loading