mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
26 lines
805 B
TypeScript
26 lines
805 B
TypeScript
import { INSTANCE_USER_SETTINGS } from '@modules/instance-settings/constants';
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class instanceSettings1663689836425 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
const entityManager = queryRunner.manager;
|
|
|
|
const settings = [
|
|
{
|
|
key: INSTANCE_USER_SETTINGS.ALLOW_PERSONAL_WORKSPACE,
|
|
value: 'true',
|
|
},
|
|
];
|
|
|
|
settings.map(async (setting) => {
|
|
const { key, value } = setting;
|
|
|
|
await entityManager.query(
|
|
'insert into instance_settings ("key", "value", created_at, updated_at) values ($1, $2, $3, $3) returning *',
|
|
[key, value, new Date()]
|
|
);
|
|
});
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
}
|