create-table.sql 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. -- 创建工具表
  2. create table IF NOT EXISTS fakeapitool
  3. (
  4. name varchar(20) not null comment 'token名称'
  5. primary key,
  6. value text not null comment 'token值',
  7. userName varchar(50) not null comment 'token用户名',
  8. password varchar(50) not null comment 'token密码',
  9. updateTime datetime null comment 'token注册时间',
  10. constraint fakeApiTool_pk
  11. unique (name)
  12. );
  13. -- 创建用户表
  14. create table IF NOT EXISTS fakeapitooluser
  15. (
  16. name varchar(20) default 'root' not null comment '登录用户名',
  17. password varchar(50) default '123456' not null comment '登录密码',
  18. id int default 1 not null comment '用户Id'
  19. primary key,
  20. constraint fakeapitooluser_pk
  21. unique (name),
  22. constraint fakeapitooluser_pk2
  23. unique (name),
  24. constraint fakeapitooluser_pk3
  25. unique (id),
  26. constraint fakeapitooluser_pk4
  27. unique (name)
  28. );
  29. -- 用户表插入用户名和密码
  30. INSERT IGNORE INTO oneapi.fakeapitooluser (name, password, id) VALUES ('root', '123456', 1);