Skip to content

Commit 5609775

Browse files
icecrasher321claude
andcommitted
fix(db): reserve the drop migration as a journaled no-op for schema parity
CI requires drizzle-kit generate to be a no-op on every PR, so the declaration removal cannot ship without its migration. Committing the generated 0309 with every DROP commented out (a SELECT 1 no-op) keeps the parity gate and future generates clean while deferring the destructive half until this change is part of an already-deployed production release; the file documents the follow-up procedure. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 3494d73 commit 5609775

4 files changed

Lines changed: 20063 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- Reserved contract slot for the retired usage-column drop (#7134).
2+
--
3+
-- #7134 removed these columns' drizzle declarations (and their last readers/
4+
-- writers), so the app stops emitting them in generated SELECT lists. This
5+
-- migration intentionally executes nothing: migrations run BEFORE images are
6+
-- promoted, so dropping the columns in the same deploy would 42703 the
7+
-- still-serving old task set, whose schema still declares them in full-row
8+
-- user_stats selects on the billing gate. Keeping the generated file (and its
9+
-- snapshot) satisfies the schema/migrations parity check without performing
10+
-- the destructive half.
11+
--
12+
-- To execute the contract, once #7134 is part of an already-deployed
13+
-- production release:
14+
-- cd packages/db && bunx drizzle-kit generate --custom --name=drop_retired_usage_columns
15+
-- then paste the statements below uncommented, each annotated
16+
-- "migration-safe: contract of #7134 — declarations removed there, deployed <date>"
17+
-- and delete the three contract-pending markers in schema.ts.
18+
--
19+
-- ALTER TABLE "organization" DROP COLUMN "departed_member_usage";
20+
-- ALTER TABLE "user_stats" DROP COLUMN "total_manual_executions";
21+
-- ALTER TABLE "user_stats" DROP COLUMN "total_api_calls";
22+
-- ALTER TABLE "user_stats" DROP COLUMN "total_webhook_triggers";
23+
-- ALTER TABLE "user_stats" DROP COLUMN "total_scheduled_executions";
24+
-- ALTER TABLE "user_stats" DROP COLUMN "total_chat_executions";
25+
-- ALTER TABLE "user_stats" DROP COLUMN "total_mcp_executions";
26+
-- ALTER TABLE "user_stats" DROP COLUMN "total_tokens_used";
27+
-- ALTER TABLE "user_stats" DROP COLUMN "total_cost";
28+
-- ALTER TABLE "user_stats" DROP COLUMN "current_period_cost";
29+
-- ALTER TABLE "user_stats" DROP COLUMN "pro_period_cost_snapshot";
30+
-- ALTER TABLE "user_stats" DROP COLUMN "pro_period_cost_snapshot_at";
31+
-- ALTER TABLE "user_stats" DROP COLUMN "total_copilot_cost";
32+
-- ALTER TABLE "user_stats" DROP COLUMN "current_period_copilot_cost";
33+
-- ALTER TABLE "user_stats" DROP COLUMN "total_copilot_tokens";
34+
-- ALTER TABLE "user_stats" DROP COLUMN "total_copilot_calls";
35+
-- ALTER TABLE "user_stats" DROP COLUMN "total_mcp_copilot_calls";
36+
-- ALTER TABLE "user_stats" DROP COLUMN "total_mcp_copilot_cost";
37+
-- ALTER TABLE "user_stats" DROP COLUMN "current_period_mcp_copilot_cost";
38+
-- ALTER TABLE "user_stats" DROP COLUMN "last_active";
39+
-- ALTER TABLE "workflow_execution_logs" DROP COLUMN "cost";
40+
SELECT 1;

0 commit comments

Comments
 (0)