]> git.ipfire.org Git - people/jschlag/pbs.git/blame - data/schema.sql
Fix typos.
[people/jschlag/pbs.git] / data / schema.sql
CommitLineData
9050c160
MT
1-- phpMyAdmin SQL Dump
2-- version 3.5.4
3-- http://www.phpmyadmin.net
4--
5-- Host: localhost
189ba95b
MT
6-- Generation Time: Feb 17, 2013 at 03:01 PM
7-- Server version: 5.1.67-log
9050c160
MT
8-- PHP Version: 5.3.3
9
10SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11SET time_zone = "+00:00";
12
13
14/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17/*!40101 SET NAMES utf8 */;
18
19--
20-- Database: `pakfire`
21--
22
23-- --------------------------------------------------------
24
25--
26-- Table structure for table `arches`
27--
28
29CREATE TABLE IF NOT EXISTS `arches` (
30 `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
31 `name` varchar(32) NOT NULL,
32 `prio` int(11) NOT NULL DEFAULT '0',
33 `binary` enum('Y','N') NOT NULL DEFAULT 'Y',
34 PRIMARY KEY (`id`)
189ba95b 35) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
36
37-- --------------------------------------------------------
38
39--
40-- Table structure for table `builders`
41--
42
43CREATE TABLE IF NOT EXISTS `builders` (
44 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
45 `name` varchar(255) NOT NULL,
46 `passphrase` varchar(255) DEFAULT NULL,
47 `description` text,
48 `status` enum('enabled','disabled','deleted') NOT NULL DEFAULT 'disabled',
49 `disabled` enum('Y','N') NOT NULL DEFAULT 'Y',
50 `loadavg` varchar(32) NOT NULL DEFAULT '0',
51 `arches` varchar(128) DEFAULT NULL,
52 `build_release` enum('Y','N') NOT NULL DEFAULT 'N',
53 `build_scratch` enum('Y','N') NOT NULL DEFAULT 'N',
54 `build_test` enum('Y','N') NOT NULL DEFAULT 'N',
55 `max_jobs` int(11) NOT NULL DEFAULT '1',
56 `pakfire_version` varchar(32) DEFAULT NULL,
57 `cpu_model` varchar(255) DEFAULT NULL,
58 `cpu_count` tinyint(4) NOT NULL DEFAULT '1',
59 `memory` bigint(20) unsigned NOT NULL DEFAULT '0',
60 `overload` enum('Y','N') NOT NULL DEFAULT 'N',
61 `free_space` int(11) NOT NULL DEFAULT '0',
62 `host_key_id` varchar(64) DEFAULT NULL,
63 `deleted` enum('Y','N') NOT NULL DEFAULT 'N',
64 `time_created` datetime NOT NULL,
65 `time_updated` datetime DEFAULT NULL,
66 `time_keepalive` datetime DEFAULT NULL,
67 PRIMARY KEY (`id`)
189ba95b 68) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
69
70-- --------------------------------------------------------
71
72--
73-- Table structure for table `builders_arches`
74--
75
76CREATE TABLE IF NOT EXISTS `builders_arches` (
77 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
78 `builder_id` int(11) unsigned NOT NULL,
79 `arch_id` int(11) unsigned NOT NULL,
80 `enabled` enum('Y','N') NOT NULL DEFAULT 'Y',
81 PRIMARY KEY (`id`)
189ba95b 82) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
83
84-- --------------------------------------------------------
85
86--
87-- Table structure for table `builders_history`
88--
89
90CREATE TABLE IF NOT EXISTS `builders_history` (
91 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
92 `builder_id` int(10) unsigned NOT NULL,
93 `action` enum('created','enabled','disabled','deleted') NOT NULL,
94 `user_id` int(10) unsigned DEFAULT NULL,
95 `time` datetime NOT NULL,
96 PRIMARY KEY (`id`)
189ba95b 97) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
98
99-- --------------------------------------------------------
100
101--
102-- Table structure for table `builds`
103--
104
105CREATE TABLE IF NOT EXISTS `builds` (
106 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
107 `uuid` varchar(40) NOT NULL,
108 `pkg_id` int(11) unsigned NOT NULL,
109 `type` enum('release','scratch') NOT NULL DEFAULT 'release',
110 `state` enum('building','testing','stable','obsolete','broken') NOT NULL DEFAULT 'building',
111 `severity` enum('security update','bugfix update','enhancement','new package') DEFAULT NULL,
112 `message` text,
113 `time_created` datetime NOT NULL,
114 `update_year` int(11) DEFAULT NULL,
115 `update_num` int(11) DEFAULT NULL,
116 `depends_on` int(11) unsigned DEFAULT NULL,
117 `distro_id` int(11) NOT NULL,
118 `owner_id` int(11) unsigned DEFAULT NULL,
119 `public` enum('Y','N') NOT NULL DEFAULT 'Y',
120 `priority` int(11) NOT NULL DEFAULT '0',
121 `auto_move` enum('N','Y') NOT NULL DEFAULT 'N',
122 PRIMARY KEY (`id`),
123 UNIQUE KEY `uuid` (`uuid`)
189ba95b 124) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
125
126-- --------------------------------------------------------
127
128--
129-- Table structure for table `builds_bugs`
130--
131
132CREATE TABLE IF NOT EXISTS `builds_bugs` (
133 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
134 `build_id` int(10) unsigned NOT NULL,
135 `bug_id` int(10) unsigned NOT NULL,
136 PRIMARY KEY (`id`),
137 UNIQUE KEY `build_id` (`build_id`,`bug_id`)
189ba95b 138) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
139
140-- --------------------------------------------------------
141
142--
143-- Table structure for table `builds_bugs_updates`
144--
145
146CREATE TABLE IF NOT EXISTS `builds_bugs_updates` (
147 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
148 `bug_id` int(10) unsigned NOT NULL,
149 `status` varchar(32) DEFAULT NULL,
150 `resolution` varchar(32) DEFAULT NULL,
151 `comment` text,
152 `time` datetime NOT NULL,
153 `error` enum('N','Y') NOT NULL DEFAULT 'N',
154 `error_msg` text,
155 PRIMARY KEY (`id`)
189ba95b 156) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
157
158-- --------------------------------------------------------
159
160--
161-- Table structure for table `builds_comments`
162--
163
164CREATE TABLE IF NOT EXISTS `builds_comments` (
165 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
166 `build_id` int(10) unsigned NOT NULL,
167 `user_id` int(10) unsigned NOT NULL,
168 `text` text NOT NULL,
169 `credit` tinyint(4) NOT NULL,
170 `time_created` datetime NOT NULL,
171 `time_updated` datetime DEFAULT NULL,
172 PRIMARY KEY (`id`)
189ba95b 173) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
174
175-- --------------------------------------------------------
176
177--
178-- Table structure for table `builds_history`
179--
180
181CREATE TABLE IF NOT EXISTS `builds_history` (
182 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
183 `build_id` int(10) unsigned NOT NULL,
184 `action` enum('created','bug_added','bug_removed') NOT NULL,
185 `user_id` int(10) unsigned DEFAULT NULL,
186 `time` datetime NOT NULL,
187 `bug_id` int(10) unsigned DEFAULT NULL,
188 PRIMARY KEY (`id`)
189ba95b 189) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
190
191-- --------------------------------------------------------
192
189ba95b
MT
193--
194-- Stand-in structure for view `builds_latest`
195--
196CREATE TABLE IF NOT EXISTS `builds_latest` (
197`build_id` int(10) unsigned
198,`build_type` enum('release','scratch')
199,`build_state` enum('building','testing','stable','obsolete','broken')
200,`package_name` varchar(128)
201,`public` enum('Y','N')
202);
203-- --------------------------------------------------------
204
205--
206-- Stand-in structure for view `builds_times`
207--
208CREATE TABLE IF NOT EXISTS `builds_times` (
209`build_id` int(10) unsigned
210,`arch` varchar(32)
211,`job_type` enum('build','test')
212,`duration` bigint(11)
213);
214-- --------------------------------------------------------
215
9050c160
MT
216--
217-- Table structure for table `builds_watchers`
218--
219
220CREATE TABLE IF NOT EXISTS `builds_watchers` (
221 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
222 `build_id` int(10) unsigned NOT NULL,
223 `user_id` int(10) unsigned NOT NULL,
224 PRIMARY KEY (`id`)
189ba95b 225) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
226
227-- --------------------------------------------------------
228
229--
230-- Table structure for table `distributions`
231--
232
233CREATE TABLE IF NOT EXISTS `distributions` (
234 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
235 `name` varchar(64) NOT NULL,
236 `sname` varchar(64) NOT NULL,
237 `slogan` varchar(255) NOT NULL,
238 `description` text,
239 `vendor` varchar(64) NOT NULL,
240 `contact` varchar(128) DEFAULT NULL,
241 `tag` varchar(4) NOT NULL,
242 PRIMARY KEY (`id`)
189ba95b 243) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
244
245-- --------------------------------------------------------
246
247--
248-- Table structure for table `distro_arches`
249--
250
251CREATE TABLE IF NOT EXISTS `distro_arches` (
252 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
253 `distro_id` int(10) unsigned NOT NULL,
254 `arch_id` int(10) unsigned NOT NULL,
255 PRIMARY KEY (`id`)
189ba95b 256) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
257
258-- --------------------------------------------------------
259
260--
261-- Table structure for table `filelists`
262--
263
264CREATE TABLE IF NOT EXISTS `filelists` (
265 `pkg_id` int(10) unsigned NOT NULL,
266 `name` varchar(1024) NOT NULL,
267 `size` int(11) NOT NULL,
268 `hash_sha512` varchar(140) DEFAULT NULL,
269 `type` tinyint(4) NOT NULL,
270 `config` enum('Y','N') NOT NULL,
271 `mode` int(11) NOT NULL,
272 `user` varchar(32) NOT NULL,
273 `group` varchar(32) NOT NULL,
274 `mtime` datetime NOT NULL,
275 `capabilities` varchar(64) DEFAULT NULL,
276 KEY `pkg_id` (`pkg_id`),
189ba95b 277 KEY `name` (`name`(8))
9050c160
MT
278) ENGINE=InnoDB DEFAULT CHARSET=utf8;
279
280-- --------------------------------------------------------
281
282--
283-- Table structure for table `jobs`
284--
285
286CREATE TABLE IF NOT EXISTS `jobs` (
287 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
288 `uuid` varchar(40) NOT NULL,
289 `type` enum('build','test') NOT NULL DEFAULT 'build',
290 `build_id` int(11) unsigned NOT NULL,
291 `state` enum('new','pending','running','finished','dispatching','uploading','failed','aborted','temporary_failed','dependency_error','aborted','download_error','deleted') NOT NULL DEFAULT 'new',
292 `arch_id` int(11) unsigned NOT NULL,
293 `time_created` datetime NOT NULL,
294 `time_started` datetime DEFAULT NULL,
295 `time_finished` datetime DEFAULT NULL,
296 `start_not_before` datetime DEFAULT NULL,
297 `builder_id` int(11) unsigned DEFAULT NULL,
298 `tries` int(11) unsigned NOT NULL DEFAULT '0',
299 `aborted_state` smallint(6) NOT NULL DEFAULT '0',
300 `message` text,
301 PRIMARY KEY (`id`),
302 UNIQUE KEY `uuid` (`uuid`)
189ba95b 303) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
304
305-- --------------------------------------------------------
306
307--
308-- Table structure for table `jobs_buildroots`
309--
310
311CREATE TABLE IF NOT EXISTS `jobs_buildroots` (
312 `job_id` int(10) unsigned NOT NULL,
313 `tries` tinyint(3) unsigned NOT NULL,
314 `pkg_uuid` varchar(40) NOT NULL,
315 `pkg_name` varchar(1024) NOT NULL,
316 KEY `job_id` (`job_id`),
317 KEY `pkg_uuid` (`pkg_uuid`)
318) ENGINE=InnoDB DEFAULT CHARSET=utf8;
319
320-- --------------------------------------------------------
321
322--
323-- Table structure for table `jobs_history`
324--
325
326CREATE TABLE IF NOT EXISTS `jobs_history` (
327 `job_id` int(10) unsigned NOT NULL,
328 `action` enum('created','state_change','reset','schedule_rebuild','schedule_test_job') NOT NULL,
329 `state` enum('new','pending','running','finished','dispatching','uploading','failed','temporary_failed','dependency_error','aborted','download_error','deleted') DEFAULT NULL,
330 `user_id` int(10) unsigned DEFAULT NULL,
331 `time` datetime NOT NULL,
332 `builder_id` int(11) DEFAULT NULL,
333 `test_job_id` int(11) DEFAULT NULL
334) ENGINE=InnoDB DEFAULT CHARSET=utf8;
335
336-- --------------------------------------------------------
337
338--
339-- Table structure for table `jobs_packages`
340--
341
342CREATE TABLE IF NOT EXISTS `jobs_packages` (
343 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
344 `job_id` int(10) unsigned NOT NULL,
345 `pkg_id` int(10) unsigned NOT NULL,
346 PRIMARY KEY (`id`)
189ba95b 347) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
348
349-- --------------------------------------------------------
350
351--
352-- Table structure for table `jobs_repos`
353--
354
355CREATE TABLE IF NOT EXISTS `jobs_repos` (
356 `job_id` int(10) unsigned NOT NULL,
357 `repo_id` int(10) unsigned NOT NULL,
358 UNIQUE KEY `job_id` (`job_id`,`repo_id`)
359) ENGINE=InnoDB DEFAULT CHARSET=utf8;
360
361-- --------------------------------------------------------
362
363--
364-- Table structure for table `keys`
365--
366
367CREATE TABLE IF NOT EXISTS `keys` (
368 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
369 `fingerprint` varchar(64) NOT NULL,
370 `uids` varchar(255) NOT NULL,
371 `data` text NOT NULL,
372 PRIMARY KEY (`id`),
373 UNIQUE KEY `fingerprint` (`fingerprint`)
189ba95b 374) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
375
376-- --------------------------------------------------------
377
378--
379-- Table structure for table `keys_subkeys`
380--
381
382CREATE TABLE IF NOT EXISTS `keys_subkeys` (
383 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
384 `key_id` int(10) unsigned NOT NULL,
385 `fingerprint` varchar(64) NOT NULL,
386 `time_created` datetime NOT NULL,
387 `time_expires` datetime DEFAULT NULL,
388 `algo` varchar(16) DEFAULT NULL,
389 PRIMARY KEY (`id`)
189ba95b 390) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
391
392-- --------------------------------------------------------
393
394--
395-- Table structure for table `logfiles`
396--
397
398CREATE TABLE IF NOT EXISTS `logfiles` (
399 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
400 `job_id` int(10) unsigned NOT NULL,
401 `path` varchar(255) NOT NULL,
402 `filesize` int(10) unsigned NOT NULL,
403 `hash_sha512` varchar(140) NOT NULL,
404 PRIMARY KEY (`id`)
189ba95b 405) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
406
407-- --------------------------------------------------------
408
409--
410-- Table structure for table `mirrors`
411--
412
413CREATE TABLE IF NOT EXISTS `mirrors` (
414 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
415 `hostname` varchar(128) NOT NULL,
416 `path` varchar(128) NOT NULL,
417 `owner` varchar(128) DEFAULT NULL,
418 `contact` varchar(128) DEFAULT NULL,
419 `status` enum('enabled','disabled','deleted') NOT NULL DEFAULT 'disabled',
420 `check_status` enum('UNKNOWN','UP','DOWN') NOT NULL DEFAULT 'UNKNOWN',
421 `last_check` datetime DEFAULT NULL,
422 PRIMARY KEY (`id`)
189ba95b 423) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
424
425-- --------------------------------------------------------
426
427--
428-- Table structure for table `mirrors_history`
429--
430
431CREATE TABLE IF NOT EXISTS `mirrors_history` (
432 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
433 `mirror_id` int(10) unsigned NOT NULL,
434 `action` enum('created','enabled','disabled','deleted') NOT NULL,
435 `user_id` int(10) unsigned DEFAULT NULL,
436 `time` datetime NOT NULL,
437 PRIMARY KEY (`id`)
189ba95b 438) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
439
440-- --------------------------------------------------------
441
442--
443-- Table structure for table `packages`
444--
445
446CREATE TABLE IF NOT EXISTS `packages` (
447 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
448 `name` varchar(128) NOT NULL,
449 `epoch` int(11) unsigned NOT NULL,
450 `version` varchar(128) NOT NULL,
451 `release` varchar(32) NOT NULL,
452 `type` enum('source','binary') NOT NULL,
453 `arch` tinyint(3) unsigned NOT NULL,
454 `groups` varchar(1024) NOT NULL,
455 `maintainer` varchar(128) NOT NULL,
456 `license` varchar(128) NOT NULL,
457 `url` varchar(1024) NOT NULL,
458 `summary` text NOT NULL,
459 `description` text NOT NULL,
460 `size` int(10) unsigned NOT NULL,
461 `supported_arches` varchar(64) DEFAULT NULL,
462 `uuid` varchar(40) NOT NULL,
463 `commit_id` int(10) unsigned DEFAULT NULL,
464 `build_id` varchar(40) NOT NULL,
465 `build_host` varchar(128) NOT NULL,
466 `build_time` datetime NOT NULL,
467 `path` varchar(255) NOT NULL,
468 `filesize` int(10) unsigned NOT NULL,
469 `hash_sha512` varchar(140) NOT NULL,
470 PRIMARY KEY (`id`),
471 KEY `uuid` (`uuid`),
472 FULLTEXT KEY `search` (`name`,`summary`,`description`)
189ba95b 473) ENGINE=MyISAM DEFAULT CHARSET=utf8;
9050c160
MT
474
475-- --------------------------------------------------------
476
477--
478-- Table structure for table `packages_deps`
479--
480
481CREATE TABLE IF NOT EXISTS `packages_deps` (
482 `pkg_id` int(10) unsigned NOT NULL,
483 `type` enum('requires','prerequires','provides','conflicts','obsoletes','suggests','recommends') NOT NULL,
484 `what` varchar(1024) NOT NULL,
485 KEY `pkg_id` (`pkg_id`)
486) ENGINE=InnoDB DEFAULT CHARSET=utf8;
487
488-- --------------------------------------------------------
489
490--
491-- Table structure for table `packages_properties`
492--
493
494CREATE TABLE IF NOT EXISTS `packages_properties` (
495 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
496 `name` varchar(128) NOT NULL,
497 `critical_path` enum('N','Y') NOT NULL DEFAULT 'N',
498 `priority` tinyint(4) NOT NULL DEFAULT '0',
499 PRIMARY KEY (`id`),
500 UNIQUE KEY `name` (`name`)
189ba95b 501) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
502
503-- --------------------------------------------------------
504
505--
506-- Table structure for table `queue_delete`
507--
508
509CREATE TABLE IF NOT EXISTS `queue_delete` (
510 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
511 `path` varchar(1024) NOT NULL,
512 PRIMARY KEY (`id`)
189ba95b 513) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
514
515-- --------------------------------------------------------
516
517--
518-- Table structure for table `repositories`
519--
520
521CREATE TABLE IF NOT EXISTS `repositories` (
522 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
523 `name` varchar(64) NOT NULL,
524 `type` enum('testing','unstable','stable') NOT NULL DEFAULT 'testing',
525 `description` text NOT NULL,
526 `distro_id` int(10) unsigned NOT NULL,
527 `parent_id` int(10) unsigned DEFAULT NULL,
528 `key_id` int(10) unsigned DEFAULT NULL,
529 `mirrored` enum('N','Y') NOT NULL DEFAULT 'N',
530 `enabled_for_builds` enum('N','Y') NOT NULL DEFAULT 'N',
531 `score_needed` int(10) unsigned NOT NULL DEFAULT '0',
532 `last_update` datetime DEFAULT NULL,
533 `time_min` int(10) unsigned NOT NULL DEFAULT '0',
534 `time_max` int(10) unsigned NOT NULL DEFAULT '0',
535 `update_started` datetime DEFAULT NULL,
536 `update_ended` datetime DEFAULT NULL,
537 PRIMARY KEY (`id`)
189ba95b 538) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
539
540-- --------------------------------------------------------
541
542--
543-- Table structure for table `repositories_aux`
544--
545
546CREATE TABLE IF NOT EXISTS `repositories_aux` (
547 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
548 `name` varchar(32) NOT NULL,
549 `description` text,
550 `url` varchar(128) NOT NULL,
551 `distro_id` int(10) unsigned NOT NULL,
552 `status` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
553 PRIMARY KEY (`id`)
189ba95b 554) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
555
556-- --------------------------------------------------------
557
558--
559-- Table structure for table `repositories_builds`
560--
561
562CREATE TABLE IF NOT EXISTS `repositories_builds` (
563 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
564 `repo_id` int(10) unsigned NOT NULL,
565 `build_id` int(10) unsigned NOT NULL,
566 `time_added` datetime NOT NULL,
567 PRIMARY KEY (`id`),
568 UNIQUE KEY `build_id` (`build_id`)
189ba95b 569) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
570
571-- --------------------------------------------------------
572
573--
574-- Table structure for table `repositories_history`
575--
576
577CREATE TABLE IF NOT EXISTS `repositories_history` (
578 `build_id` int(10) unsigned NOT NULL,
579 `action` enum('added','removed','moved') NOT NULL,
580 `from_repo_id` int(10) unsigned DEFAULT NULL,
581 `to_repo_id` int(10) unsigned DEFAULT NULL,
582 `user_id` int(10) unsigned DEFAULT NULL,
583 `time` datetime NOT NULL,
584 KEY `build_id` (`build_id`)
585) ENGINE=InnoDB DEFAULT CHARSET=utf8;
586
587-- --------------------------------------------------------
588
589--
590-- Table structure for table `sessions`
591--
592
593CREATE TABLE IF NOT EXISTS `sessions` (
594 `session_id` varchar(64) NOT NULL,
595 `user_id` int(11) NOT NULL,
596 `impersonated_user_id` int(10) unsigned DEFAULT NULL,
597 `creation_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
598 `valid_until` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
599 `from_address` varchar(255) DEFAULT NULL,
600 UNIQUE KEY `session_id` (`session_id`)
601) ENGINE=InnoDB DEFAULT CHARSET=utf8;
602
603-- --------------------------------------------------------
604
605--
606-- Table structure for table `settings`
607--
608
609CREATE TABLE IF NOT EXISTS `settings` (
610 `k` varchar(255) NOT NULL,
611 `v` varchar(1024) NOT NULL,
612 UNIQUE KEY `k` (`k`)
613) ENGINE=InnoDB DEFAULT CHARSET=utf8;
614
615-- --------------------------------------------------------
616
617--
618-- Table structure for table `slogans`
619--
620
621CREATE TABLE IF NOT EXISTS `slogans` (
622 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
623 `message` varchar(64) NOT NULL,
624 PRIMARY KEY (`id`)
189ba95b 625) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
626
627-- --------------------------------------------------------
628
629--
630-- Table structure for table `sources`
631--
632
633CREATE TABLE IF NOT EXISTS `sources` (
634 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
635 `name` varchar(128) NOT NULL,
636 `identifier` varchar(128) NOT NULL,
637 `url` varchar(1024) NOT NULL,
638 `gitweb` varchar(255) DEFAULT NULL,
639 `revision` varchar(40) NOT NULL,
640 `branch` varchar(32) NOT NULL,
641 `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
642 `distro_id` int(11) NOT NULL,
643 PRIMARY KEY (`id`),
644 UNIQUE KEY `identifier` (`identifier`)
189ba95b 645) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
646
647-- --------------------------------------------------------
648
649--
650-- Table structure for table `sources_commits`
651--
652
653CREATE TABLE IF NOT EXISTS `sources_commits` (
654 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
655 `source_id` int(10) unsigned NOT NULL,
656 `revision` varchar(40) NOT NULL,
657 `author` varchar(1024) NOT NULL,
658 `committer` varchar(1024) NOT NULL,
659 `subject` varchar(1024) NOT NULL,
660 `body` text NOT NULL,
661 `date` datetime NOT NULL,
662 `state` enum('pending','running','finished','failed') NOT NULL DEFAULT 'pending',
663 PRIMARY KEY (`id`),
664 KEY `revision` (`revision`)
189ba95b 665) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
666
667-- --------------------------------------------------------
668
669--
670-- Table structure for table `uploads`
671--
672
673CREATE TABLE IF NOT EXISTS `uploads` (
674 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
675 `uuid` varchar(40) NOT NULL,
676 `user_id` int(10) unsigned DEFAULT NULL,
677 `builder_id` int(11) unsigned DEFAULT NULL,
678 `filename` varchar(1024) NOT NULL,
679 `hash` varchar(40) NOT NULL,
680 `size` int(11) NOT NULL,
681 `progress` int(11) NOT NULL DEFAULT '0',
682 `finished` enum('N','Y') NOT NULL DEFAULT 'N',
683 `time_started` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
684 `time_finished` datetime DEFAULT NULL,
685 PRIMARY KEY (`id`),
686 UNIQUE KEY `uuid` (`uuid`)
189ba95b 687) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
688
689-- --------------------------------------------------------
690
691--
692-- Table structure for table `users`
693--
694
695CREATE TABLE IF NOT EXISTS `users` (
696 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
697 `name` varchar(32) NOT NULL,
698 `realname` varchar(255) DEFAULT NULL,
699 `passphrase` varchar(153) NOT NULL,
700 `state` enum('user','tester','admin') NOT NULL,
701 `locale` varchar(8) DEFAULT NULL,
702 `timezone` varchar(64) DEFAULT NULL,
703 `activated` enum('Y','N') NOT NULL DEFAULT 'N',
704 `activation_code` varchar(20) DEFAULT NULL,
705 `deleted` enum('Y','N') NOT NULL DEFAULT 'N',
706 `registered` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
707 PRIMARY KEY (`id`),
708 UNIQUE KEY `name` (`name`),
709 FULLTEXT KEY `search` (`name`,`realname`)
189ba95b 710) ENGINE=MyISAM DEFAULT CHARSET=utf8;
9050c160
MT
711
712-- --------------------------------------------------------
713
714--
715-- Table structure for table `users_emails`
716--
717
718CREATE TABLE IF NOT EXISTS `users_emails` (
719 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
720 `user_id` int(10) unsigned NOT NULL,
721 `email` varchar(128) NOT NULL,
722 `primary` enum('N','Y') NOT NULL DEFAULT 'N',
723 PRIMARY KEY (`id`),
724 UNIQUE KEY `email` (`email`),
725 KEY `user_id` (`user_id`)
189ba95b 726) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
727
728-- --------------------------------------------------------
729
730--
731-- Table structure for table `users_permissions`
732--
733
734CREATE TABLE IF NOT EXISTS `users_permissions` (
735 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
736 `user_id` int(10) unsigned NOT NULL,
737 `create_scratch_builds` enum('Y','N') NOT NULL DEFAULT 'N',
738 `maintain_builders` enum('N','Y') NOT NULL DEFAULT 'N',
739 `manage_critical_path` enum('N','Y') NOT NULL DEFAULT 'N',
740 `manage_mirrors` enum('N','Y') NOT NULL DEFAULT 'N',
741 `vote` enum('N','Y') NOT NULL DEFAULT 'N',
742 PRIMARY KEY (`id`)
189ba95b 743) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9050c160
MT
744
745-- --------------------------------------------------------
746
747--
748-- Table structure for table `user_messages`
749--
750
751CREATE TABLE IF NOT EXISTS `user_messages` (
752 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
753 `frm` varchar(255) NOT NULL,
754 `to` varchar(2048) NOT NULL,
755 `subject` varchar(1024) NOT NULL,
756 `text` text NOT NULL,
757 `time_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
758 PRIMARY KEY (`id`)
189ba95b
MT
759) ENGINE=InnoDB DEFAULT CHARSET=utf8;
760
761-- --------------------------------------------------------
762
763--
764-- Structure for view `builds_latest`
765--
766DROP TABLE IF EXISTS `builds_latest`;
767
768CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `builds_latest` AS select `builds`.`id` AS `build_id`,`builds`.`type` AS `build_type`,`builds`.`state` AS `build_state`,`packages`.`name` AS `package_name`,`builds`.`public` AS `public` from (`builds` left join `packages` on((`builds`.`pkg_id` = `packages`.`id`))) where (`builds`.`id` in (select `repositories_builds`.`build_id` from `repositories_builds`) or ((`builds`.`time_created` >= (select `builds`.`time_created` from ((`builds` left join `repositories_builds` on((`builds`.`id` = `repositories_builds`.`build_id`))) left join `packages` `p` on((`builds`.`pkg_id` = `p`.`id`))) where (`p`.`name` = `packages`.`name`) order by `builds`.`time_created` limit 1)) and (`builds`.`state` not in ('obsolete','broken'))));
769
770-- --------------------------------------------------------
771
772--
773-- Structure for view `builds_times`
774--
775DROP TABLE IF EXISTS `builds_times`;
776
777CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `builds_times` AS select `builds`.`id` AS `build_id`,`arches`.`name` AS `arch`,`jobs`.`type` AS `job_type`,(unix_timestamp(`jobs`.`time_finished`) - unix_timestamp(`jobs`.`time_started`)) AS `duration` from (((`jobs` left join `builds` on((`jobs`.`build_id` = `builds`.`id`))) left join `packages` on((`builds`.`pkg_id` = `packages`.`id`))) left join `arches` on((`jobs`.`arch_id` = `arches`.`id`))) where (`jobs`.`state` = 'finished');
9050c160
MT
778
779/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
780/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
781/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;