|
| 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