feat: implement function management with FunctionEntity, FunctionService, and FunctionController; enhance QueryExecuterService to utilize functions; refactor CommandController and QueryController to extend BaseQueryController; update Vm class to handle functions; remove obsolete log entities
This commit is contained in:
24
src/migrations/1760026715562-functions.ts
Normal file
24
src/migrations/1760026715562-functions.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class Functions1760026715562 implements MigrationInterface {
|
||||
name = "Functions1760026715562";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE \`function\` (\`id\` varchar(36) NOT NULL, \`name\` varchar(255) NOT NULL, \`source\` longtext NOT NULL, \`projectId\` varchar(36) NULL, UNIQUE INDEX \`IDX_FUNCTION_NAME_PROJECT\` (\`name\`, \`projectId\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE \`function\` ADD CONSTRAINT \`FK_ed63e3acac533604d1d4a21b1d3\` FOREIGN KEY (\`projectId\`) REFERENCES \`project\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE \`function\` DROP FOREIGN KEY \`FK_ed63e3acac533604d1d4a21b1d3\``
|
||||
);
|
||||
await queryRunner.query(
|
||||
`DROP INDEX \`IDX_FUNCTION_NAME_PROJECT\` ON \`function\``
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE \`function\``);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user