CREATE TABLE IF NOT EXISTS `#__dpcalendar_locations` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`title` varchar(255) NOT NULL DEFAULT '',
	`alias` varchar(255) NOT NULL DEFAULT '',
	`country` varchar(255) NOT NULL DEFAULT '',
	`province` varchar(255) NOT NULL DEFAULT '',
	`city` varchar(255) NOT NULL DEFAULT '',
	`zip` varchar(255) NOT NULL DEFAULT '',
	`street` varchar(255) NOT NULL DEFAULT '',
	`number` varchar(255) NOT NULL DEFAULT '',
	`room` varchar(255) NOT NULL DEFAULT '',
	`latitude` float DEFAULT NULL,
	`longitude` float DEFAULT NULL,
	`url` varchar(250) NOT NULL DEFAULT '',
	`description` text NOT NULL,
	`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
	`state` tinyint(1) NOT NULL DEFAULT '0',
	`checked_out` int(11) NOT NULL DEFAULT '0',
	`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
	`ordering` int(11) NOT NULL DEFAULT '0',
	`params` text NOT NULL,
	`language` char(7) NOT NULL DEFAULT '',
	`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
	`created_by` int(10) unsigned NOT NULL DEFAULT '0',
	`created_by_alias` varchar(255) NOT NULL DEFAULT '',
	`version` int(10) unsigned NOT NULL DEFAULT '0',
	`modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified_by` int(10) unsigned NOT NULL DEFAULT '0',
	`publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
	`publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
	PRIMARY KEY (`id`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_state` (`state`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `#__dpcalendar_events_location` (
	`event_id` int(11) NOT NULL DEFAULT '0',
	`location_id` int(11) NOT NULL DEFAULT '0',
	PRIMARY KEY (`event_id`,`location_id`)
) DEFAULT CHARSET=utf8;
