Skip to content

Commit

Permalink
MP: complete, I hope, the new upgrade scripts.. neeeeeeds some testin!
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpascoe committed Jul 23, 2008
1 parent e058864 commit f1ffef3
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 13 deletions.
7 changes: 6 additions & 1 deletion install/2-to-3.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
//
// This script is to be used when upgrading from version 08.05.14.
// It will help to create proper PTR zones for the subnets and DNS records you have
//
//
/* -------------------- COMMON HEADER ---------------------- */
$base = dirname(__FILE__)."/../www/";
while ($base and (!is_dir($base.'/include'))) $base = preg_replace('+/[^/]*$+', '', $base);
Expand Down Expand Up @@ -61,4 +66,4 @@

exit(0);

?>
?>
1 change: 0 additions & 1 deletion install/2-to-3.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ALTER TABLE `dns_server_domains`
ALTER TABLE `locations` COMMENT = 'Stores basic location information for devices.';

INSERT INTO `dcm_module_list` ( `id` , `name` , `description` , `file` ) VALUES
('58', 'config_diff', 'Display unix diff of configs', 'ona/configuration.inc.php'),
('59', 'location_add', 'Add a location record', 'ona/location.inc.php'),
('60', 'location_modify', 'Modify a location record', 'ona/location.inc.php'),
('61', 'location_del', 'Delete a location', 'ona/location.inc.php'),
Expand Down
55 changes: 47 additions & 8 deletions install/ona-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,20 @@ INSERT INTO `dcm_module_list` VALUES
(50,'vlan_add','Add a VLAN','ona/vlan.inc.php'),
(51,'vlan_del','Delete a VLAN','ona/vlan.inc.php'),
(52,'vlan_modify','Modify a VLAN','ona/vlan.inc.php'),
(53, 'dhcp_failover_group_add', 'Add servers to a DHCP failover group', 'ona/dhcp_failover.inc.php'),
(54, 'dhcp_failover_group_modify', 'Modify a DHCP failover group', 'ona/dhcp_failover.inc.php'),
(55, 'dhcp_failover_group_display', 'Display a DHCP failover group', 'ona/dhcp_failover.inc.php'),
(56, 'config_diff', 'Display unix diff of configs', 'ona/configuration.inc.php'),
(57, 'nat_add', 'Add external NAT IP to existing internal IP', 'ona/interface.inc.php'),
(58, 'nat_del', 'Delete external NAT IP from existing internal IP', 'ona/interface.inc.php');
(53,'dhcp_failover_group_add', 'Add servers to a DHCP failover group', 'ona/dhcp_failover.inc.php'),
(54,'dhcp_failover_group_modify', 'Modify a DHCP failover group', 'ona/dhcp_failover.inc.php'),
(55,'dhcp_failover_group_display', 'Display a DHCP failover group', 'ona/dhcp_failover.inc.php'),
(56,'config_diff', 'Display unix diff of configs', 'ona/configuration.inc.php'),
(57,'nat_add', 'Add external NAT IP to existing internal IP', 'ona/interface.inc.php'),
(58,'nat_del', 'Delete external NAT IP from existing internal IP', 'ona/interface.inc.php'),
(59,'location_add', 'Add a location record', 'ona/location.inc.php'),
(60,'location_modify', 'Modify a location record', 'ona/location.inc.php'),
(61,'location_del', 'Delete a location', 'ona/location.inc.php'),
(62,'custom_attribute_add', 'Add a custom attribute', 'ona/custom_attribute.inc.php'),
(63,'custom_attribute_del', 'Delete a custom attribute', 'ona/custom_attribute.inc.php'),
(64,'custom_attribute_modify', 'Modify a custom attribute', 'ona/custom_attribute.inc.php'),
(65,'ona_sql', 'Perform basic SQL operations on the database', 'sql.inc.php');

