diff --git a/app/gen-server/entity/Activation.ts b/app/gen-server/entity/Activation.ts index ca84c3f793a..9bdaccf5017 100644 --- a/app/gen-server/entity/Activation.ts +++ b/app/gen-server/entity/Activation.ts @@ -22,6 +22,9 @@ export class Activation extends BaseEntity { @Column({name: 'updated_at', default: () => "CURRENT_TIMESTAMP"}) public updatedAt: Date; + @Column({name: 'enabled_at', nullable: true}) + public enabledAt: Date|null; + public checkProperties(props: any): props is Partial { for (const key of Object.keys(props)) { if (!installPropertyKeys.includes(key)) { diff --git a/app/gen-server/migration/1722529827161-Activation-Enabled.ts b/app/gen-server/migration/1722529827161-Activation-Enabled.ts new file mode 100644 index 00000000000..e5be4061d50 --- /dev/null +++ b/app/gen-server/migration/1722529827161-Activation-Enabled.ts @@ -0,0 +1,19 @@ +import * as sqlUtils from "app/gen-server/sqlUtils"; +import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; + +export class ActivationEnabled1722529827161 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + const dbType = queryRunner.connection.driver.options.type; + const datetime = sqlUtils.datetime(dbType); + await queryRunner.addColumn('activations', new TableColumn({ + name: 'enabled_at', + type: datetime, + isNullable: true, + })); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropColumn('activations', 'enabled_at'); + } +}