schema.sql
author Ed Morley <emorley@mozilla.com>
Sun, 29 Mar 2015 20:48:49 +0400
changeset 1517 44054a6338ae01fad01993503a3da94257049d38
parent 927 cf6d5636562d2abaaf979a6016aba500ceb9e914
permissions -rw-r--r--
Bug 1148915 - Make htaccess comment clearer

--
-- Table structure for table `builders`
--

CREATE TABLE IF NOT EXISTS `builders` (
  `id` integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `branch` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `buildername` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `hidden` boolean NOT NULL DEFAULT FALSE,
  UNIQUE INDEX `builders_name_idx` (`name`),
  INDEX `builders_buildername_idx` (`buildername`(255)),
  INDEX `buildername` (`buildername`(255)),
  INDEX `builders_hidden_idx` (`hidden`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `builders_history`
--

CREATE TABLE IF NOT EXISTS `builders_history` (
  `id` integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `builder_id` integer NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `action` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `who` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `reason` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ip` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  INDEX `builders_history_date_idx` (`builder_id`),
  CONSTRAINT `builders_history_ibfk_1` FOREIGN KEY (`builder_id`) REFERENCES `builders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `runs`
--

CREATE TABLE IF NOT EXISTS `runs` (
  `id` integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `buildbot_id` integer NOT NULL,
  `buildername` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `slave` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `revision` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `starttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `endtime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `result` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `branch` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `log` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  UNIQUE INDEX `runs_buildbot_id_idx` (`buildbot_id`),
  INDEX `runs_buildername_idx` (`buildername`(255)),
  INDEX `runs_endtime_idx` (`endtime`),
  INDEX `runs_revision_branch_idx` (`revision`, `branch`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `runs_notes`
--

CREATE TABLE IF NOT EXISTS `runs_notes` (
  `id` integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `run_id` integer NOT NULL,
  `who` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `note` text COLLATE utf8_unicode_ci NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ip` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  INDEX `runs_notes_run_id_idx` (`run_id`, `timestamp`),
  CONSTRAINT `runs_notes_ibfk_1` FOREIGN KEY (`run_id`) REFERENCES `runs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `runs_logs`
--

CREATE TABLE IF NOT EXISTS `runs_logs` (
  `id` integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `buildbot_id` integer NOT NULL,
  `type` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `content` longblob,
  UNIQUE INDEX `runs_logs_buildbot_id_type_idx` (`buildbot_id`, `type`),
  INDEX `idx_content` (`content`(1)),
  CONSTRAINT `runs_logs_ibfk_1` FOREIGN KEY (`buildbot_id`) REFERENCES `runs` (`buildbot_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `bugscache`
--

CREATE TABLE IF NOT EXISTS `bugscache` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `json` text COLLATE utf8_unicode_ci NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  UNIQUE INDEX `bugscache_filename_idx` (`filename`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;