-- 技师实名认证记录表
DROP TABLE IF EXISTS `coach_real_records`;
CREATE TABLE IF NOT EXISTS `coach_real_records` (
    `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '技师实名认证记录编号',
    `coach_id` bigint unsigned NOT NULL COMMENT '技师编号',
    `real_name` varchar(50) NOT NULL COMMENT '姓名',
    `id_card` varchar(18) NOT NULL COMMENT '身份证号',
    `id_card_front_photo` varchar(255) NOT NULL COMMENT '身份证正面照片',
    `id_card_back_photo` varchar(255) NOT NULL COMMENT '身份证反面照片',
    `id_card_hand_photo` varchar(255) NOT NULL COMMENT '手持身份证照片',
    `auditor` varchar(50) DEFAULT NULL COMMENT '审核人',
    `audit_time` timestamp NULL DEFAULT NULL COMMENT '审核时间',
    `audit_remark` varchar(255) DEFAULT NULL COMMENT '审核回执',
    `state` varchar(255) NOT NULL DEFAULT 'PENDING' COMMENT '状态',
    `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
    `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
    `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
    PRIMARY KEY (`id`),
    KEY `idx_crar_coach_coach_id` (`coach_id`),
    CONSTRAINT `fk_real_auth_records_coach_id` FOREIGN KEY (`coach_id`) REFERENCES `coach_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '技师实名认证记录表';
