migration and #2317
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m22s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m22s
This commit is contained in:
parent
df2f1c5b12
commit
71dcba33e9
4 changed files with 452 additions and 435 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -52,6 +52,9 @@ export class EmployeePosLevel extends EntityBase {
|
||||||
|
|
||||||
@OneToMany(() => ProfileEmployee, (profile) => profile.posLevel)
|
@OneToMany(() => ProfileEmployee, (profile) => profile.posLevel)
|
||||||
profiles: ProfileEmployee[];
|
profiles: ProfileEmployee[];
|
||||||
|
|
||||||
|
@OneToMany(() => ProfileEmployee, (profile) => profile.posLevelTemp)
|
||||||
|
profilesTemp: ProfileEmployee[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateEmployeePosLevel {
|
export class CreateEmployeePosLevel {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Entity, Column, OneToMany, ManyToOne, Double, ManyToMany, JoinTable } from "typeorm";
|
import { Entity, Column, OneToMany, ManyToOne, Double, ManyToMany, JoinTable, JoinColumn } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { EmployeePosLevel } from "./EmployeePosLevel";
|
import { EmployeePosLevel } from "./EmployeePosLevel";
|
||||||
import { EmployeePosType } from "./EmployeePosType";
|
import { EmployeePosType } from "./EmployeePosType";
|
||||||
|
|
@ -792,6 +792,10 @@ export class ProfileEmployee extends EntityBase {
|
||||||
@ManyToOne(() => EmployeePosLevel, (v) => v.profiles)
|
@ManyToOne(() => EmployeePosLevel, (v) => v.profiles)
|
||||||
posLevel: EmployeePosLevel;
|
posLevel: EmployeePosLevel;
|
||||||
|
|
||||||
|
@ManyToOne(() => EmployeePosLevel, (v) => v.profilesTemp)
|
||||||
|
@JoinColumn({ name: "posLevelIdTemp" })
|
||||||
|
posLevelTemp: EmployeePosLevel;
|
||||||
|
|
||||||
@ManyToOne(() => EmployeePosType, (v) => v.profiles)
|
@ManyToOne(() => EmployeePosType, (v) => v.profiles)
|
||||||
posType: EmployeePosType;
|
posType: EmployeePosType;
|
||||||
|
|
||||||
|
|
|
||||||
14
src/migration/1771409869898-add_relation_posLevelTemp.ts
Normal file
14
src/migration/1771409869898-add_relation_posLevelTemp.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class AddRelationPosLevelTemp1771409869898 implements MigrationInterface {
|
||||||
|
name = 'AddRelationPosLevelTemp1771409869898'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD CONSTRAINT \`FK_49694ac4248a7bab7d12d4be280\` FOREIGN KEY (\`posLevelIdTemp\`) REFERENCES \`employeePosLevel\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP FOREIGN KEY \`FK_49694ac4248a7bab7d12d4be280\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue