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

6 months ago
6 months ago
  1. -- 创建 sys_user 表
  2. CREATE TABLE IF NOT EXISTS sys_user (
  3. id INTEGER PRIMARY KEY AUTOINCREMENT,
  4. username TEXT NOT NULL,
  5. nickname TEXT,
  6. password TEXT NOT NULL,
  7. avatar TEXT,
  8. role INTEGER,
  9. is_deleted INTEGER DEFAULT 0,
  10. create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  11. update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
  12. );
  13. -- 插入测试数据
  14. INSERT INTO sys_user (username, nickname, password, avatar, role, is_deleted)
  15. VALUES
  16. ('admin', 'Admin', '12345', 'admin.png', 0, 0),
  17. ('john_doe', 'John Doe', 'password123', 'avatar1.png', 1, 0),
  18. ('jane_smith', 'Jane Smith', 'password456', 'avatar2.png', 2, 0);
  19. -- 创建 sys_role 表
  20. CREATE TABLE IF NOT EXISTS sys_role (
  21. id INTEGER PRIMARY KEY AUTOINCREMENT,
  22. name TEXT NOT NULL,
  23. code TEXT NOT NULL,
  24. create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  25. update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
  26. );
  27. -- 插入角色数据
  28. INSERT INTO sys_role (name, code)
  29. VALUES
  30. ('管理员', 'ADMIN'),
  31. ('普通用户', 'USER');
  32. -- 创建 系统配置 表
  33. CREATE TABLE IF NOT EXISTS sys_settings (
  34. id INTEGER PRIMARY KEY AUTOINCREMENT,
  35. parent_id INTEGER NOT NULL,
  36. name TEXT NOT NULL,
  37. code TEXT,
  38. value TEXT
  39. );
  40. INSERT INTO sys_settings (id, parent_id, name, code, value)
  41. VALUES
  42. (1, -1, '加热区域配置', '', '' ),
  43. (2, 1, 'A1', 'H1', '1,1,1'),
  44. (3, 1, 'A2', 'H2', '2,2,2'),
  45. (4, 1, 'A3', 'H3', '3,3,3'),
  46. (5, 1, 'A4', 'H4', '4,4,4'),
  47. (6, 1, 'A5', 'H5', '5,5,5'),
  48. (7, 1, 'A6', 'H6', '6,6,6'),
  49. (8, -1, '加液区域配置', '', '' ),
  50. (9, 8, '加液区', 'A7', '7,7,7' ),
  51. (10, -1, '拍子区域配置', '', '' ),
  52. (11, 10, '拍子存放区', 'A8', '8,8,8' ),
  53. (12, -1, '其他系统配置', '', '' ),
  54. (13, 12, '溶液量低提示', '', '300' ),
  55. (14, 12, '异常处理区', '', '7' ),