2025-02-25 06:52:50 +00:00
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
|
import { InstanceSettings } from '@entities/instance_settings.entity';
|
|
|
|
|
import { INSTANCE_SETTINGS_TYPE, INSTANCE_SYSTEM_SETTINGS } from '@modules/instance-settings/constants';
|
2025-08-03 07:09:18 +00:00
|
|
|
import { getTooljetEdition } from '@helpers/utils.helper';
|
|
|
|
|
import { TOOLJET_EDITIONS } from '@modules/app/constants';
|
2025-02-25 06:52:50 +00:00
|
|
|
|
|
|
|
|
export class AddSMTPEnvConfiguredToTable1732273175402 implements MigrationInterface {
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
|
|
|
|
|
|
|
|
|
await entityManager.insert(InstanceSettings, {
|
|
|
|
|
label: 'SMTP ENV CONFIGURED',
|
|
|
|
|
dataType: 'boolean',
|
2025-08-03 07:09:18 +00:00
|
|
|
value: getTooljetEdition() !== TOOLJET_EDITIONS.EE ? 'true' : 'false',
|
2025-02-25 06:52:50 +00:00
|
|
|
key: INSTANCE_SYSTEM_SETTINGS.SMTP_ENV_CONFIGURED,
|
|
|
|
|
type: INSTANCE_SETTINGS_TYPE.SYSTEM,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
|
|
|
}
|