-- +migrate Up
CREATE TABLE IF NOT EXISTS `licenses` (
	`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY COMMENT 'ライセンスID',
	`expiry_date` TIMESTAMP COMMENT '有効期限',
	`account_id` BIGINT UNSIGNED NOT NULL COMMENT '所有アカウントID',
	`type` VARCHAR(255) NOT NULL COMMENT 'ライセンス種別(トライアル/通常/カード)',
	`status` VARCHAR(255) NOT NULL COMMENT 'ライセンス状態(未割当/割り当て済/削除済)',
	`allocated_user_id` BIGINT UNSIGNED COMMENT '割り当てユーザID',
	`order_id` BIGINT UNSIGNED COMMENT '注文ID',
	`deleted_at` TIMESTAMP COMMENT '削除日時',
	`delete_order_id` BIGINT UNSIGNED COMMENT '削除注文ID'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;

-- +migrate Down
DROP TABLE `licenses`;