dev.stuconnolly.com / svn / sites

  1. /*
  2.  *  $Id: schema.sql 56 2010-08-28 11:09:52Z stuart $
  3.  *  
  4.  *  spbug.com
  5.  *  Sequel Pro URL Shortening Service
  6.  *
  7.  *  Copyright (c) 2010 Stuart Connolly. All rights reserved.
  8.  *
  9.  *  This program is free software: you can redistribute it and/or modify
  10.  *  it under the terms of the GNU General Public License as published by
  11.  *  the Free Software Foundation, either version 3 of the License, or
  12.  *  (at your option) any later version.
  13.  *
  14.  *  This program is distributed in the hope that it will be useful,
  15.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *  GNU General Public License for more details.
  18.  *
  19.  *  You should have received a copy of the GNU General Public License
  20.  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21.  */
  22.  
  23. CREATE TABLE `redirect_log` (
  24.     `redirect_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  25.     `redirect_url_id` int(11) UNSIGNED NOT NULL,
  26.     `redirect_date` datetime NOT NULL,
  27.     `redirect_request_url` varchar(256) NOT NULL,
  28.     `redirect_url` varchar(100) NOT NULL,
  29.     `redirect_ip` varchar(15) DEFAULT NULL,
  30.     `redirect_agent` varchar(256) DEFAULT NULL,
  31.     PRIMARY KEY (`redirect_id`)
  32. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  33.  
  34. CREATE TABLE `redirect_page_urls` (
  35.     `page_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  36.     `page_name` varchar(32) NOT NULL,
  37.     `page_regex` varchar(32) NOT NULL,
  38.     PRIMARY KEY (`page_id`)
  39. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  40.  
  41. LOCK TABLES `redirect_page_urls` WRITE;
  42. /*!40000 ALTER TABLE `redirect_page_urls` DISABLE KEYS */;
  43.  
  44. INSERT INTO `redirect_page_urls` (`page_id`, `page_name`, `page_regex`)
  45. VALUES
  46.     (1, 'Help', '/^(h)$/'),
  47.     (2, 'Stats', '/^(s)$/');
  48.  
  49. /*!40000 ALTER TABLE `redirect_page_urls` ENABLE KEYS */;
  50. UNLOCK TABLES;
  51.  
  52. CREATE TABLE `redirect_urls` (
  53.     `url_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  54.     `url_name` varchar(32) NOT NULL,
  55.     `url_regex` varchar(32) NOT NULL,
  56.     `url_regex_example` varchar(64) NOT NULL,
  57.     `url_redirect_url` varchar(100) NOT NULL,
  58.     PRIMARY KEY (`url_id`)
  59. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  60.  
  61. LOCK TABLES `redirect_urls` WRITE;
  62. /*!40000 ALTER TABLE `redirect_urls` DISABLE KEYS */;
  63.  
  64. INSERT INTO `redirect_urls` (`url_id`, `url_name`, `url_regex`, `url_regex_example`, `url_redirect_url`)
  65. VALUES
  66.     (1, 'Crash/Exception Log Report', '/^lr\\/([0-9]+)\\/([0-9]+)$/', '/lr/%log_id/%report_id', 'http://log.sequelpro.com/viewreports/%d/%d'),
  67.     (2, 'Crash/Exception Log Reports', '/^lr\\/([0-9]+)$/', '/lr/%log_id', 'http://log.sequelpro.com/viewreports/%d'),
  68.     (3, 'Crash/Exception Log', '/^l\\/([0-9]+)$/', '/l/%log_id', 'http://log.sequelpro.com/view/%d'),
  69.     (4, 'Source Revision', '/^r\\/([0-9]+)$/', '/r/%revision_num', 'http://code.google.com/p/sequel-pro/source/detail?r=%d'),
  70.     (5, 'Source Revisions List', '/^r$/', '/r', 'http://code.google.com/p/sequel-pro/source/list'),
  71.     (6, 'Issue', '/^([0-9]+)$/', '/%issue_id', 'http://code.google.com/p/sequel-pro/issues/detail?id=%d'),
  72.     (7, 'Issue Comment', '/^([0-9]+)\\/([0-9]+)$/', '/%issue_id/%comment_id', 'http://code.google.com/p/sequel-pro/issues/detail?id=%d#c%d'),
  73.     (8, 'Crash/Exception Logs List', '/^l$/', '/l', 'http://log.sequelpro.com/'),
  74.     (9, 'Issues List', '/^$/', '/', 'http://code.google.com/p/sequel-pro/issues/list');
  75.    
  76.  
  77. /*!40000 ALTER TABLE `redirect_urls` ENABLE KEYS */;
  78. UNLOCK TABLES;
  79.