แก้ไขสิทธิ์
This commit is contained in:
parent
4641362b95
commit
0024ed9414
9 changed files with 154 additions and 27 deletions
|
|
@ -25,6 +25,7 @@ import { CommandSend } from "../entities/CommandSend";
|
||||||
import { Profile } from "../entities/Profile";
|
import { Profile } from "../entities/Profile";
|
||||||
import { RequestWithUser } from "../middlewares/user";
|
import { RequestWithUser } from "../middlewares/user";
|
||||||
import { OrgRevision } from "../entities/OrgRevision";
|
import { OrgRevision } from "../entities/OrgRevision";
|
||||||
|
import { CommandSendCC } from "../entities/CommandSendCC";
|
||||||
|
|
||||||
@Route("api/v1/org/command")
|
@Route("api/v1/org/command")
|
||||||
@Tags("Command")
|
@Tags("Command")
|
||||||
|
|
@ -38,6 +39,7 @@ export class CommandController extends Controller {
|
||||||
private commandRepository = AppDataSource.getRepository(Command);
|
private commandRepository = AppDataSource.getRepository(Command);
|
||||||
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
||||||
private commandSendRepository = AppDataSource.getRepository(CommandSend);
|
private commandSendRepository = AppDataSource.getRepository(CommandSend);
|
||||||
|
private commandSendCCRepository = AppDataSource.getRepository(CommandSendCC);
|
||||||
private profileRepository = AppDataSource.getRepository(Profile);
|
private profileRepository = AppDataSource.getRepository(Profile);
|
||||||
private orgRevisionRepo = AppDataSource.getRepository(OrgRevision);
|
private orgRevisionRepo = AppDataSource.getRepository(OrgRevision);
|
||||||
|
|
||||||
|
|
@ -232,7 +234,7 @@ export class CommandController extends Controller {
|
||||||
async GetByIdTab3(@Path() id: string) {
|
async GetByIdTab3(@Path() id: string) {
|
||||||
const command = await this.commandRepository.findOne({
|
const command = await this.commandRepository.findOne({
|
||||||
where: { id },
|
where: { id },
|
||||||
relations: ["commandSends"],
|
relations: ["commandSends", "commandSends.commandSendCCs"],
|
||||||
});
|
});
|
||||||
if (!command) {
|
if (!command) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำสั่งนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำสั่งนี้");
|
||||||
|
|
@ -246,7 +248,7 @@ export class CommandController extends Controller {
|
||||||
lastName: item.lastName,
|
lastName: item.lastName,
|
||||||
position: item.position,
|
position: item.position,
|
||||||
org: item.org,
|
org: item.org,
|
||||||
sendCC: item.sendCC,
|
sendCC: item.commandSendCCs.map((x) => x.name),
|
||||||
profileId: item.profileId,
|
profileId: item.profileId,
|
||||||
}));
|
}));
|
||||||
return new HttpSuccess(_command);
|
return new HttpSuccess(_command);
|
||||||
|
|
@ -330,7 +332,7 @@ export class CommandController extends Controller {
|
||||||
requestBody: {
|
requestBody: {
|
||||||
commandSend: {
|
commandSend: {
|
||||||
id: string;
|
id: string;
|
||||||
sendCC: string;
|
sendCC: string[];
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
|
|
@ -342,16 +344,25 @@ export class CommandController extends Controller {
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
requestBody.commandSend.map(async (item) => {
|
requestBody.commandSend.map(async (item) => {
|
||||||
const commandSend = await this.commandSendRepository.findOne({
|
const commandSendCC = await this.commandSendCCRepository.find({
|
||||||
where: { id: item.id },
|
where: { commandSendId: item.id },
|
||||||
});
|
});
|
||||||
if (!commandSend) return;
|
await this.commandSendCCRepository.remove(commandSendCC);
|
||||||
|
|
||||||
commandSend.sendCC = item.sendCC;
|
await Promise.all(
|
||||||
commandSend.lastUpdateUserId = request.user.sub;
|
item.sendCC.map(async (item1) => {
|
||||||
commandSend.lastUpdateFullName = request.user.name;
|
const _commandSendCC = new CommandSendCC();
|
||||||
commandSend.lastUpdatedAt = new Date();
|
_commandSendCC.name = item1;
|
||||||
await this.commandSendRepository.save(commandSend);
|
_commandSendCC.commandSendId = item.id;
|
||||||
|
_commandSendCC.createdUserId = request.user.sub;
|
||||||
|
_commandSendCC.createdFullName = request.user.name;
|
||||||
|
_commandSendCC.createdAt = new Date();
|
||||||
|
_commandSendCC.lastUpdateUserId = request.user.sub;
|
||||||
|
_commandSendCC.lastUpdateFullName = request.user.name;
|
||||||
|
_commandSendCC.lastUpdatedAt = new Date();
|
||||||
|
await this.commandSendCCRepository.save(_commandSendCC);
|
||||||
|
}),
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ export class CommandTypeController extends Controller {
|
||||||
where: { id: requestBody.commandSysId },
|
where: { id: requestBody.commandSysId },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (checkNameSys) {
|
if (!checkNameSys) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อประเภทนี้มีอยู่ในระบบ");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อประเภทนี้มีอยู่ในระบบ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +190,7 @@ export class CommandTypeController extends Controller {
|
||||||
where: { id: requestBody.commandSysId },
|
where: { id: requestBody.commandSysId },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (checkNameSys) {
|
if (!checkNameSys) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อประเภทนี้มีอยู่ในระบบ");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อประเภทนี้มีอยู่ในระบบ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ export class OrgChild1Controller {
|
||||||
orgChild1PhoneIn: orgChild1.orgChild1PhoneIn,
|
orgChild1PhoneIn: orgChild1.orgChild1PhoneIn,
|
||||||
orgChild1Fax: orgChild1.orgChild1Fax,
|
orgChild1Fax: orgChild1.orgChild1Fax,
|
||||||
orgRevisionId: orgChild1.orgRevisionId,
|
orgRevisionId: orgChild1.orgRevisionId,
|
||||||
|
isOfficer: orgChild1.isOfficer,
|
||||||
orgCode: orgChild1.orgRoot.orgRootCode + orgChild1.orgChild1Code,
|
orgCode: orgChild1.orgRoot.orgRootCode + orgChild1.orgChild1Code,
|
||||||
};
|
};
|
||||||
return new HttpSuccess(getOrgChild1);
|
return new HttpSuccess(getOrgChild1);
|
||||||
|
|
@ -97,10 +98,23 @@ export class OrgChild1Controller {
|
||||||
await new permission().PermissionCreate(request, "SYS_ORG");
|
await new permission().PermissionCreate(request, "SYS_ORG");
|
||||||
const rootIdExits = await this.orgRootRepository.findOne({
|
const rootIdExits = await this.orgRootRepository.findOne({
|
||||||
where: { id: requestBody.orgRootId },
|
where: { id: requestBody.orgRootId },
|
||||||
|
relations: ["orgChild1s"],
|
||||||
});
|
});
|
||||||
if (!rootIdExits) {
|
if (!rootIdExits) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRootId");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRootId");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requestBody.isOfficer == true) {
|
||||||
|
await Promise.all(
|
||||||
|
rootIdExits.orgChild1s
|
||||||
|
.filter((x: OrgChild1) => x.isOfficer == true)
|
||||||
|
.map(async (item: OrgChild1) => {
|
||||||
|
item.isOfficer = false;
|
||||||
|
await this.child1Repository.save(item);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
||||||
where: { id: rootIdExits.orgRevisionId },
|
where: { id: rootIdExits.orgRevisionId },
|
||||||
});
|
});
|
||||||
|
|
@ -193,10 +207,23 @@ export class OrgChild1Controller {
|
||||||
await new permission().PermissionUpdate(request, "SYS_ORG");
|
await new permission().PermissionUpdate(request, "SYS_ORG");
|
||||||
const rootIdExits = await this.orgRootRepository.findOne({
|
const rootIdExits = await this.orgRootRepository.findOne({
|
||||||
where: { id: requestBody.orgRootId },
|
where: { id: requestBody.orgRootId },
|
||||||
|
relations: ["orgChild1s"],
|
||||||
});
|
});
|
||||||
if (!rootIdExits) {
|
if (!rootIdExits) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. RootId");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. RootId");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requestBody.isOfficer == true) {
|
||||||
|
await Promise.all(
|
||||||
|
rootIdExits.orgChild1s
|
||||||
|
.filter((x: OrgChild1) => x.isOfficer == true)
|
||||||
|
.map(async (item: OrgChild1) => {
|
||||||
|
item.isOfficer = false;
|
||||||
|
await this.child1Repository.save(item);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
||||||
where: { id: rootIdExits.orgRevisionId },
|
where: { id: rootIdExits.orgRevisionId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -623,9 +623,8 @@ export class OrganizationController extends Controller {
|
||||||
orgRevision.orgRevisionIsCurrent == true &&
|
orgRevision.orgRevisionIsCurrent == true &&
|
||||||
orgRevision.orgRevisionIsDraft == false
|
orgRevision.orgRevisionIsDraft == false
|
||||||
) {
|
) {
|
||||||
_data = await new permission().PermissionOrgList(request, "SYS_ORG");
|
await new permission().PermissionList(request, "SYS_ORG");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_data.root != null) {
|
if (_data.root != null) {
|
||||||
if (orgRevision.orgRevisionIsDraft == true && orgRevision.orgRevisionIsCurrent == false) {
|
if (orgRevision.orgRevisionIsDraft == true && orgRevision.orgRevisionIsCurrent == false) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -636,7 +635,7 @@ export class OrganizationController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งานในทะเบียนประวัติ");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งานในทะเบียนประวัติ");
|
||||||
}
|
}
|
||||||
_data = {
|
_data = {
|
||||||
root: [profile.permissionProfiles.map((x) => x.orgRootId)],
|
root: profile.permissionProfiles.map((x) => x.orgRootId),
|
||||||
child1: null,
|
child1: null,
|
||||||
child2: null,
|
child2: null,
|
||||||
child3: null,
|
child3: null,
|
||||||
|
|
@ -692,6 +691,7 @@ export class OrganizationController extends Controller {
|
||||||
)
|
)
|
||||||
.select([
|
.select([
|
||||||
"orgChild1.id",
|
"orgChild1.id",
|
||||||
|
"orgChild1.isOfficer",
|
||||||
"orgChild1.orgChild1Name",
|
"orgChild1.orgChild1Name",
|
||||||
"orgChild1.orgChild1ShortName",
|
"orgChild1.orgChild1ShortName",
|
||||||
"orgChild1.orgChild1Code",
|
"orgChild1.orgChild1Code",
|
||||||
|
|
@ -943,6 +943,7 @@ export class OrganizationController extends Controller {
|
||||||
orgRevisionId: orgRoot.orgRevisionId,
|
orgRevisionId: orgRoot.orgRevisionId,
|
||||||
orgRootName: orgRoot.orgRootName,
|
orgRootName: orgRoot.orgRootName,
|
||||||
responsibility: orgChild1.responsibility,
|
responsibility: orgChild1.responsibility,
|
||||||
|
isOfficer: orgChild1.isOfficer,
|
||||||
labelName:
|
labelName:
|
||||||
orgChild1.orgChild1Name +
|
orgChild1.orgChild1Name +
|
||||||
" " +
|
" " +
|
||||||
|
|
@ -4737,4 +4738,22 @@ export class OrganizationController extends Controller {
|
||||||
|
|
||||||
return new HttpSuccess(formattedData);
|
return new HttpSuccess(formattedData);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* API เช็คสกจในระบบ
|
||||||
|
*
|
||||||
|
* @summary - เช็คสกจในระบบ (ADMIN)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Get("check/child1/{id}")
|
||||||
|
async findIsOfficerChild1(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
|
where: { id },
|
||||||
|
relations: ["orgChild1s"],
|
||||||
|
});
|
||||||
|
if (!orgRevision) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
}
|
||||||
|
const check = orgRevision.orgChild1s.find((x) => x.isOfficer == true);
|
||||||
|
return new HttpSuccess(check != null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,11 @@
|
||||||
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
|
import { Entity, Column, JoinColumn, ManyToOne, OneToMany } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { Command } from "./Command";
|
import { Command } from "./Command";
|
||||||
import { Profile } from "./Profile";
|
import { Profile } from "./Profile";
|
||||||
|
import { CommandSendCC } from "./CommandSendCC";
|
||||||
|
|
||||||
@Entity("commandSend")
|
@Entity("commandSend")
|
||||||
export class CommandSend extends EntityBase {
|
export class CommandSend extends EntityBase {
|
||||||
// EMAIL = อีเมล
|
|
||||||
// INBOX = กล่องข้อความ
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
comment: "ช่องทางการส่งสำเนา",
|
|
||||||
length: 20,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
sendCC: string;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "เลขประจำตัวประชาชน",
|
comment: "เลขประจำตัวประชาชน",
|
||||||
|
|
@ -82,6 +73,9 @@ export class CommandSend extends EntityBase {
|
||||||
@ManyToOne(() => Profile, (profile) => profile.commandSends)
|
@ManyToOne(() => Profile, (profile) => profile.commandSends)
|
||||||
@JoinColumn({ name: "profileId" })
|
@JoinColumn({ name: "profileId" })
|
||||||
profile: Profile;
|
profile: Profile;
|
||||||
|
|
||||||
|
@OneToMany(() => CommandSendCC, (commandSendCC) => commandSendCC.commandSend)
|
||||||
|
commandSendCCs: CommandSendCC[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateCommandSend {
|
export class CreateCommandSend {
|
||||||
|
|
|
||||||
31
src/entities/CommandSendCC.ts
Normal file
31
src/entities/CommandSendCC.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
|
||||||
|
import { EntityBase } from "./base/Base";
|
||||||
|
import { CommandSend } from "./CommandSend";
|
||||||
|
|
||||||
|
@Entity("commandSendCC")
|
||||||
|
export class CommandSendCC extends EntityBase {
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "เพศ",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
length: 40,
|
||||||
|
comment: "คีย์นอก(FK)ของตาราง commandSend",
|
||||||
|
})
|
||||||
|
commandSendId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => CommandSend, (commandSend) => commandSend.commandSendCCs)
|
||||||
|
@JoinColumn({ name: "commandSendId" })
|
||||||
|
commandSend: CommandSend;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CreateCommandSendCC {
|
||||||
|
@Column()
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateCommandSendCC = Partial<CreateCommandSendCC>;
|
||||||
|
|
@ -116,6 +116,12 @@ export class OrgChild1 extends EntityBase {
|
||||||
})
|
})
|
||||||
responsibility: string;
|
responsibility: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "เป็นสกจ",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isOfficer: boolean;
|
||||||
|
|
||||||
@ManyToOne(() => OrgRevision, (orgRevision) => orgRevision.orgChild1s)
|
@ManyToOne(() => OrgRevision, (orgRevision) => orgRevision.orgChild1s)
|
||||||
@JoinColumn({ name: "orgRevisionId" })
|
@JoinColumn({ name: "orgRevisionId" })
|
||||||
orgRevision: OrgRevision;
|
orgRevision: OrgRevision;
|
||||||
|
|
@ -167,6 +173,9 @@ export class CreateOrgChild1 {
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
responsibility?: string;
|
responsibility?: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
isOfficer: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UpdateOrgChild1 = Partial<CreateOrgChild1> & { orgChild1Rank?: OrgChild1Rank };
|
export type UpdateOrgChild1 = Partial<CreateOrgChild1> & { orgChild1Rank?: OrgChild1Rank };
|
||||||
|
|
|
||||||
18
src/migration/1726209768514-update_child1_add_isOfficer.ts
Normal file
18
src/migration/1726209768514-update_child1_add_isOfficer.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateChild1AddIsOfficer1726209768514 implements MigrationInterface {
|
||||||
|
name = 'UpdateChild1AddIsOfficer1726209768514'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`employeePosMaster\` DROP COLUMN \`isOfficer\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`posMaster\` DROP COLUMN \`isOfficer\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`orgChild1\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นสกจ' DEFAULT 0`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`orgChild1\` DROP COLUMN \`isOfficer\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`posMaster\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นสกจ' DEFAULT '0'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`employeePosMaster\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นสกจ' DEFAULT '0'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
18
src/migration/1726215497371-update_child1_add_isOfficer1.ts
Normal file
18
src/migration/1726215497371-update_child1_add_isOfficer1.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateChild1AddIsOfficer11726215497371 implements MigrationInterface {
|
||||||
|
name = 'UpdateChild1AddIsOfficer11726215497371'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`CREATE TABLE \`commandSendCC\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`name\` varchar(255) NULL COMMENT 'เพศ', \`commandSendId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง commandSend', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSend\` DROP COLUMN \`sendCC\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSendCC\` ADD CONSTRAINT \`FK_52f7c9e67d813ba4f8c213f436c\` FOREIGN KEY (\`commandSendId\`) REFERENCES \`commandSend\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSendCC\` DROP FOREIGN KEY \`FK_52f7c9e67d813ba4f8c213f436c\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSend\` ADD \`sendCC\` varchar(20) NULL COMMENT 'ช่องทางการส่งสำเนา'`);
|
||||||
|
await queryRunner.query(`DROP TABLE \`commandSendCC\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue