manage.sql 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. CREATE DATABASE `saas_manage` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  2. use `saas_manage`;
  3. create table `datacenter` (
  4. name varchar(30) primary key not null,
  5. description varchar(300) comment '描述'
  6. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据中心';
  7. create table `datasource` (
  8. id int primary key not null auto_increment,
  9. dc_name varchar(30) not null,
  10. db_name varchar(30) not null comment '数据库名',
  11. db_realname varchar(30) comment '数据库真实名',
  12. db_host varchar(100) comment '数据库服务器',
  13. db_port int comment '数据库端口',
  14. db_username varchar(30) comment '数据库登录账号',
  15. db_password varchar(64) comment '数据库登录密码'
  16. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据连接';
  17. create table `backup` (
  18. id int unsigned primary key not null auto_increment,
  19. file_path int unsigned comment '文件ID',
  20. create_time datetime comment '创建时间',
  21. creator_id int unsigned comment '创建人',
  22. company_id int unsigned comment '公司',
  23. status smallint comment '状态',
  24. message varchar(1000) comment '错误信息'
  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='按公司数据备份';
  26. create table `help_doc_project`
  27. (
  28. id int unsigned primary key not null auto_increment,
  29. code varchar(50) not null comment '编码',
  30. name varchar(100) not null comment '名称',
  31. homepage varchar(50) comment '首页',
  32. creator_id int unsigned,
  33. creator_name varchar(100),
  34. create_time datetime,
  35. updater_id int unsigned,
  36. updater_name varchar(100),
  37. update_time datetime
  38. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文档项目';
  39. create table `help_doc_item`
  40. (
  41. id int unsigned primary key not null auto_increment,
  42. project_id int unsigned not null,
  43. parent_id int unsigned,
  44. code varchar(50) not null comment '编码',
  45. name varchar(100) not null comment '名称',
  46. article boolean default 1 comment '是否文档',
  47. order_num int comment '顺序',
  48. creator_id int unsigned,
  49. creator_name varchar(100),
  50. create_time datetime,
  51. updater_id int unsigned,
  52. updater_name varchar(100),
  53. update_time datetime
  54. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文档目录';