Added rollup sql code to bring the current database up to speed with the option / permission changes.

git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@799 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-28 04:03:19 +00:00
parent 7904372dff
commit aed090fbe2
3 changed files with 545 additions and 46 deletions

View File

@@ -830,6 +830,54 @@ INSERT INTO `pmgr_customers` VALUES (61,'Selle-Jackson, Angela',77,1,1,0,NULL);
/*!40000 ALTER TABLE `pmgr_customers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_default_options`
--
DROP TABLE IF EXISTS `pmgr_default_options`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_default_options` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_default_options`
--
LOCK TABLES `pmgr_default_options` WRITE;
/*!40000 ALTER TABLE `pmgr_default_options` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_default_options` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_default_permissions`
--
DROP TABLE IF EXISTS `pmgr_default_permissions`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_default_permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`permission_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_default_permissions`
--
LOCK TABLES `pmgr_default_permissions` WRITE;
/*!40000 ALTER TABLE `pmgr_default_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_default_permissions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_deposits`
--
@@ -1619,11 +1667,12 @@ DROP TABLE IF EXISTS `pmgr_group_options`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_group_options` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_id` int(10) unsigned NOT NULL,
`name` varchar(50) NOT NULL,
`value` varchar(255) NOT NULL,
`option_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`group_id`,`name`)
PRIMARY KEY (`id`),
KEY `group_key` (`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
@@ -1644,11 +1693,12 @@ DROP TABLE IF EXISTS `pmgr_group_permissions`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_group_permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_id` int(10) unsigned NOT NULL,
`name` char(30) NOT NULL,
`access` enum('ALLOWED','DENIED','FORCED') NOT NULL DEFAULT 'ALLOWED',
`permission_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`group_id`,`name`)
PRIMARY KEY (`id`),
KEY `group_key` (`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
@@ -1658,7 +1708,6 @@ SET character_set_client = @saved_cs_client;
LOCK TABLES `pmgr_group_permissions` WRITE;
/*!40000 ALTER TABLE `pmgr_group_permissions` DISABLE KEYS */;
INSERT INTO `pmgr_group_permissions` VALUES (1,'EVERYTHING','FORCED',NULL);
/*!40000 ALTER TABLE `pmgr_group_permissions` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1673,9 +1722,10 @@ CREATE TABLE `pmgr_groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(12) NOT NULL,
`name` varchar(80) NOT NULL,
`rank` smallint(5) unsigned NOT NULL DEFAULT '100',
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -1684,7 +1734,6 @@ SET character_set_client = @saved_cs_client;
LOCK TABLES `pmgr_groups` WRITE;
/*!40000 ALTER TABLE `pmgr_groups` DISABLE KEYS */;
INSERT INTO `pmgr_groups` VALUES (1,'Owner','Owner Group',NULL);
/*!40000 ALTER TABLE `pmgr_groups` ENABLE KEYS */;
UNLOCK TABLES;
@@ -3558,6 +3607,31 @@ INSERT INTO `pmgr_maps_units` VALUES (78,1,78,372,2214,1);
/*!40000 ALTER TABLE `pmgr_maps_units` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_memberships`
--
DROP TABLE IF EXISTS `pmgr_memberships`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_memberships` (
`site_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`site_id`,`user_id`,`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_memberships`
--
LOCK TABLES `pmgr_memberships` WRITE;
/*!40000 ALTER TABLE `pmgr_memberships` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_memberships` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_notes`
--
@@ -3586,6 +3660,107 @@ LOCK TABLES `pmgr_notes` WRITE;
/*!40000 ALTER TABLE `pmgr_notes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_option_values`
--
DROP TABLE IF EXISTS `pmgr_option_values`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_option_values` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL,
`value` varchar(255) NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_option_values`
--
LOCK TABLES `pmgr_option_values` WRITE;
/*!40000 ALTER TABLE `pmgr_option_values` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_option_values` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_options`
--
DROP TABLE IF EXISTS `pmgr_options`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_options` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_key` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_options`
--
LOCK TABLES `pmgr_options` WRITE;
/*!40000 ALTER TABLE `pmgr_options` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_options` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_permission_values`
--
DROP TABLE IF EXISTS `pmgr_permission_values`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_permission_values` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`permission_id` int(10) unsigned NOT NULL,
`access` enum('ALLOW','DENY') NOT NULL DEFAULT 'DENY',
`level` smallint(5) unsigned DEFAULT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_permission_values`
--
LOCK TABLES `pmgr_permission_values` WRITE;
/*!40000 ALTER TABLE `pmgr_permission_values` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_permission_values` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_permissions`
--
DROP TABLE IF EXISTS `pmgr_permissions`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_key` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_permissions`
--
LOCK TABLES `pmgr_permissions` WRITE;
/*!40000 ALTER TABLE `pmgr_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_permissions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_reservations`
--
@@ -3668,32 +3843,6 @@ INSERT INTO `pmgr_site_areas` VALUES (1,1,'Main','Main Facility Area',NULL);
/*!40000 ALTER TABLE `pmgr_site_areas` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_site_memberships`
--
DROP TABLE IF EXISTS `pmgr_site_memberships`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_site_memberships` (
`site_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`site_id`,`user_id`,`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_site_memberships`
--
LOCK TABLES `pmgr_site_memberships` WRITE;
/*!40000 ALTER TABLE `pmgr_site_memberships` DISABLE KEYS */;
INSERT INTO `pmgr_site_memberships` VALUES (1,1,1,NULL);
/*!40000 ALTER TABLE `pmgr_site_memberships` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_site_options`
--
@@ -3702,11 +3851,12 @@ DROP TABLE IF EXISTS `pmgr_site_options`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_site_options` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`site_id` int(10) unsigned NOT NULL,
`name` varchar(50) NOT NULL,
`value` varchar(255) NOT NULL,
`option_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`site_id`,`name`)
PRIMARY KEY (`id`),
KEY `site_key` (`site_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
@@ -3719,6 +3869,32 @@ LOCK TABLES `pmgr_site_options` WRITE;
/*!40000 ALTER TABLE `pmgr_site_options` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_site_permissions`
--
DROP TABLE IF EXISTS `pmgr_site_permissions`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_site_permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`site_id` int(10) unsigned NOT NULL,
`permission_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `site_key` (`site_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_site_permissions`
--
LOCK TABLES `pmgr_site_permissions` WRITE;
/*!40000 ALTER TABLE `pmgr_site_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_site_permissions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_sites`
--
@@ -5804,11 +5980,12 @@ DROP TABLE IF EXISTS `pmgr_user_options`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_user_options` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`name` varchar(50) NOT NULL,
`value` varchar(255) NOT NULL,
`option_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`user_id`,`name`)
PRIMARY KEY (`id`),
KEY `user_key` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
@@ -5821,6 +5998,32 @@ LOCK TABLES `pmgr_user_options` WRITE;
/*!40000 ALTER TABLE `pmgr_user_options` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_user_permissions`
--
DROP TABLE IF EXISTS `pmgr_user_permissions`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pmgr_user_permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`permission_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_key` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `pmgr_user_permissions`
--
LOCK TABLES `pmgr_user_permissions` WRITE;
/*!40000 ALTER TABLE `pmgr_user_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `pmgr_user_permissions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pmgr_users`
--
@@ -5837,7 +6040,7 @@ CREATE TABLE `pmgr_users` (
`contact_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -5846,7 +6049,6 @@ SET character_set_client = @saved_cs_client;
LOCK TABLES `pmgr_users` WRITE;
/*!40000 ALTER TABLE `pmgr_users` DISABLE KEYS */;
INSERT INTO `pmgr_users` VALUES (1,'AP','abijah',NULL,NULL,1,NULL);
/*!40000 ALTER TABLE `pmgr_users` ENABLE KEYS */;
UNLOCK TABLES;
@@ -5863,4 +6065,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2009-08-26 20:06:39
-- Dump completed on 2009-08-28 4:00:19