-- 客户级承运商官网登录账密
CREATE TABLE `customer_provider_credential` (
    `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    `customer_id` VARCHAR(32) NOT NULL,
    `provider` VARCHAR(16) NOT NULL,
    `login_email` VARCHAR(255) NOT NULL,
    `password_ciphertext` TEXT NOT NULL,
    `updated_by` VARCHAR(32) NULL,
    `is_deleted` BOOLEAN NOT NULL DEFAULT false,
    `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updated_at` DATETIME(3) NOT NULL,

    PRIMARY KEY (`id`),
    UNIQUE INDEX `uq_customer_provider`(`customer_id`, `provider`),
    INDEX `idx_cpc_customer`(`customer_id`, `is_deleted`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
