Skip to content

Commit b863c54

Browse files
QuinnNTonicclaude
andauthored
chore: add creditDebt migration (unblocks prod deploy of mutual-credit fix) (#448)
## Why The `creditDebt` column (added to ChangeMaker/ExchangePartner/ServePartner by the mutual-credit fix #447) has **no migration**: the `MR_TO_MAIN` auto-migration job for #447 failed because the PR branch was deleted on merge, so the migration was never generated/committed to `main`. Without it, `DEPLOY_PROD`'s **schema-drift check** fails (entity has the column, migration history doesn't). ## What Adds `1780666911854-AddCreditDebt.ts` — `ALTER TABLE … ADD "creditDebt" integer NOT NULL DEFAULT 0` for the three profile tables (matches the entity definitions). This is what the auto-generator would have produced. ## Notes - **Do not delete this branch until `MR_TO_MAIN` finishes** (that was the cause of #447's failed run). - After merge, a `v*` tag deploys to PROD via `DEPLOY_PROD` (tag handled separately). - Data reconciliation (`scripts/recon-3`) still runs **after** this deploys. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3c9a938 commit b863c54

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {MigrationInterface, QueryRunner} from "typeorm";
2+
3+
export class AddCreditDebt1780666911854 implements MigrationInterface {
4+
name = 'AddCreditDebt1780666911854'
5+
6+
public async up(queryRunner: QueryRunner): Promise<void> {
7+
await queryRunner.query(`ALTER TABLE "public"."ChangeMaker" ADD "creditDebt" integer NOT NULL DEFAULT 0`);
8+
await queryRunner.query(`ALTER TABLE "public"."ExchangePartner" ADD "creditDebt" integer NOT NULL DEFAULT 0`);
9+
await queryRunner.query(`ALTER TABLE "public"."ServePartner" ADD "creditDebt" integer NOT NULL DEFAULT 0`);
10+
}
11+
12+
public async down(queryRunner: QueryRunner): Promise<void> {
13+
await queryRunner.query(`ALTER TABLE "public"."ServePartner" DROP COLUMN "creditDebt"`);
14+
await queryRunner.query(`ALTER TABLE "public"."ExchangePartner" DROP COLUMN "creditDebt"`);
15+
await queryRunner.query(`ALTER TABLE "public"."ChangeMaker" DROP COLUMN "creditDebt"`);
16+
}
17+
18+
}

0 commit comments

Comments
 (0)