-- AlterTable
ALTER TABLE `TransactionHistory` ADD COLUMN `commission` DECIMAL(10, 4) NULL,
    ADD COLUMN `settle_amount` DECIMAL(10, 4) NULL;

-- AlterTable
ALTER TABLE `User` ADD COLUMN `api_key` VARCHAR(191) NULL,
    ADD COLUMN `secret_key` VARCHAR(191) NULL;

-- CreateTable
CREATE TABLE `CommissionHistory` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `userId` INTEGER NOT NULL,
    `commission` DECIMAL(10, 4) NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `CommissionHistory` ADD CONSTRAINT `CommissionHistory_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
