Skip to content

Commit

Permalink
fix(mis-web): 使job_info对列的约束和job table中一致
Browse files Browse the repository at this point in the history
  • Loading branch information
ddadaal committed Jan 8, 2023
1 parent d0538ef commit 18f3b3e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
6 changes: 3 additions & 3 deletions apps/mis-server/src/entities/JobInfo.ts
Expand Up @@ -32,16 +32,16 @@ export class JobInfo {
@Property({ index: "idJob" })
idJob!: number;

@Property({ length: 20, comment: "账户", index: "account" })
@Property({ length: 255, comment: "账户", index: "account" })
account!: string;

@Property({ length: 20, comment: "用户名", index: "user" })
@Property({ length: 127, comment: "用户名", index: "user" })
user!: string;

@Property({ length: 255, columnType: "tinytext", comment: "分区" })
partition!: string;

@Property({ columnType: "text", length: 65535, comment: "使用节点列表" })
@Property({ columnType: "text", comment: "使用节点列表" })
nodelist!: string;

@Property({ length: 255, columnType: "tinytext", comment: "作业名" })
Expand Down
9 changes: 4 additions & 5 deletions apps/mis-server/src/migrations/.snapshot-scow_server.json
Expand Up @@ -162,23 +162,23 @@
},
"account": {
"name": "account",
"type": "varchar(20)",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 20,
"length": 255,
"comment": "账户",
"mappedType": "string"
},
"user": {
"name": "user",
"type": "varchar(20)",
"type": "varchar(127)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 20,
"length": 127,
"comment": "用户名",
"mappedType": "string"
},
Expand All @@ -199,7 +199,6 @@
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 65535,
"comment": "使用节点列表",
"mappedType": "text"
},
Expand Down
13 changes: 13 additions & 0 deletions apps/mis-server/src/migrations/Migration20230108135024.ts
@@ -0,0 +1,13 @@
import { Migration } from '@mikro-orm/migrations';

export class Migration20230108135024 extends Migration {

async up(): Promise<void> {
this.addSql('alter table `job_info` modify `account` varchar(255) not null comment \'账户\', modify `user` varchar(127) not null comment \'用户名\';');
}

async down(): Promise<void> {
this.addSql('alter table `job_info` modify `account` varchar(20) not null comment \'账户\', modify `user` varchar(20) not null comment \'用户名\';');
}

}

0 comments on commit 18f3b3e

Please sign in to comment.