add survey admin

This commit is contained in:
Warunee Tamkoo 2025-01-21 14:35:45 +07:00
parent 2709fff7ea
commit f4066e9120
5 changed files with 128 additions and 15 deletions

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateRelationSurvey1737442569342 implements MigrationInterface {
name = 'UpdateRelationSurvey1737442569342'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX \`IDX_5c42dcafb9ff2c3785b9bf447a\` ON \`personal\``);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_5c42dcafb9ff2c3785b9bf447a\` ON \`personal\` (\`appointId\`)`);
}
}

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateRelationSurvey1737443725676 implements MigrationInterface {
name = 'UpdateRelationSurvey1737443725676'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`personal\` ADD CONSTRAINT \`FK_53ffbd1e99fe0da682dab5c77ff\` FOREIGN KEY (\`personal_id\`, \`personal_id\`) REFERENCES \`survey\`(\`personal_id\`,\`assign_id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE \`survey\` ADD CONSTRAINT \`FK_9bae89d4bb00502e057fb619a70\` FOREIGN KEY (\`personal_id\`) REFERENCES \`personal\`(\`personal_id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`survey\` DROP FOREIGN KEY \`FK_9bae89d4bb00502e057fb619a70\``);
await queryRunner.query(`ALTER TABLE \`personal\` DROP FOREIGN KEY \`FK_53ffbd1e99fe0da682dab5c77ff\``);
}
}