ALTER TABLE computers ADD flags_server TINYINT NOT NULL AFTER type;
ALTER TABLE computers ADD KEY(flags_server);
ALTER TABLE templates ADD flags_server TINYINT NOT NULL AFTER type;
INSERT INTO dropdown_type VALUES ('Router');
INSERT INTO dropdown_type VALUES ('Hub');
INSERT INTO dropdown_type VALUES ('Switch');

CREATE TABLE dropdown_iface (
   name char(30)
);

INSERT INTO dropdown_iface VALUES ('10Mbps Ethernet (UTP)');
INSERT INTO dropdown_iface VALUES ('100Mbps Ethernet (UTP)');
INSERT INTO dropdown_iface VALUES ('100Mbps FDDI');
INSERT INTO dropdown_iface VALUES ('ISDN/Frame');
INSERT INTO dropdown_iface VALUES ('T1/E1 or above');

CREATE TABLE event_log (
   ID int(11) DEFAULT '0' NOT NULL auto_increment,
   item int(11) DEFAULT '0' NOT NULL,
   itemtype char(10) DEFAULT '' NOT NULL, 
   date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
   service varchar(20),
   level tinyint(4) DEFAULT '0' NOT NULL,
   message text NOT NULL,
   PRIMARY KEY (ID),
   KEY item (item),
   KEY date (date)
);
CREATE TABLE networking (
   ID int(11) DEFAULT '0' NOT NULL auto_increment,
   name char(30) NOT NULL,
   type char(30) NOT NULL,
   ram char(10) NOT NULL,
   ip char(20) NOT NULL,
   mac char(30) NOT NULL,
   location char(40) NOT NULL,
   serial char(50) NOT NULL,
   otherserial char(50) NOT NULL,
   contact char(30) NOT NULL,
   contact_num char(30) NOT NULL,
   datemod datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
   comments TEXT NOT NULL,
   PRIMARY KEY (ID)
);



# --------------------------------------------------------
#
# Table structure for table 'networking_ports'
#

CREATE TABLE networking_ports (
   ID int(11) DEFAULT '0' NOT NULL auto_increment,
   device_on int(11) DEFAULT '0' NOT NULL,
   device_type tinyint(4) DEFAULT '0' NOT NULL,
   iface char(40) NOT NULL,
   ifaddr char(30) NOT NULL,
   ifmac char(30) DEFAULT '0' NOT NULL,
   logical_number int(11) DEFAULT '0' NOT NULL,
   name char(30) NOT NULL,
   PRIMARY KEY (ID)
);


# --------------------------------------------------------
#
# Table structure for table 'networking_wire'
#

CREATE TABLE networking_wire (
   ID int(11) DEFAULT '0' NOT NULL auto_increment,
   end1 int(11) DEFAULT '0' NOT NULL,
   end2 int(11) DEFAULT '0' NOT NULL,
   PRIMARY KEY (ID)
);
alter table templates add iface CHAR(100) AFTER comments; 
