mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-06-08 17:10:20 +08:00
set encryptCompanyId in BossInfo nullable
This commit is contained in:
@@ -6,7 +6,9 @@ export class BossInfo {
|
||||
@PrimaryColumn()
|
||||
encryptBossId: string;
|
||||
|
||||
@Column()
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
encryptCompanyId: string;
|
||||
|
||||
@Column()
|
||||
|
||||
@@ -25,6 +25,7 @@ import * as cliHighlight from 'cli-highlight';
|
||||
import { saveChatStartupRecord, saveJobInfoFromRecommendPage, saveMarkAsNotSuitRecord } from "./handlers";
|
||||
import { UpdateChatStartupLogTable1729182577167 } from "./migrations/1729182577167-UpdateChatStartupLogTable";
|
||||
import minimist from 'minimist'
|
||||
import { UpdateBossInfoTable1732032381304 } from "./migrations/1732032381304-UpdateBossInfoTable";
|
||||
|
||||
Boolean(cliHighlight);
|
||||
|
||||
@@ -57,7 +58,8 @@ export function initDb(dbFilePath) {
|
||||
ChatMessageRecord,
|
||||
],
|
||||
migrations: [
|
||||
UpdateChatStartupLogTable1729182577167
|
||||
UpdateChatStartupLogTable1729182577167,
|
||||
UpdateBossInfoTable1732032381304
|
||||
],
|
||||
migrationsRun: true
|
||||
});
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
|
||||
|
||||
const viewNames = [
|
||||
"v_boss_library",
|
||||
"v_chat_startup_log",
|
||||
"v_company_library",
|
||||
"v_job_library",
|
||||
"v_mark_as_not_suit_log"
|
||||
];
|
||||
|
||||
export class UpdateBossInfoTable1732032381304 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
for (const viewName of viewNames) {
|
||||
await queryRunner.query(`DROP VIEW IF EXISTS "${viewName}"`);
|
||||
}
|
||||
if (await queryRunner.hasTable("boss_info")) {
|
||||
if (await queryRunner.hasColumn("boss_info", "encryptCompanyId")) {
|
||||
await queryRunner.changeColumn(
|
||||
'boss_info',
|
||||
'encryptCompanyId',
|
||||
new TableColumn({
|
||||
name: 'encryptCompanyId',
|
||||
type: 'varchar',
|
||||
isNullable: true
|
||||
})
|
||||
)
|
||||
debugger
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user