diff --git a/apps/web/wrangler.jsonc b/apps/web/wrangler.jsonc index c8c2943..43bf79b 100644 --- a/apps/web/wrangler.jsonc +++ b/apps/web/wrangler.jsonc @@ -68,9 +68,9 @@ // Subrequests (D1 + R2 calls) one release publish may spend; above it the upload is refused with 413 // before any R2 write. Workers Paid allows 10,000 per request; on a free account (1,000) set ~600. "SKILLX_RELEASE_SUBREQUEST_BUDGET": "5000", - // Personal kit API (/api/v1/kits/@handle/name/...). "0" = off (404 everywhere). - "SKILLX_PERSONAL_KITS_API": "0", - // Collections API (/api/v1/collections/...). "0" = off (404 everywhere). Needs migration 0018. - "SKILLX_COLLECTIONS_API": "0" + // Personal kit API (/api/v1/kits/@handle/name/...). "0" = off (404 everywhere); rollback = set "0" and redeploy. Needs migrations 0015 and 0016. + "SKILLX_PERSONAL_KITS_API": "1", + // Collections API (/api/v1/collections/...). "0" = off (404 everywhere); rollback = set "0" and redeploy. Needs migrations 0009 and 0019. + "SKILLX_COLLECTIONS_API": "1" } } diff --git a/docs/deployment-guide.md b/docs/deployment-guide.md index 7cab0c2..91715f9 100644 --- a/docs/deployment-guide.md +++ b/docs/deployment-guide.md @@ -467,14 +467,22 @@ document in R2 under `statuses/sha256/`. Rollback: the header SQL of `0014_release_status_and_exec.sql` (drops both columns, clears the `d1_migrations` row); deploy the previous code first. +**Personal kits API.** `/api/v1/kits/...` needs migrations 0015 and 0016 +(personal kit tables and proposals) plus the release read stack +(`SKILLX_RELEASES_API`). Production runs with `SKILLX_PERSONAL_KITS_API` set to +`"1"` in `apps/web/wrangler.jsonc`. Before enabling it on another deployment, +confirm that `wrangler d1 migrations list skillx-db --remote` reports nothing +pending. Rollback: set the flag to `"0"` and redeploy; every route answers 404 +and stored kits stay untouched. + **Migration 0019 and the collections API.** `0019_collection_revision_lineage` adds two nullable columns (`collection_revisions.revision_digest`, `collections.cloned_from_revision_id`) and the `collection_revisions_immutable` trigger, which aborts every `UPDATE` of a stored revision. It is additive; apply it (`pnpm run db:migrate:remote`, after a backup) before deploying code with `SKILLX_COLLECTIONS_API` set to -`"1"`. The flag is `"0"` in `apps/web/wrangler.jsonc`, so `/api/v1/collections` -answers 404 until it is enabled. Revisions written before 0019 have no digest; +`"1"`. Production runs with the flag `"1"` in `apps/web/wrangler.jsonc`; +with `"0"`, `/api/v1/collections` answers 404. Revisions written before 0019 have no digest; the CLI then trusts the member list it recomputes. Rollback: set the flag back to `"0"`, redeploy, then run the header SQL of `0019_collection_revision_lineage.sql` (drops the trigger and both columns,