You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

n9e_ams.sql 1.9 kB

5 years ago
5 years ago
5 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. set names utf8;
  2. drop database if exists n9e_ams;
  3. create database n9e_ams;
  4. use n9e_ams;
  5. CREATE TABLE `host`
  6. (
  7. `id` int unsigned not null AUTO_INCREMENT,
  8. `sn` char(128) not null default '',
  9. `ip` char(15) not null,
  10. `ident` varchar(128) not null default '',
  11. `name` varchar(128) not null default '',
  12. `cpu` varchar(255) not null default '',
  13. `mem` varchar(255) not null default '',
  14. `disk` varchar(255) not null default '',
  15. `note` varchar(255) not null default 'different with resource note',
  16. `cate` varchar(32) not null comment 'host,vm,container,switch',
  17. `tenant` varchar(128) not null default '',
  18. `clock` bigint not null comment 'heartbeat timestamp',
  19. PRIMARY KEY (`id`),
  20. UNIQUE KEY (`ip`),
  21. UNIQUE KEY (`ident`),
  22. KEY (`sn`),
  23. KEY (`name`),
  24. KEY (`tenant`)
  25. ) ENGINE = InnoDB
  26. DEFAULT CHARSET = utf8;
  27. CREATE TABLE `host_field`
  28. (
  29. `id` int unsigned not null AUTO_INCREMENT,
  30. `field_ident` varchar(255) not null comment 'english identity',
  31. `field_name` varchar(255) not null comment 'chinese name',
  32. `field_type` varchar(64) not null,
  33. `field_required` tinyint(1) not null default 0,
  34. `field_extra` varchar(2048) not null default '',
  35. `field_cate` varchar(255) not null default 'Default',
  36. PRIMARY KEY (`id`),
  37. KEY (`field_cate`, `field_ident`)
  38. ) ENGINE = InnoDB
  39. DEFAULT CHARSET = utf8;
  40. CREATE TABLE `host_field_value`
  41. (
  42. `id` int unsigned not null AUTO_INCREMENT,
  43. `host_id` int unsigned not null,
  44. `field_ident` varchar(255) not null,
  45. `field_value` varchar(1024) not null default '',
  46. PRIMARY KEY (`id`),
  47. KEY (`host_id`)
  48. ) ENGINE = InnoDB
  49. DEFAULT CHARSET = utf8;
  50. /* 网络设备管理、机柜机架、配件耗材等相关的功能是商业版本才有的,表结构不要放到这里 */