Fix missing payment_methods table creation + bump CACHEBUST to v6
Migration AddedWithdrawalFrequency1733770884555 referenced payment_methods table that was never created. Modified to CREATE TABLE IF NOT EXISTS with all columns, then drop lightning_address from filmmakers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,20 +6,32 @@ export class AddedWithdrawalFrequency1733770884555
|
||||
name = 'AddedWithdrawalFrequency1733770884555';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
// Create payment_methods table (missing migration)
|
||||
await queryRunner.query(`
|
||||
CREATE TABLE IF NOT EXISTS "payment_methods" (
|
||||
"id" character varying NOT NULL,
|
||||
"filmmaker_id" character varying NOT NULL,
|
||||
"lightning_address" character varying,
|
||||
"provider_id" character varying,
|
||||
"type" character varying NOT NULL DEFAULT 'LIGHTNING',
|
||||
"selected" boolean NOT NULL DEFAULT false,
|
||||
"withdrawal_frequency" character varying NOT NULL DEFAULT 'automatic',
|
||||
"created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
||||
"deleted_at" TIMESTAMP WITH TIME ZONE,
|
||||
CONSTRAINT "PK_payment_methods" PRIMARY KEY ("id"),
|
||||
CONSTRAINT "FK_payment_methods_filmmaker" FOREIGN KEY ("filmmaker_id") REFERENCES "filmmakers"("id") ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
)
|
||||
`);
|
||||
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "filmmakers" DROP COLUMN "lightning_address"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "payment_methods" ADD "withdrawal_frequency" character varying NOT NULL DEFAULT 'automatic'`,
|
||||
`ALTER TABLE "filmmakers" DROP COLUMN IF EXISTS "lightning_address"`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "payment_methods" DROP COLUMN "withdrawal_frequency"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "filmmakers" ADD "lightning_address" character varying`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS "payment_methods"`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user