feat(billing): refacto billing (#14243)
… prices for metered billing --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddPhasesToBillingSubscription1756912860000
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddPhasesToBillingSubscription1756912860000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."billingSubscription" ADD "phases" jsonb NOT NULL DEFAULT '[]'`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."billingSubscription" DROP COLUMN "phases"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
||||
|
||||
export class RemoveTiersModeFromBillingPrice1757056320000
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'RemoveTiersModeFromBillingPrice1757056320000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."billingPrice" DROP COLUMN "tiersMode"`,
|
||||
);
|
||||
|
||||
await queryRunner.query(
|
||||
`DROP TYPE IF EXISTS "core"."billingPrice_tiersmode_enum"`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TYPE "core"."billingPrice_tiersmode_enum" AS ENUM('GRADUATED', 'VOLUME')`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."billingPrice" ADD "tiersMode" "core"."billingPrice_tiersmode_enum"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user