#migrate : add email phone To table issues
All checks were successful
Build & Deploy on Dev / build (push) Successful in 52s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 52s
This commit is contained in:
parent
30bf5ad9e3
commit
22639e72c6
2 changed files with 33 additions and 0 deletions
|
|
@ -30,6 +30,12 @@ export class Issues extends EntityBase {
|
||||||
@Column({ type: "text", nullable: true, comment: "หมายเหตุ" })
|
@Column({ type: "text", nullable: true, comment: "หมายเหตุ" })
|
||||||
remark: string | null;
|
remark: string | null;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", nullable: true, length: 255, comment: "อีเมลผู้รายงาน" })
|
||||||
|
email: string | null;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", nullable: true, length: 20, comment: "เบอร์โทรผู้รายงาน" })
|
||||||
|
phone: string | null;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: "enum",
|
type: "enum",
|
||||||
enum: ["NEW", "IN_PROGRESS", "RESOLVED", "CLOSED"],
|
enum: ["NEW", "IN_PROGRESS", "RESOLVED", "CLOSED"],
|
||||||
|
|
@ -76,6 +82,8 @@ export interface IssueResponse {
|
||||||
lastUpdatedAt: Date;
|
lastUpdatedAt: Date;
|
||||||
createdFullName: string;
|
createdFullName: string;
|
||||||
lastUpdateFullName: string;
|
lastUpdateFullName: string;
|
||||||
|
email: string | null;
|
||||||
|
phone: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateIssueRequest {
|
export interface CreateIssueRequest {
|
||||||
|
|
@ -85,6 +93,8 @@ export interface CreateIssueRequest {
|
||||||
status?: "NEW" | "IN_PROGRESS" | "RESOLVED" | "CLOSED";
|
status?: "NEW" | "IN_PROGRESS" | "RESOLVED" | "CLOSED";
|
||||||
menu?: string;
|
menu?: string;
|
||||||
org?: string;
|
org?: string;
|
||||||
|
email?: string;
|
||||||
|
phone?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateIssueRequest {
|
export interface UpdateIssueRequest {
|
||||||
|
|
|
||||||
23
src/migration/1770173342631-AddEmailPhoneToIssuesOnly.ts
Normal file
23
src/migration/1770173342631-AddEmailPhoneToIssuesOnly.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class AddEmailPhoneToIssues1738627400000 implements MigrationInterface {
|
||||||
|
name = 'AddEmailPhoneToIssues1738627400000'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
|
||||||
|
await queryRunner.query(`
|
||||||
|
ALTER TABLE \`issues\`
|
||||||
|
ADD \`email\` varchar(255) NULL COMMENT 'อีเมลผู้รายงาน'
|
||||||
|
`);
|
||||||
|
|
||||||
|
await queryRunner.query(`
|
||||||
|
ALTER TABLE \`issues\`
|
||||||
|
ADD \`phone\` varchar(20) NULL COMMENT 'เบอร์โทรผู้รายงาน'
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`issues\` DROP COLUMN \`phone\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`issues\` DROP COLUMN \`email\``);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue