stat_table_devices.sql 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --
  2. -- Структура таблицы `devices`
  3. --
  4. CREATE TABLE `devices` (
  5. `id` int(11) NOT NULL,
  6. `device_model` varchar(50) DEFAULT '',
  7. `device_type` int(11) NOT NULL DEFAULT 1,
  8. `device_model_id` int(11) DEFAULT 89,
  9. `vendor_id` int(11) NOT NULL DEFAULT 1,
  10. `device_name` varchar(50) DEFAULT '',
  11. `building_id` int(11) NOT NULL DEFAULT 1,
  12. `ip` varchar(15) DEFAULT '',
  13. `port_count` int(11) NOT NULL DEFAULT 0,
  14. `SN` varchar(80) DEFAULT NULL,
  15. `dhcp` tinyint(1) NOT NULL DEFAULT 0,
  16. `comment` text DEFAULT NULL,
  17. `snmp_version` tinyint(4) NOT NULL DEFAULT 0,
  18. `snmp3_user_rw` varchar(20) DEFAULT NULL,
  19. `snmp3_user_rw_password` varchar(20) DEFAULT NULL,
  20. `snmp3_user_ro` varchar(20) DEFAULT NULL,
  21. `snmp3_user_ro_password` varchar(20) DEFAULT NULL,
  22. `community` varchar(50) NOT NULL DEFAULT 'public',
  23. `rw_community` varchar(50) NOT NULL DEFAULT 'private',
  24. `fdb_snmp_index` tinyint(1) NOT NULL DEFAULT 0,
  25. `discovery` tinyint(1) NOT NULL DEFAULT 1,
  26. `user_acl` tinyint(1) NOT NULL DEFAULT 0,
  27. `nagios` tinyint(1) NOT NULL DEFAULT 0,
  28. `deleted` tinyint(1) NOT NULL DEFAULT 0,
  29. `active` tinyint(1) NOT NULL DEFAULT 1,
  30. `nagios_status` varchar(10) NOT NULL DEFAULT 'UP',
  31. `queue_enabled` tinyint(1) NOT NULL DEFAULT 0,
  32. `connected_user_only` tinyint(1) NOT NULL DEFAULT 0,
  33. `user_id` int(11) DEFAULT 0
  34. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  35. --
  36. -- Индексы сохранённых таблиц
  37. --
  38. --
  39. -- Индексы таблицы `devices`
  40. --
  41. ALTER TABLE `devices`
  42. ADD PRIMARY KEY (`id`),
  43. ADD UNIQUE KEY `id` (`id`),
  44. ADD KEY `device_model_id` (`device_model`),
  45. ADD KEY `ip` (`ip`),
  46. ADD KEY `device_type` (`device_type`);
  47. --
  48. -- AUTO_INCREMENT для сохранённых таблиц
  49. --
  50. --
  51. -- AUTO_INCREMENT для таблицы `devices`
  52. --
  53. ALTER TABLE `devices`
  54. MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;