add column appointId in assign
This commit is contained in:
parent
318839c1e9
commit
b290eac9a9
4 changed files with 27 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ WORKDIR /app
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
RUN npm i
|
RUN npm ci
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -498,6 +498,7 @@ export class AssignController extends Controller {
|
||||||
select: [
|
select: [
|
||||||
"id",
|
"id",
|
||||||
"personal_id",
|
"personal_id",
|
||||||
|
"appointId",
|
||||||
"round_no",
|
"round_no",
|
||||||
"date_start",
|
"date_start",
|
||||||
"date_finish",
|
"date_finish",
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,12 @@ export class Assign extends EntityBase {
|
||||||
})
|
})
|
||||||
other_desc!: string;
|
other_desc!: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "Id ของการแต่งตั้งคณะกรรมการ",
|
||||||
|
})
|
||||||
|
appointId: string;
|
||||||
|
|
||||||
@ManyToOne(() => Personal, (person: Personal) => person.personal_id)
|
@ManyToOne(() => Personal, (person: Personal) => person.personal_id)
|
||||||
@JoinColumn({ name: "personal_id" })
|
@JoinColumn({ name: "personal_id" })
|
||||||
profile: Personal;
|
profile: Personal;
|
||||||
|
|
@ -179,6 +185,7 @@ export class CreateAssign {
|
||||||
position?: string;
|
position?: string;
|
||||||
monthSelect?: number;
|
monthSelect?: number;
|
||||||
other_desc?: string;
|
other_desc?: string;
|
||||||
|
appointId?: string;
|
||||||
|
|
||||||
assign_competency_group: CreateAssignCompetencyGroup[];
|
assign_competency_group: CreateAssignCompetencyGroup[];
|
||||||
assign_competency: CreateAssignCompetency[];
|
assign_competency: CreateAssignCompetency[];
|
||||||
|
|
|
||||||
18
src/migration/1729220132639-addColumn.ts
Normal file
18
src/migration/1729220132639-addColumn.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class AddColumn1729220132639 implements MigrationInterface {
|
||||||
|
name = 'AddColumn1729220132639'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`assign\` ADD \`appointId\` varchar(255) NULL COMMENT 'Id ของการแต่งตั้งคณะกรรมการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`assign\` DROP COLUMN \`other_desc\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`assign\` ADD \`other_desc\` varchar(255) NULL COMMENT 'กฎหมายอื่นๆ'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`assign\` DROP COLUMN \`other_desc\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`assign\` ADD \`other_desc\` varchar(45) NULL`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`assign\` DROP COLUMN \`appointId\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue