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:
lborv
2025-10-09 19:35:30 +03:00
parent 5b30b876e5
commit e89af0dd20
14 changed files with 261 additions and 160 deletions

View 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\``);
}
}