INSERT INTO `time_blocks` VALUES
(1, NULL, NULL, 2, 1, '00:00:00', '08:00:00', NULL),
(2, NULL, NULL, 1, 1, '08:00:00', '08:30:00', NULL),
(3, NULL, NULL, 1, 1, '08:30:00', '09:00:00', NULL),
(4, NULL, NULL, 1, 1, '09:00:00', '09:30:00', NULL),
(5, NULL, NULL, 1, 1, '09:30:00', '10:00:00', NULL),
(6, NULL, NULL, 1, 1, '10:00:00', '10:30:00', NULL),
(7, NULL, NULL, 1, 1, '10:30:00', '11:00:00', NULL),
(8, NULL, NULL, 1, 1, '11:00:00', '11:30:00', NULL),
(9, NULL, NULL, 1, 1, '11:30:00', '12:00:00', NULL),
(10, NULL, NULL, 1, 1, '12:00:00', '12:30:00', NULL),
(11, NULL, NULL, 1, 1, '12:30:00', '13:00:00', NULL),
(12, NULL, NULL, 1, 1, '13:00:00', '13:30:00', NULL),
(13, NULL, NULL, 1, 1, '13:30:00', '14:00:00', NULL),
(14, NULL, NULL, 1, 1, '14:00:00', '14:30:00', NULL),
(15, NULL, NULL, 1, 1, '14:30:00', '15:00:00', NULL),
(16, NULL, NULL, 1, 1, '15:00:00', '15:30:00', NULL),
(17, NULL, NULL, 1, 1, '15:30:00', '16:00:00', NULL),
(18, NULL, NULL, 1, 1, '16:00:00', '16:30:00', NULL),
(19, NULL, NULL, 1, 1, '16:30:00', '17:00:00', NULL),
(20, NULL, NULL, 1, 1, '17:00:00', '17:30:00', NULL),
(21, NULL, NULL, 1, 1, '17:30:00', '18:00:00', NULL),
(22, NULL, NULL, 2, 1, '18:00:00', '00:00:00', NULL);
-- --------------------------------------------------------
-- Table structure for table `users`
`user_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`fname` varchar(85) DEFAULT NULL,
`lname` varchar(85) DEFAULT NULL,
`username` varchar(85) DEFAULT NULL,
`email` varchar(85) NOT NULL,
`password` varchar(85) NOT NULL,
`salt` varchar(85) NOT NULL,
`organization` varchar(85) DEFAULT NULL,
`position` varchar(85) DEFAULT NULL,
`phone` varchar(85) DEFAULT NULL,
`timezone` varchar(85) NOT NULL,
`language` varchar(10) NOT NULL,
`homepageid` tinyint(2) unsigned NOT NULL DEFAULT '1',
`date_created` datetime NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`lastlogin` datetime DEFAULT NULL,
`status_id` tinyint(2) unsigned NOT NULL,
`legacyid` char(16) DEFAULT NULL,
`legacypassword` varchar(32) DEFAULT NULL,
`public_id` varchar(20) DEFAULT NULL,
`allow_calendar_subscription` tinyint(1) NOT NULL DEFAULT '0',
`default_schedule_id` smallint(5) unsigned DEFAULT NULL,
`credit_count` decimal(7,2) DEFAULT '0.00',
`terms_date_accepted` datetime DEFAULT NULL,
UNIQUE KEY `public_id` (`public_id`),
KEY `status_id` (`status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
-- Dumping data for table `users`
INSERT INTO `users` VALUES
(1, 'User', 'User', 'user', 'user@example.com', '7b6aec38ff9b7650d64d0374194307bdde711425', '3b3dbb9b', 'XYZ Org Inc.', NULL, NULL, 'America/New_York', 'en_us', 1, '[[regtime]]', '[[regtime]]', '2008-09-16 01:59:00', 1, NULL, NULL, NULL, 0, NULL, '0.00', NULL),
(2, '[[admin_fname]]', '[[admin_lname]]', '[[admin_username]]', '[[admin_email]]', '[[admin_pass]]', '[[salt]]', '[[site_name]]', NULL, NULL, 'America/New_York', 'en_us', 1, '[[regtime]]', '[[regtime]]', '2010-03-26 12:44:00', 1, NULL, NULL, NULL, 0, NULL, '0.00', NULL);
-- --------------------------------------------------------
-- Table structure for table `user_email_preferences`
CREATE TABLE `user_email_preferences` (
`user_id` mediumint(8) unsigned NOT NULL,
`event_category` varchar(45) NOT NULL,
`event_type` varchar(45) NOT NULL,
PRIMARY KEY (`user_id`,`event_category`,`event_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
-- Table structure for table `user_groups`
CREATE TABLE `user_groups` (
`user_id` mediumint(8) unsigned NOT NULL,
`group_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`group_id`,`user_id`),
KEY `user_id` (`user_id`),
KEY `group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table `user_groups`
INSERT INTO `user_groups` VALUES
-- --------------------------------------------------------
-- Table structure for table `user_preferences`
CREATE TABLE `user_preferences` (
`user_preferences_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` mediumint(8) unsigned NOT NULL,
`name` varchar(100) NOT NULL,
PRIMARY KEY (`user_preferences_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `user_resource_permissions`
CREATE TABLE `user_resource_permissions` (
`user_id` mediumint(8) unsigned NOT NULL,
`resource_id` smallint(5) unsigned NOT NULL,
`permission_id` tinyint(2) unsigned NOT NULL DEFAULT '1',
`permission_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`,`resource_id`),
KEY `user_id` (`user_id`),
KEY `resource_id` (`resource_id`),
KEY `user_id_2` (`user_id`),
KEY `resource_id_2` (`resource_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table `user_resource_permissions`
INSERT INTO `user_resource_permissions` VALUES
-- --------------------------------------------------------
-- Table structure for table `user_session`
CREATE TABLE `user_session` (
`user_session_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`user_id` mediumint(8) unsigned NOT NULL,
`last_modified` datetime NOT NULL,
`session_token` varchar(50) NOT NULL,
`user_session_value` text NOT NULL,
PRIMARY KEY (`user_session_id`),
KEY `user_session_user_id` (`user_id`),
KEY `user_session_session_token` (`session_token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `user_statuses`
CREATE TABLE `user_statuses` (
`status_id` tinyint(2) unsigned NOT NULL,
`description` varchar(85) DEFAULT NULL,
PRIMARY KEY (`status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table `user_statuses`
INSERT INTO `user_statuses` VALUES
-- Constraints for dumped tables
-- Constraints for table `account_activation`
ALTER TABLE `account_activation`
ADD CONSTRAINT `account_activation_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;
-- Constraints for table `announcement_groups`
ALTER TABLE `announcement_groups`
ADD CONSTRAINT `announcement_groups_ibfk_1` FOREIGN KEY (`announcementid`) REFERENCES `announcements` (`announcementid`) ON DELETE CASCADE,
ADD CONSTRAINT `announcement_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE;
-- Constraints for table `announcement_resources`
ALTER TABLE `announcement_resources`
ADD CONSTRAINT `announcement_resources_ibfk_1` FOREIGN KEY (`announcementid`) REFERENCES `announcements` (`announcementid`) ON DELETE CASCADE,
ADD CONSTRAINT `announcement_resources_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE;
-- Constraints for table `blackout_instances`
ALTER TABLE `blackout_instances`
ADD CONSTRAINT `blackout_instances_ibfk_1` FOREIGN KEY (`blackout_series_id`) REFERENCES `blackout_series` (`blackout_series_id`) ON DELETE CASCADE;
-- Constraints for table `blackout_series_resources`
ALTER TABLE `blackout_series_resources`
ADD CONSTRAINT `blackout_series_resources_ibfk_1` FOREIGN KEY (`blackout_series_id`) REFERENCES `blackout_series` (`blackout_series_id`) ON DELETE CASCADE,
ADD CONSTRAINT `blackout_series_resources_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE;
-- Constraints for table `custom_attribute_entities`
ALTER TABLE `custom_attribute_entities`
ADD CONSTRAINT `custom_attribute_entities_ibfk_1` FOREIGN KEY (`custom_attribute_id`) REFERENCES `custom_attributes` (`custom_attribute_id`) ON DELETE CASCADE;
-- Constraints for table `custom_time_blocks`
ALTER TABLE `custom_time_blocks`
ADD CONSTRAINT `custom_time_blocks_ibfk_1` FOREIGN KEY (`layout_id`) REFERENCES `layouts` (`layout_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `groups`
ADD CONSTRAINT `groups_ibfk_1` FOREIGN KEY (`admin_group_id`) REFERENCES `groups` (`group_id`);
-- Constraints for table `group_resource_permissions`
ALTER TABLE `group_resource_permissions`
ADD CONSTRAINT `group_resource_permissions_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `group_resource_permissions_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `group_roles`
ALTER TABLE `group_roles`
ADD CONSTRAINT `group_roles_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `group_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `peak_times`
ADD CONSTRAINT `peak_times_ibfk_1` FOREIGN KEY (`schedule_id`) REFERENCES `schedules` (`schedule_id`) ON DELETE CASCADE;
-- Constraints for table `quotas`
ADD CONSTRAINT `quotas_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `quotas_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `quotas_ibfk_3` FOREIGN KEY (`schedule_id`) REFERENCES `schedules` (`schedule_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `refund_transaction_log`
ALTER TABLE `refund_transaction_log`
ADD CONSTRAINT `refund_transaction_log_ibfk_1` FOREIGN KEY (`payment_transaction_log_id`) REFERENCES `payment_transaction_log` (`payment_transaction_log_id`) ON DELETE CASCADE;
-- Constraints for table `reminders`
ADD CONSTRAINT `reminders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;
-- Constraints for table `reservation_accessories`
ALTER TABLE `reservation_accessories`
ADD CONSTRAINT `reservation_accessories_ibfk_1` FOREIGN KEY (`accessory_id`) REFERENCES `accessories` (`accessory_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `reservation_accessories_ibfk_2` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `reservation_color_rules`
ALTER TABLE `reservation_color_rules`
ADD CONSTRAINT `reservation_color_rules_ibfk_1` FOREIGN KEY (`custom_attribute_id`) REFERENCES `custom_attributes` (`custom_attribute_id`) ON DELETE CASCADE;
-- Constraints for table `reservation_files`
ALTER TABLE `reservation_files`
ADD CONSTRAINT `reservation_files_ibfk_1` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE;
-- Constraints for table `reservation_guests`
ALTER TABLE `reservation_guests`
ADD CONSTRAINT `reservation_guests_ibfk_1` FOREIGN KEY (`reservation_instance_id`) REFERENCES `reservation_instances` (`reservation_instance_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `reservation_instances`
ALTER TABLE `reservation_instances`
ADD CONSTRAINT `reservations_series` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE;
-- Constraints for table `reservation_reminders`
ALTER TABLE `reservation_reminders`
ADD CONSTRAINT `reservation_reminders_ibfk_1` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE;
-- Constraints for table `reservation_resources`
ALTER TABLE `reservation_resources`
ADD CONSTRAINT `reservation_resources_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `reservation_resources_ibfk_2` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `reservation_series`
ALTER TABLE `reservation_series`
ADD CONSTRAINT `reservations_owner` FOREIGN KEY (`owner_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE,
ADD CONSTRAINT `reservations_status` FOREIGN KEY (`status_id`) REFERENCES `reservation_statuses` (`status_id`) ON UPDATE CASCADE,
ADD CONSTRAINT `reservations_type` FOREIGN KEY (`type_id`) REFERENCES `reservation_types` (`type_id`) ON UPDATE CASCADE;
-- Constraints for table `reservation_users`
ALTER TABLE `reservation_users`
ADD CONSTRAINT `reservation_users_ibfk_1` FOREIGN KEY (`reservation_instance_id`) REFERENCES `reservation_instances` (`reservation_instance_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `reservation_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `reservation_waitlist_requests`
ALTER TABLE `reservation_waitlist_requests`
ADD CONSTRAINT `reservation_waitlist_requests_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE,
ADD CONSTRAINT `reservation_waitlist_requests_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE;
-- Constraints for table `resources`
ADD CONSTRAINT `admin_group_id` FOREIGN KEY (`admin_group_id`) REFERENCES `groups` (`group_id`) ON DELETE SET NULL,
ADD CONSTRAINT `resources_ibfk_1` FOREIGN KEY (`schedule_id`) REFERENCES `schedules` (`schedule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `resources_ibfk_2` FOREIGN KEY (`resource_type_id`) REFERENCES `resource_types` (`resource_type_id`) ON DELETE SET NULL,
ADD CONSTRAINT `resources_ibfk_3` FOREIGN KEY (`resource_status_reason_id`) REFERENCES `resource_status_reasons` (`resource_status_reason_id`) ON DELETE SET NULL;
-- Constraints for table `resource_accessories`
ALTER TABLE `resource_accessories`
ADD CONSTRAINT `resource_accessories_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE,
ADD CONSTRAINT `resource_accessories_ibfk_2` FOREIGN KEY (`accessory_id`) REFERENCES `accessories` (`accessory_id`) ON DELETE CASCADE;
-- Constraints for table `resource_groups`
ALTER TABLE `resource_groups`
ADD CONSTRAINT `resource_groups_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `resource_groups` (`resource_group_id`) ON DELETE CASCADE;
-- Constraints for table `resource_group_assignment`
ALTER TABLE `resource_group_assignment`
ADD CONSTRAINT `resource_group_assignment_ibfk_1` FOREIGN KEY (`resource_group_id`) REFERENCES `resource_groups` (`resource_group_id`) ON DELETE CASCADE,
ADD CONSTRAINT `resource_group_assignment_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE;
-- Constraints for table `resource_images`
ALTER TABLE `resource_images`
ADD CONSTRAINT `resource_images_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `resource_type_assignment`
ALTER TABLE `resource_type_assignment`
ADD CONSTRAINT `resource_type_assignment_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE,
ADD CONSTRAINT `resource_type_assignment_ibfk_2` FOREIGN KEY (`resource_type_id`) REFERENCES `resource_types` (`resource_type_id`) ON DELETE CASCADE;
-- Constraints for table `saved_reports`
ALTER TABLE `saved_reports`
ADD CONSTRAINT `saved_reports_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;
-- Constraints for table `schedules`
ADD CONSTRAINT `schedules_groups_admin_group_id` FOREIGN KEY (`admin_group_id`) REFERENCES `groups` (`group_id`) ON DELETE SET NULL,
ADD CONSTRAINT `schedules_ibfk_1` FOREIGN KEY (`layout_id`) REFERENCES `layouts` (`layout_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `time_blocks`
ALTER TABLE `time_blocks`
ADD CONSTRAINT `time_blocks_ibfk_1` FOREIGN KEY (`layout_id`) REFERENCES `layouts` (`layout_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `users`
ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`status_id`) REFERENCES `user_statuses` (`status_id`) ON UPDATE CASCADE;
-- Constraints for table `user_email_preferences`
ALTER TABLE `user_email_preferences`
ADD CONSTRAINT `user_email_preferences_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `user_groups`
ALTER TABLE `user_groups`
ADD CONSTRAINT `user_groups_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `user_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `user_preferences`
ALTER TABLE `user_preferences`
ADD CONSTRAINT `user_preferences_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `user_resource_permissions`
ALTER TABLE `user_resource_permissions`
ADD CONSTRAINT `user_resource_permissions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `user_resource_permissions_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- Constraints for table `user_session`
ALTER TABLE `user_session`
ADD CONSTRAINT `user_session_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;