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.
136 lines
5.0 KiB
136 lines
5.0 KiB
CREATE TABLE asset (
|
|
asset_id int(10) NOT NULL AUTO_INCREMENT,
|
|
asset_name varchar(100) NOT NULL,
|
|
asset_hostname varchar(100) DEFAULT NULL,
|
|
assetclass_id int(10) NOT NULL,
|
|
asset_info text DEFAULT NULL,
|
|
PRIMARY KEY (asset_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE assetclass (
|
|
assetclass_id int(10) NOT NULL AUTO_INCREMENT,
|
|
assetclassgroup_id int(10) NOT NULL,
|
|
assetclass_name varchar(100) NOT NULL,
|
|
PRIMARY KEY (assetclass_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE assetclassgroup (
|
|
assetclassgroup_id int(10) NOT NULL AUTO_INCREMENT,
|
|
assetclassgroup_name varchar(100) NOT NULL,
|
|
assetclassgroup_color varchar(6) NOT NULL DEFAULT '000000',
|
|
PRIMARY KEY (assetclassgroup_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE location (
|
|
location_id int(10) NOT NULL AUTO_INCREMENT,
|
|
location_name varchar(100) NOT NULL,
|
|
location_parent int(10) NOT NULL DEFAULT 0,
|
|
location_info text DEFAULT NULL,
|
|
location_sort int(11) NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (location_id),
|
|
KEY location_sort (location_sort)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE nat (
|
|
nat_id int(10) NOT NULL AUTO_INCREMENT,
|
|
nat_type int(1) NOT NULL,
|
|
nat_ext int(10) NOT NULL,
|
|
nat_int int(10) NOT NULL,
|
|
PRIMARY KEY (nat_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE node (
|
|
node_id int(10) NOT NULL AUTO_INCREMENT,
|
|
node_ip varchar(45) NOT NULL,
|
|
node_mac varchar(12) NOT NULL,
|
|
node_dns1 varchar(100) DEFAULT NULL,
|
|
node_dns2 varchar(100) DEFAULT NULL,
|
|
subnet_id int(10) NOT NULL,
|
|
asset_id int(10) NOT NULL,
|
|
zone_id int(10) DEFAULT NULL,
|
|
node_info text DEFAULT NULL,
|
|
node_type enum('v4','v6') NOT NULL DEFAULT 'v4',
|
|
PRIMARY KEY (node_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE subnet (
|
|
subnet_id int(10) NOT NULL AUTO_INCREMENT,
|
|
subnet_address varchar(45) NOT NULL,
|
|
subnet_mask int(2) NOT NULL,
|
|
subnet_dhcp_start varchar(15) DEFAULT NULL,
|
|
subnet_dhcp_end varchar(15) DEFAULT NULL,
|
|
subnet_info text DEFAULT NULL,
|
|
protocol_version tinyint(1) NOT NULL DEFAULT 4,
|
|
ntp_server varchar(45) DEFAULT NULL,
|
|
PRIMARY KEY (subnet_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE subnetlocation (
|
|
subnetlocation_id int(10) NOT NULL AUTO_INCREMENT,
|
|
subnet_id int(10) NOT NULL,
|
|
location_id int(10) NOT NULL,
|
|
PRIMARY KEY (subnetlocation_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE subnetvlan (
|
|
subnetvlan_id int(10) NOT NULL AUTO_INCREMENT,
|
|
subnet_id int(10) NOT NULL,
|
|
vlan_id int(10) NOT NULL,
|
|
PRIMARY KEY (subnetvlan_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE user (
|
|
user_id int(10) NOT NULL AUTO_INCREMENT,
|
|
user_name varchar(100) NOT NULL,
|
|
user_pass varchar(32) NOT NULL,
|
|
user_displayname varchar(100) NOT NULL,
|
|
user_language char(2) NOT NULL DEFAULT 'en',
|
|
user_imagesize int(3) NOT NULL DEFAULT 6,
|
|
user_imagecount int(3) NOT NULL DEFAULT 64,
|
|
user_mac varchar(25) NOT NULL DEFAULT 'xx:xx:xx:xx:xx:xx',
|
|
user_dateformat varchar(10) NOT NULL DEFAULT 'd M Y H:i',
|
|
user_dns1suffix varchar(100) DEFAULT NULL,
|
|
user_dns2suffix varchar(100) DEFAULT NULL,
|
|
user_menu_assets varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_assetclasses varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_assetclassgroups varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_locations varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_nodes varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_subnets varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_users varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_vlans varchar(2) NOT NULL DEFAULT 'on',
|
|
user_menu_zones varchar(2) NOT NULL DEFAULT 'on',
|
|
user_tooltips varchar(2) NOT NULL DEFAULT 'on',
|
|
PRIMARY KEY (user_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
INSERT INTO user (user_name, user_pass, user_displayname) VALUES
|
|
('admin', '21232f297a57a5a743894a0e4a801fc3', 'administrator');
|
|
|
|
CREATE TABLE vlan (
|
|
vlan_id int(10) NOT NULL AUTO_INCREMENT,
|
|
vlan_number int(3) NOT NULL,
|
|
vlan_name varchar(100) NOT NULL,
|
|
vlan_info text DEFAULT NULL,
|
|
PRIMARY KEY (vlan_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE zone (
|
|
zone_id int(10) NOT NULL AUTO_INCREMENT,
|
|
zone_soa varchar(40) CHARACTER SET utf8 NOT NULL,
|
|
zone_hostmaster varchar(40) CHARACTER SET utf8 NOT NULL,
|
|
zone_origin varchar(40) CHARACTER SET utf8 NOT NULL,
|
|
zone_ttl_default varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '3D',
|
|
zone_refresh varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '8H',
|
|
zone_retry varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '2H',
|
|
zone_expire varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '4W',
|
|
zone_ttl varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '1D',
|
|
zone_serial int(10) unsigned NOT NULL,
|
|
zone_ns1 varchar(20) CHARACTER SET utf8 NOT NULL,
|
|
zone_ns2 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
|
|
zone_ns3 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
|
|
zone_mx1 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
|
|
zone_mx2 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
|
|
zone_info text CHARACTER SET utf8 DEFAULT NULL,
|
|
PRIMARY KEY (zone_id)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
|