/*!40000 ALTER TABLE `dcm_module_list` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down Expand Up @@ -252,7 +260,14 @@ INSERT INTO `permissions` VALUES
(15,'template_admin','Template system admin'),
(16,'vlan_add','Add VLANs and VLAN Campuses'),
(17,'vlan_del','Delete VLANs and VLAN Campuses'),
(18,'vlan_modify','Modify VLANs and VLAN Campuses');
(18,'vlan_modify','Modify VLANs and VLAN Campuses'),
( '100019', 'location_del', 'Delete a location'),
( '100020', 'location_add', 'Add a location'),
( '100021', 'ona_sql', 'Perform SQL operations on the ONA tables'),
( '100022', 'custom_attribute_add', 'Add custom attribute'),
( '100023', 'custom_attribute_del', 'Delete custom attribute'),
( '100024', 'custom_attribute_modify', 'Modify custom attribute');

/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
UNLOCK TABLES;

Expand All @@ -262,7 +277,31 @@ UNLOCK TABLES;

LOCK TABLES `permission_assignments` WRITE;
/*!40000 ALTER TABLE `permission_assignments` DISABLE KEYS */;
INSERT INTO `permission_assignments` VALUES (1,1,0,18),(2,2,0,18),(3,3,0,18),(4,4,0,18),(5,5,0,18),(6,6,0,18),(7,7,0,18),(8,8,0,18),(9,9,0,18),(10,10,0,18),(11,11,0,18),(12,12,0,18),(13,13,0,18),(14,14,0,18),(15,15,0,18),(16,16,0,18),(17,17,0,18),(18,18,0,18);
INSERT INTO `permission_assignments` VALUES
(1,1,0,18),
(2,2,0,18),
(3,3,0,18),
(4,4,0,18),
(5,5,0,18),
(6,6,0,18),
(7,7,0,18),
(8,8,0,18),
(9,9,0,18),
(10,10,0,18),
(11,11,0,18),
(12,12,0,18),
(13,13,0,18),
(14,14,0,18),
(15,15,0,18),
(16,16,0,18),
(17,17,0,18),
(18,18,0,18),
('100001', '100019', '0', 18),
('100002', '100020', '0', 18),
('100003', '100021', '0', 18),
('100004', '100022', '0', 18),
('100005', '100023', '0', 18),
('100006', '100024', '0', 18);
/*!40000 ALTER TABLE `permission_assignments` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
Expand Down
19 changes: 16 additions & 3 deletions install/ona-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ CREATE TABLE `configurations` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Stores various types of text configurations';


CREATE TABLE `contexts` (
`id` INT( 10 ) NOT NULL ,
`name` VARCHAR( 63 ) NOT NULL ,
`description` VARCHAR( 127 ) NOT NULL ,
`color` VARCHAR( 10 ) NOT NULL COMMENT 'define a color to visualy represent this context',
PRIMARY KEY ( `id` )
) ENGINE = innodb COMMENT = 'Allows for two sets of data with similar values.';


--
-- Table structure for table `custom_attribute_types`
--
Expand All @@ -62,6 +72,8 @@ CREATE TABLE `custom_attribute_types` (
`id` int(10) unsigned NOT NULL,
`name` varchar(63) NOT NULL,
`notes` varchar(127) NOT NULL,
`field_validation_rule` TEXT NOT NULL COMMENT 'Use a regular expression to validate the data associated with this type',
`failed_rule_text` TEXT NOT NULL COMMENT 'The text that its presented when the field validation rule fails.',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Configuration types';

Expand All @@ -75,7 +87,7 @@ CREATE TABLE `custom_attributes` (
`table_name_ref` varchar(40) NOT NULL COMMENT 'the name of the table conaining the associated record',
`table_id_ref` int(10) unsigned NOT NULL default '0' COMMENT 'the id within the table_name_ref table to associate with',
`custom_attribute_type_id` int(10) NOT NULL,
`attribute` longtext NOT NULL,
`value` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Stores general messages for ONA "display" pages';

Expand Down Expand Up @@ -129,6 +141,7 @@ CREATE TABLE `devices` (
`id` int(10) NOT NULL,
`device_type_id` int(10) NOT NULL,
`location_id` int(10) NOT NULL,
`primary_host_id` INT(10) NOT NULL COMMENT 'Tracks the host that references this device by name',
`asset_tag` varchar(255) default NULL,
`serial_number` varchar(255) default NULL,
PRIMARY KEY (`id`),
Expand Down Expand Up @@ -243,7 +256,7 @@ CREATE TABLE `dns_server_domains` (
`id` tinyint(10) unsigned NOT NULL,
`host_id` tinyint(10) unsigned NOT NULL,
`domain_id` tinyint(10) unsigned NOT NULL,
`authoritative` tinyint(1) NOT NULL,
`role` VARCHAR(10) NOT NULL COMMENT 'What role does this server play for this domain? master, slave, forward?',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Stores domain to DNS server relationships';

Expand Down Expand Up @@ -367,7 +380,7 @@ CREATE TABLE `locations` (
`longitude` varchar(20) NOT NULL,
`misc` varchar(256) NOT NULL COMMENT 'Misc info, site contacts, phone numbers etc.',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table needs re-worked';
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Stores basic location information for devices.';

--
-- Table structure for table `manufacturers`
Expand Down

0 comments on commit f1ffef3

Please sign in to comment.