From e1693a7323738aceb5f81a037271a701bc4747ec Mon Sep 17 00:00:00 2001 From: masaaki Date: Fri, 25 Aug 2023 05:53:58 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20356:=20license=5Fhistory=E3=83=86?= =?UTF-8?q?=E3=83=BC=E3=83=96=E3=83=AB=E3=82=92=E6=B6=88=E3=81=97=E8=BE=BC?= =?UTF-8?q?=E3=82=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task2456: license_historyテーブルを消し込む](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2456) - 元PBI or タスクへのリンク(内容・目的などはそちらにあるはず) - 何をどう変更したか、追加したライブラリなど - プロダクト バックログ項目 1226: 第五として、自アカウント内ユーザーにライセンスを割り当てたい にてライセンス割り当て履歴テーブル(license_allocation_history)を作成したのですが、過去にlicenses_historyという名で同様のテーブルを作成していることが判明しました。 - 影響調査の結果、過去作成したlicenses_historyについては、使用していないことが分かったので、削除するよう対応を行いました。 - このPull Requestでの対象/対象外 - すべて対象 - 影響範囲(他の機能にも影響があるか) - ソースコードgrepにより、licenses_historyテーブルを使用していないことを確認済 ## レビューポイント - 特にレビューしてほしい箇所 - 軽微なものや自明なものは記載不要 - 修正範囲が大きい場合などに記載 - 全体的にや仕様を満たしているか等は本当に必要な時のみ記載 - 特にありません。 ## UIの変更 - 特にありません。 ## 動作確認状況 - 全ユニットテスト実施し正常に通ることを確認 ## 補足 - 相談、参考資料などがあれば --- .../migrations/030-drop_licenses_history.sql | 16 +++++++++++++++ .../licenses/entity/license.entity.ts | 20 ------------------- 2 files changed, 16 insertions(+), 20 deletions(-) create mode 100644 dictation_server/db/migrations/030-drop_licenses_history.sql diff --git a/dictation_server/db/migrations/030-drop_licenses_history.sql b/dictation_server/db/migrations/030-drop_licenses_history.sql new file mode 100644 index 0000000..a6da691 --- /dev/null +++ b/dictation_server/db/migrations/030-drop_licenses_history.sql @@ -0,0 +1,16 @@ +-- +migrate Up +DROP TABLE IF EXISTS `licenses_history`; + +-- +migrate Down +CREATE TABLE IF NOT EXISTS `licenses_history` ( + `id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY COMMENT 'ライセンス履歴ID', + `user_id` BIGINT UNSIGNED NOT NULL COMMENT 'ユーザID', + `license_id` BIGINT UNSIGNED NOT NULL COMMENT 'ライセンスID', + `allocated` BOOLEAN NOT NULL COMMENT '割り当てたか', + `executed_at` TIMESTAMP NOT NULL COMMENT '実施日時', + `exchange_type` VARCHAR(255) NOT NULL COMMENT 'ライセンス切り替え種別(なし/トライアル→通常/紙→通常)', + `created_at` TIMESTAMP DEFAULT now() COMMENT '作成時刻', + `created_by` VARCHAR(255) COMMENT '作成者', + `updated_at` TIMESTAMP DEFAULT now() on UPDATE now() COMMENT '更新時刻', + `updated_by` VARCHAR(255) COMMENT '更新者' +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; diff --git a/dictation_server/src/repositories/licenses/entity/license.entity.ts b/dictation_server/src/repositories/licenses/entity/license.entity.ts index 3d3df06..88363ab 100644 --- a/dictation_server/src/repositories/licenses/entity/license.entity.ts +++ b/dictation_server/src/repositories/licenses/entity/license.entity.ts @@ -97,26 +97,6 @@ export class License { @JoinColumn({ name: 'allocated_user_id' }) user?: User; } -@Entity({ name: 'licenses_history' }) -export class LicenseHistory { - @PrimaryGeneratedColumn() - id: number; - - @Column() - user_id: number; - - @Column() - license_id: number; - - @Column() - allocated: boolean; - - @Column() - executed_at: Date; - - @Column() - exchange_type: string; -} @Entity({ name: 'card_license_issue' }) export class CardLicenseIssue {