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 {