/*
* $Id: schema.sql 56 2010-08-28 11:09:52Z stuart $
*
* spbug.com
* Sequel Pro URL Shortening Service
*
* Copyright (c) 2010 Stuart Connolly. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
CREATE TABLE `redirect_log` (
`redirect_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`redirect_url_id` int(11) UNSIGNED NOT NULL,
`redirect_date` datetime NOT NULL,
`redirect_request_url` varchar(256) NOT NULL,
`redirect_url` varchar(100) NOT NULL,
`redirect_ip` varchar(15) DEFAULT NULL,
`redirect_agent` varchar(256) DEFAULT NULL,
PRIMARY KEY (`redirect_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `redirect_page_urls` (
`page_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`page_name` varchar(32) NOT NULL,
`page_regex` varchar(32) NOT NULL,
PRIMARY KEY (`page_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
LOCK TABLES `redirect_page_urls` WRITE;
/*!40000 ALTER TABLE `redirect_page_urls` DISABLE KEYS */;
INSERT INTO `redirect_page_urls` (`page_id`, `page_name`, `page_regex`)
VALUES
(1, 'Help', '/^(h)$/'),
(2, 'Stats', '/^(s)$/');
/*!40000 ALTER TABLE `redirect_page_urls` ENABLE KEYS */;
UNLOCK TABLES;
CREATE TABLE `redirect_urls` (
`url_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`url_name` varchar(32) NOT NULL,
`url_regex` varchar(32) NOT NULL,
`url_regex_example` varchar(64) NOT NULL,
`url_redirect_url` varchar(100) NOT NULL,
PRIMARY KEY (`url_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
LOCK TABLES `redirect_urls` WRITE;
/*!40000 ALTER TABLE `redirect_urls` DISABLE KEYS */;
INSERT INTO `redirect_urls` (`url_id`, `url_name`, `url_regex`, `url_regex_example`, `url_redirect_url`)
VALUES
(1, 'Crash/Exception Log Report', '/^lr\\/([0-9]+)\\/([0-9]+)$/', '/lr/%log_id/%report_id', 'http://log.sequelpro.com/viewreports/%d/%d'),
(2, 'Crash/Exception Log Reports', '/^lr\\/([0-9]+)$/', '/lr/%log_id', 'http://log.sequelpro.com/viewreports/%d'),
(3, 'Crash/Exception Log', '/^l\\/([0-9]+)$/', '/l/%log_id', 'http://log.sequelpro.com/view/%d'),
(4, 'Source Revision', '/^r\\/([0-9]+)$/', '/r/%revision_num', 'http://code.google.com/p/sequel-pro/source/detail?r=%d'),
(5, 'Source Revisions List', '/^r$/', '/r', 'http://code.google.com/p/sequel-pro/source/list'),
(6, 'Issue', '/^([0-9]+)$/', '/%issue_id', 'http://code.google.com/p/sequel-pro/issues/detail?id=%d'),
(7, 'Issue Comment', '/^([0-9]+)\\/([0-9]+)$/', '/%issue_id/%comment_id', 'http://code.google.com/p/sequel-pro/issues/detail?id=%d#c%d'),
(8, 'Crash/Exception Logs List', '/^l$/', '/l', 'http://log.sequelpro.com/'),
(9, 'Issues List', '/^$/', '/', 'http://code.google.com/p/sequel-pro/issues/list');
/*!40000 ALTER TABLE `redirect_urls` ENABLE KEYS */;
UNLOCK TABLES;