test: 补充测试数据库初始化脚本的注释

This commit is contained in:
2026-06-05 22:28:36 +08:00
parent d70e12e254
commit ef39c4323c

View File

@@ -1,3 +1,4 @@
-- 测试用户表,覆盖全部列类型(数值/字符串/布尔/时间),用于验证 RowMapper 和查询功能
DROP TABLE IF EXISTS users;
CREATE TABLE users (
@@ -12,19 +13,25 @@ CREATE TABLE users (
work_start_time TIME
);
-- 唯一约束用于测试 batchUpdate 的重复键错误场景
ALTER TABLE users ADD CONSTRAINT uk_username UNIQUE (username);
-- 完整数据行(全部字段非空)
INSERT INTO users (username, email, age, balance, active, created_at, birth_date, work_start_time)
VALUES ('alice', 'alice@example.com', 28, 15000, TRUE, '2024-01-15 09:30:00', '1996-05-20', '08:00:00');
-- 完整数据行
INSERT INTO users (username, email, age, balance, active, created_at, birth_date, work_start_time)
VALUES ('bob', 'bob@example.com', 35, 25000, TRUE, '2023-11-01 14:00:00', '1989-03-12', '09:30:00');
-- null 数据行email、age、birth_date、work_start_time 均为 null用于测试空字段映射
INSERT INTO users (username, email, age, balance, active, created_at, birth_date, work_start_time)
VALUES ('charlie', NULL, NULL, 5000, FALSE, '2025-03-10 11:15:00', NULL, NULL);
-- 部分 null 数据行balance 为 nullcreated_at 为 null用于测试字段级 null 映射
INSERT INTO users (username, email, age, balance, active, created_at, birth_date, work_start_time)
VALUES ('diana', 'diana@example.com', 42, NULL, TRUE, NULL, '1982-11-08', '07:45:00');
-- 完整数据行
INSERT INTO users (username, email, age, balance, active, created_at, birth_date, work_start_time)
VALUES ('eve', 'eve@example.com', 31, 8000, TRUE, '2024-07-22 16:45:00', '1993-01-30', '10:00:00');