Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/modules/frameworks/rule.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class Rule extends PublicEntity {
@Column("integer", { name: "organization_id", nullable: true })
organization_id?: number;

@Column("boolean", { name: "is_draft", default: false })
isDraft!: boolean;

@ManyToOne(() => Organization, { nullable: true, })
@JoinColumn({ name: "organization_id" })
organization?: Organization;
Expand Down
14 changes: 14 additions & 0 deletions src/shared/database/migrations/1731965342331-addIsDraftToRule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class AddIsDraftToRule1731965342331 implements MigrationInterface {
name = "AddIsDraftToRule1731965342331"

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "rules" ADD "is_draft" boolean NOT NULL DEFAULT false`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "rules" DROP COLUMN "is_draft"`);
}

}
Loading