feat: implement project settings management with CRUD operations and caching
This commit is contained in:
21
src/migrations/1760377023483-projectSettings.ts
Normal file
21
src/migrations/1760377023483-projectSettings.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class ProjectSettings1760377023483 implements MigrationInterface {
|
||||
name = "ProjectSettings1760377023483";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE \`projectSetting\` (\`id\` varchar(36) NOT NULL, \`key\` varchar(255) NOT NULL, \`value\` text NOT NULL, \`projectId\` varchar(36) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE \`projectSetting\` ADD CONSTRAINT \`FK_8dfaf9c1ebbadb7af024e72e871\` FOREIGN KEY (\`projectId\`) REFERENCES \`project\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE \`projectSetting\` DROP FOREIGN KEY \`FK_8dfaf9c1ebbadb7af024e72e871\``
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE \`projectSetting\``);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user