石墨消解仪后端服务
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.

36 lines
1.1 KiB

3 months ago
3 months ago
  1. -- 用户表,插入时判断账户是否已存在
  2. CREATE TABLE IF NOT EXISTS user (
  3. id INTEGER PRIMARY KEY AUTOINCREMENT,
  4. username TEXT,
  5. nickname TEXT,
  6. password TEXT,
  7. role TEXT,
  8. fixed_user TEXT,
  9. deleted TEXT,
  10. create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  11. update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
  12. );
  13. INSERT INTO user (username,nickname, password, role, fixed_user, deleted)
  14. SELECT 'admin','Admin', '123456', 'ADMIN', 'ENABLE','DISABLE'
  15. WHERE NOT EXISTS (SELECT 1 FROM user WHERE username = 'admin');
  16. -- 创建 ores 矿石 表
  17. CREATE TABLE IF NOT EXISTS ores
  18. (
  19. id INTEGER PRIMARY KEY AUTOINCREMENT,
  20. name VARCHAR NOT NULL,
  21. create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  22. update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
  23. );
  24. -- 创建 crafts 工艺 表
  25. CREATE TABLE IF NOT EXISTS crafts
  26. (
  27. id INTEGER PRIMARY KEY AUTOINCREMENT,
  28. name VARCHAR NOT NULL,
  29. steps TEXT,
  30. ores_id INTEGER,
  31. create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  32. update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
  33. );