From b7f149032aa482826ea5bc29bdb88968c4b0a9ad Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Sun, 13 Apr 2025 13:24:10 +0800 Subject: [PATCH] revert: remove ChangeJobLibraryView1744467048874 --- .../sqlite-plugin/src/entity/VJobLibrary.ts | 15 +++------------ packages/sqlite-plugin/src/index.ts | 2 -- .../1744467048874-ChangeJobLibraryView.ts | 17 ----------------- .../src/features/JobInfoSnapshot/index.vue | 7 ------- .../renderer/src/page/MainLayout/JobLibrary.vue | 1 - 5 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 packages/sqlite-plugin/src/migrations/1744467048874-ChangeJobLibraryView.ts diff --git a/packages/sqlite-plugin/src/entity/VJobLibrary.ts b/packages/sqlite-plugin/src/entity/VJobLibrary.ts index faf6e84..c3c3c58 100644 --- a/packages/sqlite-plugin/src/entity/VJobLibrary.ts +++ b/packages/sqlite-plugin/src/entity/VJobLibrary.ts @@ -5,18 +5,12 @@ const { ViewEntity, ViewColumn } = requireTypeorm(); job_info.*, boss_info.name AS bossName, boss_info.title AS bossTitle, - company_info.name AS companyName, - ( - SELECT job_info_change_log.updateTime - FROM job_info_change_log - WHERE job_info_change_log.encryptJobId = job_info.encryptJobId - ORDER BY job_info_change_log.updateTime ASC - LIMIT 1 - ) AS latestLogDate + company_info.name AS companyName FROM job_info LEFT JOIN boss_info ON boss_info.encryptBossId = job_info.encryptBossId - LEFT JOIN company_info ON company_info.encryptCompanyId = job_info.encryptCompanyId`, + LEFT JOIN company_info ON company_info.encryptCompanyId = job_info.encryptCompanyId + `, }) export class VJobLibrary { @ViewColumn() @@ -60,7 +54,4 @@ export class VJobLibrary { @ViewColumn() companyName: string; - - @ViewColumn() - latestLogDate: string; } diff --git a/packages/sqlite-plugin/src/index.ts b/packages/sqlite-plugin/src/index.ts index 1563cc0..02c2a17 100644 --- a/packages/sqlite-plugin/src/index.ts +++ b/packages/sqlite-plugin/src/index.ts @@ -25,7 +25,6 @@ import { saveChatStartupRecord, saveJobInfoFromRecommendPage, saveMarkAsNotSuitR import { UpdateChatStartupLogTable1729182577167 } from "./migrations/1729182577167-UpdateChatStartupLogTable"; import minimist from 'minimist' import { UpdateBossInfoTable1732032381304 } from "./migrations/1732032381304-UpdateBossInfoTable"; -import { ChangeJobLibraryView1744467048874 } from "./migrations/1744467048874-ChangeJobLibraryView"; export function initDb(dbFilePath) { const { DataSource } = requireTypeorm() @@ -58,7 +57,6 @@ export function initDb(dbFilePath) { migrations: [ UpdateChatStartupLogTable1729182577167, UpdateBossInfoTable1732032381304, - ChangeJobLibraryView1744467048874 ], migrationsRun: true }); diff --git a/packages/sqlite-plugin/src/migrations/1744467048874-ChangeJobLibraryView.ts b/packages/sqlite-plugin/src/migrations/1744467048874-ChangeJobLibraryView.ts deleted file mode 100644 index 7862f40..0000000 --- a/packages/sqlite-plugin/src/migrations/1744467048874-ChangeJobLibraryView.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { MigrationInterface, QueryRunner } 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 ChangeJobLibraryView1744467048874 implements MigrationInterface { - public async up(queryRunner: QueryRunner): Promise { - for (const viewName of viewNames) { - await queryRunner.query(`DROP VIEW IF EXISTS "${viewName}"`); - } - } - - public async down(queryRunner: QueryRunner): Promise {} -} diff --git a/packages/ui/src/renderer/src/features/JobInfoSnapshot/index.vue b/packages/ui/src/renderer/src/features/JobInfoSnapshot/index.vue index 50b3c24..8455f56 100644 --- a/packages/ui/src/renderer/src/features/JobInfoSnapshot/index.vue +++ b/packages/ui/src/renderer/src/features/JobInfoSnapshot/index.vue @@ -3,13 +3,6 @@ {{ jobInfo.companyName }} {{ jobInfo.jobName }} {{ jobInfo.positionName }} - - {{ - jobInfo.latestLogDate - ? transformUtcDateToLocalDate(jobInfo.latestLogDate).format('YYYY-MM-DD HH:mm:ss') - : '无记录,数据可能来自旧版本' - }} - {{ jobInfo.date diff --git a/packages/ui/src/renderer/src/page/MainLayout/JobLibrary.vue b/packages/ui/src/renderer/src/page/MainLayout/JobLibrary.vue index da51830..67f74fb 100644 --- a/packages/ui/src/renderer/src/page/MainLayout/JobLibrary.vue +++ b/packages/ui/src/renderer/src/page/MainLayout/JobLibrary.vue @@ -38,7 +38,6 @@ link type="primary" size="small" - :disabled="!row.latestLogDate" @click="handleViewJobHistoryButtonClick(row)" >变更记录