You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.8 KiB
61 lines
1.8 KiB
|
|
-- 创建 sys_user 表
|
|
CREATE TABLE IF NOT EXISTS sys_user (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
username TEXT NOT NULL,
|
|
nickname TEXT,
|
|
password TEXT NOT NULL,
|
|
avatar TEXT,
|
|
role INTEGER,
|
|
is_deleted INTEGER DEFAULT 0,
|
|
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- 插入测试数据
|
|
INSERT INTO sys_user (username, nickname, password, avatar, role, is_deleted)
|
|
VALUES
|
|
('admin', 'Admin', '12345', 'admin.png', 0, 0),
|
|
('john_doe', 'John Doe', 'password123', 'avatar1.png', 1, 0),
|
|
('jane_smith', 'Jane Smith', 'password456', 'avatar2.png', 2, 0);
|
|
|
|
|
|
-- 创建 sys_role 表
|
|
CREATE TABLE IF NOT EXISTS sys_role (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
name TEXT NOT NULL,
|
|
code TEXT NOT NULL,
|
|
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- 插入角色数据
|
|
INSERT INTO sys_role (name, code)
|
|
VALUES
|
|
('管理员', 'ADMIN'),
|
|
('普通用户', 'USER');
|
|
|
|
-- 创建 系统配置 表
|
|
CREATE TABLE IF NOT EXISTS sys_settings (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
parent_id INTEGER NOT NULL,
|
|
name TEXT NOT NULL,
|
|
code TEXT,
|
|
value TEXT
|
|
);
|
|
INSERT INTO sys_settings (id, parent_id, name, code, value)
|
|
VALUES
|
|
(1, -1, '加热区域配置', '', '' ),
|
|
(2, 1, 'A1', 'H1', '1,1,1'),
|
|
(3, 1, 'A2', 'H2', '2,2,2'),
|
|
(4, 1, 'A3', 'H3', '3,3,3'),
|
|
(5, 1, 'A4', 'H4', '4,4,4'),
|
|
(6, 1, 'A5', 'H5', '5,5,5'),
|
|
(7, 1, 'A6', 'H6', '6,6,6'),
|
|
(8, -1, '加液区域配置', '', '' ),
|
|
(9, 8, '加液区', 'A7', '7,7,7' ),
|
|
(10, -1, '拍子区域配置', '', '' ),
|
|
(11, 10, '拍子存放区', 'A8', '8,8,8' ),
|
|
(12, -1, '其他系统配置', '', '' ),
|
|
(13, 12, '溶液量低提示', '', '300' ),
|
|
(14, 12, '异常处理区', '', '7' ),
|