mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 00:47:15 +08:00
set encryptCompanyId in BossInfo nullable
This commit is contained in:
@@ -6,7 +6,9 @@ export class BossInfo {
|
|||||||
@PrimaryColumn()
|
@PrimaryColumn()
|
||||||
encryptBossId: string;
|
encryptBossId: string;
|
||||||
|
|
||||||
@Column()
|
@Column({
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
encryptCompanyId: string;
|
encryptCompanyId: string;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import * as cliHighlight from 'cli-highlight';
|
|||||||
import { saveChatStartupRecord, saveJobInfoFromRecommendPage, saveMarkAsNotSuitRecord } from "./handlers";
|
import { saveChatStartupRecord, saveJobInfoFromRecommendPage, saveMarkAsNotSuitRecord } from "./handlers";
|
||||||
import { UpdateChatStartupLogTable1729182577167 } from "./migrations/1729182577167-UpdateChatStartupLogTable";
|
import { UpdateChatStartupLogTable1729182577167 } from "./migrations/1729182577167-UpdateChatStartupLogTable";
|
||||||
import minimist from 'minimist'
|
import minimist from 'minimist'
|
||||||
|
import { UpdateBossInfoTable1732032381304 } from "./migrations/1732032381304-UpdateBossInfoTable";
|
||||||
|
|
||||||
Boolean(cliHighlight);
|
Boolean(cliHighlight);
|
||||||
|
|
||||||
@@ -57,7 +58,8 @@ export function initDb(dbFilePath) {
|
|||||||
ChatMessageRecord,
|
ChatMessageRecord,
|
||||||
],
|
],
|
||||||
migrations: [
|
migrations: [
|
||||||
UpdateChatStartupLogTable1729182577167
|
UpdateChatStartupLogTable1729182577167,
|
||||||
|
UpdateBossInfoTable1732032381304
|
||||||
],
|
],
|
||||||
migrationsRun: true
|
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