add survey admin
This commit is contained in:
parent
2709fff7ea
commit
f4066e9120
5 changed files with 128 additions and 15 deletions
14
src/migration/1737442569342-updateRelationSurvey.ts
Normal file
14
src/migration/1737442569342-updateRelationSurvey.ts
Normal 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\`)`);
|
||||
}
|
||||
|
||||
}
|
||||
16
src/migration/1737443725676-updateRelationSurvey.ts
Normal file
16
src/migration/1737443725676-updateRelationSurvey.ts
Normal 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\``);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue