public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/zorry:master commit in: gobs/sql/
@ 2013-04-25  0:38 Magnus Granberg
  0 siblings, 0 replies; 6+ messages in thread
From: Magnus Granberg @ 2013-04-25  0:38 UTC (permalink / raw
  To: gentoo-commits

commit:     852a0d017e2a9a13a35109d2a87e2a9aceade78a
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 25 00:36:43 2013 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Thu Apr 25 00:36:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=852a0d01

Update db struture

---
 gobs/sql/zobcs.sql | 1309 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 721 insertions(+), 588 deletions(-)

diff --git a/gobs/sql/zobcs.sql b/gobs/sql/zobcs.sql
index 805c2fa..a87136c 100644
--- a/gobs/sql/zobcs.sql
+++ b/gobs/sql/zobcs.sql
@@ -1,31 +1,32 @@
--- phpMyAdmin SQL Dump
--- version 3.5.2.2
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Generation Time: Dec 27, 2012 at 09:23 PM
--- Server version: 5.5.28-MariaDB-log
--- PHP Version: 5.4.6--pl0-gentoo
-
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-SET time_zone = "+00:00";
-
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-
---
--- Database: `zobcs`
---
-
-DELIMITER $$
---
--- Procedures
---
-CREATE DEFINER=`zobcs`@`localhost` PROCEDURE `add_jobs`(IN `in_type` VARCHAR(20) CHARSET utf8)
-    MODIFIES SQL DATA
+-- phpMyAdmin SQL Dump
+-- version 3.5.2.2
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: Apr 25, 2013 at 12:32 AM
+-- Server version: 5.5.28-MariaDB-log
+-- PHP Version: 5.4.6--pl0-gentoo
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `zobcs`
+--
+
+DELIMITER $$
+--
+-- Procedures
+--
+DROP PROCEDURE IF EXISTS `add_jobs`$$
+CREATE DEFINER=`zobcs`@`localhost` PROCEDURE `add_jobs`(IN `in_type` VARCHAR(20) CHARSET utf8)
+    MODIFIES SQL DATA
 BEGIN
   DECLARE in_config_id INT;
   DECLARE in_job_type_id INT;
@@ -44,566 +45,698 @@ BEGIN
   ELSE
     INSERT INTO jobs (job_type_id, user, config_id, run_config_id) VALUES ( in_job_type_id, 'cron', in_config_id, in_config_id);
   END IF;
-END$$
-
-DELIMITER ;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs` (
-  `build_job_id` int(11) NOT NULL AUTO_INCREMENT,
-  `ebuild_id` int(11) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `status` enum('Waiting','Now') NOT NULL DEFAULT 'Waiting',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`build_job_id`),
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `config_id` (`config_id`),
-  KEY `time_stamp` (`time_stamp`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='The build work list';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_emerge_options` (
-  `build_job_id` int(11) NOT NULL,
-  `eoption_id` int(11) NOT NULL,
-  KEY `build_job_id` (`build_job_id`),
-  KEY `eoption_id` (`eoption_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_redo`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_redo` (
-  `build_job_id` int(11) NOT NULL COMMENT 'build job id',
-  `fail_times` int(1) NOT NULL COMMENT 'Fail times max 5',
-  `fail_type` varchar(30) NOT NULL COMMENT 'Type of fail',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Time',
-  KEY `build_job_id` (`build_job_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Build jobs that need to be redone';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_use`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_use` (
-  `build_job_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `build_job_id` (`build_job_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs` (
-  `build_log_id` int(11) NOT NULL AUTO_INCREMENT,
-  `ebuild_id` int(11) NOT NULL,
-  `fail` enum('True','False') NOT NULL DEFAULT 'False',
-  `summery_text` text NOT NULL,
-  `log_hash` varchar(100) NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`build_log_id`),
-  KEY `ebuild_id` (`ebuild_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main log info for the builds';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_config`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_config` (
-  `build_log_id` int(11) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `logname` varchar(150) NOT NULL COMMENT 'filename of the log',
-  KEY `config_id` (`config_id`),
-  KEY `build_log_id` (`build_log_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_emerge_options` (
-  `build_logs_id` int(11) NOT NULL,
-  `eoption_id` int(11) NOT NULL,
-  KEY `eoption_id` (`eoption_id`),
-  KEY `build_logs_id` (`build_logs_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_qa`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_qa` (
-  `build_log_id` int(11) NOT NULL,
-  `summery_text` text NOT NULL,
-  KEY `build_log_id` (`build_log_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_repoman`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_repoman` (
-  `build_logs_id` int(11) NOT NULL,
-  `summery_text` text NOT NULL,
-  KEY `build_logs_id` (`build_logs_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_use`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_use` (
-  `build_log_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `build_log_id` (`build_log_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `categories`
---
-
-CREATE TABLE IF NOT EXISTS `categories` (
-  `category_id` int(11) NOT NULL AUTO_INCREMENT,
-  `category` varchar(50) NOT NULL,
-  `active` enum('True','False') NOT NULL DEFAULT 'True',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`category_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Categories main table (C)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs`
---
-
-CREATE TABLE IF NOT EXISTS `configs` (
-  `config_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Config index',
-  `hostname` varchar(50) NOT NULL,
-  `config` varchar(100) NOT NULL COMMENT 'Box/setup',
-  `default_config` enum('True','False') NOT NULL COMMENT 'Host setup',
-  PRIMARY KEY (`config_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main config table';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `configs_emerge_options` (
-  `config_id` int(11) NOT NULL COMMENT 'config id',
-  `eoption_id` int(11) NOT NULL COMMENT 'emerge option id',
-  KEY `config_id` (`config_id`),
-  KEY `eoption_id` (`eoption_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Emerge command options for the configs';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs_metadata`
---
-
-CREATE TABLE IF NOT EXISTS `configs_metadata` (
-  `config_id` int(11) NOT NULL,
-  `profile` varchar(50) NOT NULL,
-  `keyword_id` int(11) NOT NULL,
-  `make_conf_text` text NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL,
-  `config_error_text` text NOT NULL,
-  `updating` enum('True','False') NOT NULL,
-  `status` enum('Waiting','Runing','Stoped') NOT NULL,
-  `auto` enum('True','False') NOT NULL,
-  `git_www` varchar(100) NOT NULL COMMENT 'git repo www wiev address',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`config_id`),
-  KEY `keyword_id` (`keyword_id`),
-  KEY `config_id` (`config_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Config Status';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds` (
-  `ebuild_id` int(11) NOT NULL AUTO_INCREMENT,
-  `package_id` int(11) NOT NULL,
-  `version` varchar(50) NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL DEFAULT 'True',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`ebuild_id`),
-  KEY `package_id` (`package_id`),
-  KEY `checksum` (`checksum`),
-  KEY `version` (`version`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Version main table (V)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_iuse`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_iuse` (
-  `ebuild_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_keywords`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_keywords` (
-  `ebuild_id` int(11) NOT NULL,
-  `keyword_id` int(11) NOT NULL,
-  `status` enum('Stable','Unstable','Negative') NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `keyword_id` (`keyword_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_metadata`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_metadata` (
-  `ebuild_id` int(11) NOT NULL,
-  `revision` varchar(10) NOT NULL COMMENT 'CVS revision',
-  KEY `ebuild_id` (`ebuild_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_restrictions`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_restrictions` (
-  `ebuild_id` int(11) NOT NULL,
-  `restriction_id` int(11) NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `restriction_id` (`restriction_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `emerge_options` (
-  `eoption_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'emerge command options id',
-  `eoption` varchar(15) NOT NULL COMMENT 'emerge command options',
-  PRIMARY KEY (`eoption_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jobs`
---
-
-CREATE TABLE IF NOT EXISTS `jobs` (
-  `job_id` int(11) NOT NULL AUTO_INCREMENT,
-  `job_type_id` int(11) NOT NULL,
-  `status` enum('Runing','Done','Waiting') NOT NULL DEFAULT 'Waiting',
-  `user` varchar(20) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `run_config_id` int(11) NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`job_id`),
-  KEY `config_id` (`config_id`),
-  KEY `run_config_id` (`run_config_id`),
-  KEY `job_type_id` (`job_type_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `job_types`
---
-
-CREATE TABLE IF NOT EXISTS `job_types` (
-  `job_type_id` int(11) NOT NULL AUTO_INCREMENT,
-  `type` varchar(20) NOT NULL,
-  PRIMARY KEY (`job_type_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Table for what type of work';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `keywords`
---
-
-CREATE TABLE IF NOT EXISTS `keywords` (
-  `keyword_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'keyword index',
-  `keyword` varchar(15) NOT NULL COMMENT 'keyword',
-  PRIMARY KEY (`keyword_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='KEYWORD';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `logs`
---
-
-CREATE TABLE IF NOT EXISTS `logs` (
-  `log_id` int(11) NOT NULL AUTO_INCREMENT,
-  `config_id` int(11) NOT NULL,
-  `log_type` enum('info','error','debug') NOT NULL,
-  `msg` text NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`log_id`),
-  KEY `config_id` (`config_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `packages`
---
-
-CREATE TABLE IF NOT EXISTS `packages` (
-  `package_id` int(11) NOT NULL AUTO_INCREMENT,
-  `category_id` int(11) NOT NULL,
-  `package` varchar(50) NOT NULL,
-  `repo_id` int(11) NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`package_id`),
-  KEY `category_id` (`category_id`),
-  KEY `repo_id` (`repo_id`),
-  KEY `checksum` (`checksum`),
-  KEY `package` (`package`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Packages main table (P)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `repos`
---
-
-CREATE TABLE IF NOT EXISTS `repos` (
-  `repo_id` int(11) NOT NULL AUTO_INCREMENT,
-  `repo` varchar(100) NOT NULL,
-  PRIMARY KEY (`repo_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Repo main table (repo)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `restrictions`
---
-
-CREATE TABLE IF NOT EXISTS `restrictions` (
-  `restriction_id` int(11) NOT NULL AUTO_INCREMENT,
-  `restriction` varchar(50) NOT NULL,
-  PRIMARY KEY (`restriction_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `uses`
---
-
-CREATE TABLE IF NOT EXISTS `uses` (
-  `use_id` int(11) NOT NULL AUTO_INCREMENT,
-  `flag` varchar(50) NOT NULL,
-  PRIMARY KEY (`use_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Use flags main table';
-
---
--- Constraints for dumped tables
---
-
---
--- Constraints for table `build_jobs`
---
-ALTER TABLE `build_jobs`
-  ADD CONSTRAINT `build_jobs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `build_jobs_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `build_jobs_emerge_options`
---
-ALTER TABLE `build_jobs_emerge_options`
-  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
-  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `build_jobs_redo`
---
-ALTER TABLE `build_jobs_redo`
-  ADD CONSTRAINT `build_jobs_redo_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`);
-
---
--- Constraints for table `build_jobs_use`
---
-ALTER TABLE `build_jobs_use`
-  ADD CONSTRAINT `build_jobs_use_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
-  ADD CONSTRAINT `build_jobs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `build_logs`
---
-ALTER TABLE `build_logs`
-  ADD CONSTRAINT `build_logs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
-
---
--- Constraints for table `build_logs_config`
---
-ALTER TABLE `build_logs_config`
-  ADD CONSTRAINT `build_logs_config_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_config_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `build_logs_emerge_options`
---
-ALTER TABLE `build_logs_emerge_options`
-  ADD CONSTRAINT `build_logs_emerge_options_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `build_logs_qa`
---
-ALTER TABLE `build_logs_qa`
-  ADD CONSTRAINT `build_logs_qa_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`);
-
---
--- Constraints for table `build_logs_repoman`
---
-ALTER TABLE `build_logs_repoman`
-  ADD CONSTRAINT `build_logs_repoman_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`);
-
---
--- Constraints for table `build_logs_use`
---
-ALTER TABLE `build_logs_use`
-  ADD CONSTRAINT `build_logs_use_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `configs_emerge_options`
---
-ALTER TABLE `configs_emerge_options`
-  ADD CONSTRAINT `configs_emerge_options_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `configs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `configs_metadata`
---
-ALTER TABLE `configs_metadata`
-  ADD CONSTRAINT `configs_metadata_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`),
-  ADD CONSTRAINT `configs_metadata_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `ebuilds`
---
-ALTER TABLE `ebuilds`
-  ADD CONSTRAINT `ebuilds_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `packages` (`package_id`);
-
---
--- Constraints for table `ebuilds_iuse`
---
-ALTER TABLE `ebuilds_iuse`
-  ADD CONSTRAINT `ebuilds_iuse_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_iuse_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `ebuilds_keywords`
---
-ALTER TABLE `ebuilds_keywords`
-  ADD CONSTRAINT `ebuilds_keywords_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_keywords_ibfk_2` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`);
-
---
--- Constraints for table `ebuilds_metadata`
---
-ALTER TABLE `ebuilds_metadata`
-  ADD CONSTRAINT `ebuilds_metadata_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
-
---
--- Constraints for table `ebuilds_restrictions`
---
-ALTER TABLE `ebuilds_restrictions`
-  ADD CONSTRAINT `ebuilds_restrictions_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_restrictions_ibfk_2` FOREIGN KEY (`restriction_id`) REFERENCES `restrictions` (`restriction_id`);
-
---
--- Constraints for table `jobs`
---
-ALTER TABLE `jobs`
-  ADD CONSTRAINT `jobs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `jobs_ibfk_2` FOREIGN KEY (`run_config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `jobs_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`job_type_id`);
-
---
--- Constraints for table `logs`
---
-ALTER TABLE `logs`
-  ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `packages`
---
-ALTER TABLE `packages`
-  ADD CONSTRAINT `packages_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`),
-  ADD CONSTRAINT `packages_ibfk_2` FOREIGN KEY (`repo_id`) REFERENCES `repos` (`repo_id`);
-
-DELIMITER $$
---
--- Events
---
+END$$
+
+DELIMITER ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs`
+--
+
+DROP TABLE IF EXISTS `build_jobs`;
+CREATE TABLE IF NOT EXISTS `build_jobs` (
+  `build_job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `ebuild_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `status` enum('Waiting','Now') NOT NULL DEFAULT 'Waiting',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`build_job_id`),
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `config_id` (`config_id`),
+  KEY `time_stamp` (`time_stamp`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='The build work list' AUTO_INCREMENT=23547 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_emerge_options`
+--
+
+DROP TABLE IF EXISTS `build_jobs_emerge_options`;
+CREATE TABLE IF NOT EXISTS `build_jobs_emerge_options` (
+  `build_job_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL,
+  KEY `build_job_id` (`build_job_id`),
+  KEY `eoption_id` (`eoption_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_redo`
+--
+
+DROP TABLE IF EXISTS `build_jobs_redo`;
+CREATE TABLE IF NOT EXISTS `build_jobs_redo` (
+  `build_job_id` int(11) NOT NULL COMMENT 'build job id',
+  `fail_times` int(1) NOT NULL COMMENT 'Fail times max 5',
+  `fail_type` varchar(30) NOT NULL COMMENT 'Type of fail',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Time',
+  KEY `build_job_id` (`build_job_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Build jobs that need to be redone';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_use`
+--
+
+DROP TABLE IF EXISTS `build_jobs_use`;
+CREATE TABLE IF NOT EXISTS `build_jobs_use` (
+  `build_job_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `build_job_id` (`build_job_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs`
+--
+
+DROP TABLE IF EXISTS `build_logs`;
+CREATE TABLE IF NOT EXISTS `build_logs` (
+  `build_log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `ebuild_id` int(11) NOT NULL,
+  `fail` enum('True','False') NOT NULL DEFAULT 'False',
+  `summery_text` text NOT NULL,
+  `log_hash` varchar(100) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`build_log_id`),
+  KEY `ebuild_id` (`ebuild_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main log info for the builds' AUTO_INCREMENT=19591 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_config`
+--
+
+DROP TABLE IF EXISTS `build_logs_config`;
+CREATE TABLE IF NOT EXISTS `build_logs_config` (
+  `log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `build_log_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `logname` varchar(150) NOT NULL COMMENT 'filename of the log',
+  PRIMARY KEY (`log_id`),
+  KEY `config_id` (`config_id`),
+  KEY `build_log_id` (`build_log_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=19636 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_emerge_options`
+--
+
+DROP TABLE IF EXISTS `build_logs_emerge_options`;
+CREATE TABLE IF NOT EXISTS `build_logs_emerge_options` (
+  `build_logs_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL,
+  KEY `eoption_id` (`eoption_id`),
+  KEY `build_logs_id` (`build_logs_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_errors`
+--
+
+DROP TABLE IF EXISTS `build_logs_errors`;
+CREATE TABLE IF NOT EXISTS `build_logs_errors` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `build_log_id` int(11) NOT NULL,
+  `error_id` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `build_log_id` (`build_log_id`),
+  KEY `error_id` (`error_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_hilight`
+--
+
+DROP TABLE IF EXISTS `build_logs_hilight`;
+CREATE TABLE IF NOT EXISTS `build_logs_hilight` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `log_id` int(11) NOT NULL,
+  `start_line` int(11) NOT NULL,
+  `end_line` int(11) NOT NULL,
+  `hilight_css_id` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `log_id` (`log_id`),
+  KEY `hilight_id` (`hilight_css_id`),
+  KEY `hilight_css_id` (`hilight_css_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=110809 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_qa`
+--
+
+DROP TABLE IF EXISTS `build_logs_qa`;
+CREATE TABLE IF NOT EXISTS `build_logs_qa` (
+  `build_log_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL,
+  KEY `build_log_id` (`build_log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_repoman`
+--
+
+DROP TABLE IF EXISTS `build_logs_repoman`;
+CREATE TABLE IF NOT EXISTS `build_logs_repoman` (
+  `build_logs_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL,
+  KEY `build_logs_id` (`build_logs_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_use`
+--
+
+DROP TABLE IF EXISTS `build_logs_use`;
+CREATE TABLE IF NOT EXISTS `build_logs_use` (
+  `build_log_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `build_log_id` (`build_log_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `categories`
+--
+
+DROP TABLE IF EXISTS `categories`;
+CREATE TABLE IF NOT EXISTS `categories` (
+  `category_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category` varchar(50) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`category_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Categories main table (C)' AUTO_INCREMENT=160 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs`
+--
+
+DROP TABLE IF EXISTS `configs`;
+CREATE TABLE IF NOT EXISTS `configs` (
+  `config_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Config index',
+  `hostname` varchar(50) NOT NULL,
+  `config` varchar(100) NOT NULL COMMENT 'Box/setup',
+  `default_config` enum('True','False') NOT NULL COMMENT 'Host setup',
+  PRIMARY KEY (`config_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main config table' AUTO_INCREMENT=3 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_emerge_options`
+--
+
+DROP TABLE IF EXISTS `configs_emerge_options`;
+CREATE TABLE IF NOT EXISTS `configs_emerge_options` (
+  `config_id` int(11) NOT NULL COMMENT 'config id',
+  `eoption_id` int(11) NOT NULL COMMENT 'emerge option id',
+  KEY `config_id` (`config_id`),
+  KEY `eoption_id` (`eoption_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Emerge command options for the configs';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_metadata`
+--
+
+DROP TABLE IF EXISTS `configs_metadata`;
+CREATE TABLE IF NOT EXISTS `configs_metadata` (
+  `config_id` int(11) NOT NULL,
+  `profile` varchar(50) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `make_conf_text` text NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `config_error_text` text NOT NULL,
+  `updating` enum('True','False') NOT NULL,
+  `status` enum('Waiting','Runing','Stoped') NOT NULL,
+  `auto` enum('True','False') NOT NULL,
+  `git_www` varchar(100) NOT NULL COMMENT 'git repo www wiev address',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`config_id`),
+  KEY `keyword_id` (`keyword_id`),
+  KEY `config_id` (`config_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Config Status';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds`
+--
+
+DROP TABLE IF EXISTS `ebuilds`;
+CREATE TABLE IF NOT EXISTS `ebuilds` (
+  `ebuild_id` int(11) NOT NULL AUTO_INCREMENT,
+  `package_id` int(11) NOT NULL,
+  `version` varchar(50) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`ebuild_id`),
+  KEY `package_id` (`package_id`),
+  KEY `checksum` (`checksum`),
+  KEY `version` (`version`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Version main table (V)' AUTO_INCREMENT=69287 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_iuse`
+--
+
+DROP TABLE IF EXISTS `ebuilds_iuse`;
+CREATE TABLE IF NOT EXISTS `ebuilds_iuse` (
+  `ebuild_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_keywords`
+--
+
+DROP TABLE IF EXISTS `ebuilds_keywords`;
+CREATE TABLE IF NOT EXISTS `ebuilds_keywords` (
+  `ebuild_id` int(11) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `status` enum('Stable','Unstable','Negative') NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `keyword_id` (`keyword_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_metadata`
+--
+
+DROP TABLE IF EXISTS `ebuilds_metadata`;
+CREATE TABLE IF NOT EXISTS `ebuilds_metadata` (
+  `ebuild_id` int(11) NOT NULL,
+  `revision` varchar(10) NOT NULL COMMENT 'CVS revision',
+  KEY `ebuild_id` (`ebuild_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_restrictions`
+--
+
+DROP TABLE IF EXISTS `ebuilds_restrictions`;
+CREATE TABLE IF NOT EXISTS `ebuilds_restrictions` (
+  `ebuild_id` int(11) NOT NULL,
+  `restriction_id` int(11) NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `restriction_id` (`restriction_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `emerge_options`
+--
+
+DROP TABLE IF EXISTS `emerge_options`;
+CREATE TABLE IF NOT EXISTS `emerge_options` (
+  `eoption_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'emerge command options id',
+  `eoption` varchar(15) NOT NULL COMMENT 'emerge command options',
+  PRIMARY KEY (`eoption_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `errors`
+--
+
+DROP TABLE IF EXISTS `errors`;
+CREATE TABLE IF NOT EXISTS `errors` (
+  `error_id` int(11) NOT NULL AUTO_INCREMENT,
+  `error_name` varchar(10) NOT NULL,
+  `error_search` varchar(20) NOT NULL,
+  PRIMARY KEY (`error_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `hilight`
+--
+
+DROP TABLE IF EXISTS `hilight`;
+CREATE TABLE IF NOT EXISTS `hilight` (
+  `hilight_id` int(11) NOT NULL AUTO_INCREMENT,
+  `hilight_search` varchar(30) NOT NULL,
+  `hilight_search_end` varchar(30) NOT NULL,
+  `hilight_css_id` int(11) NOT NULL,
+  `hilight_start` int(11) NOT NULL,
+  `hilight_end` int(11) NOT NULL,
+  PRIMARY KEY (`hilight_id`),
+  KEY `hilight_css_id` (`hilight_css_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=31 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `hilight_css`
+--
+
+DROP TABLE IF EXISTS `hilight_css`;
+CREATE TABLE IF NOT EXISTS `hilight_css` (
+  `hilight_css_id` int(11) NOT NULL AUTO_INCREMENT,
+  `hilight_css_name` varchar(11) NOT NULL,
+  `hilight_css_collor` varchar(10) NOT NULL,
+  PRIMARY KEY (`hilight_css_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `jobs`
+--
+
+DROP TABLE IF EXISTS `jobs`;
+CREATE TABLE IF NOT EXISTS `jobs` (
+  `job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `job_type_id` int(11) NOT NULL,
+  `status` enum('Runing','Done','Waiting') NOT NULL DEFAULT 'Waiting',
+  `user` varchar(20) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `run_config_id` int(11) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`job_id`),
+  KEY `config_id` (`config_id`),
+  KEY `run_config_id` (`run_config_id`),
+  KEY `job_type_id` (`job_type_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `job_types`
+--
+
+DROP TABLE IF EXISTS `job_types`;
+CREATE TABLE IF NOT EXISTS `job_types` (
+  `job_type_id` int(11) NOT NULL AUTO_INCREMENT,
+  `type` varchar(20) NOT NULL,
+  PRIMARY KEY (`job_type_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Table for what type of work' AUTO_INCREMENT=3 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `keywords`
+--
+
+DROP TABLE IF EXISTS `keywords`;
+CREATE TABLE IF NOT EXISTS `keywords` (
+  `keyword_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'keyword index',
+  `keyword` varchar(15) NOT NULL COMMENT 'keyword',
+  PRIMARY KEY (`keyword_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='KEYWORD' AUTO_INCREMENT=41 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `logs`
+--
+
+DROP TABLE IF EXISTS `logs`;
+CREATE TABLE IF NOT EXISTS `logs` (
+  `log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `config_id` int(11) NOT NULL,
+  `log_type` enum('info','error','debug') NOT NULL,
+  `msg` text NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`log_id`),
+  KEY `config_id` (`config_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=892335 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `packages`
+--
+
+DROP TABLE IF EXISTS `packages`;
+CREATE TABLE IF NOT EXISTS `packages` (
+  `package_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category_id` int(11) NOT NULL,
+  `package` varchar(50) NOT NULL,
+  `repo_id` int(11) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`package_id`),
+  KEY `category_id` (`category_id`),
+  KEY `repo_id` (`repo_id`),
+  KEY `checksum` (`checksum`),
+  KEY `package` (`package`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Packages main table (P)' AUTO_INCREMENT=16842 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `repos`
+--
+
+DROP TABLE IF EXISTS `repos`;
+CREATE TABLE IF NOT EXISTS `repos` (
+  `repo_id` int(11) NOT NULL AUTO_INCREMENT,
+  `repo` varchar(100) NOT NULL,
+  PRIMARY KEY (`repo_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Repo main table (repo)' AUTO_INCREMENT=3 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `restrictions`
+--
+
+DROP TABLE IF EXISTS `restrictions`;
+CREATE TABLE IF NOT EXISTS `restrictions` (
+  `restriction_id` int(11) NOT NULL AUTO_INCREMENT,
+  `restriction` varchar(50) NOT NULL,
+  PRIMARY KEY (`restriction_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=35 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `uses`
+--
+
+DROP TABLE IF EXISTS `uses`;
+CREATE TABLE IF NOT EXISTS `uses` (
+  `use_id` int(11) NOT NULL AUTO_INCREMENT,
+  `flag` varchar(50) NOT NULL,
+  PRIMARY KEY (`use_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Use flags main table' AUTO_INCREMENT=4875 ;
+
+--
+-- Constraints for dumped tables
+--
+
+--
+-- Constraints for table `build_jobs`
+--
+ALTER TABLE `build_jobs`
+  ADD CONSTRAINT `build_jobs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `build_jobs_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `build_jobs_emerge_options`
+--
+ALTER TABLE `build_jobs_emerge_options`
+  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
+  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `build_jobs_redo`
+--
+ALTER TABLE `build_jobs_redo`
+  ADD CONSTRAINT `build_jobs_redo_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`);
+
+--
+-- Constraints for table `build_jobs_use`
+--
+ALTER TABLE `build_jobs_use`
+  ADD CONSTRAINT `build_jobs_use_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
+  ADD CONSTRAINT `build_jobs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `build_logs`
+--
+ALTER TABLE `build_logs`
+  ADD CONSTRAINT `build_logs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
+
+--
+-- Constraints for table `build_logs_config`
+--
+ALTER TABLE `build_logs_config`
+  ADD CONSTRAINT `build_logs_config_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_config_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `build_logs_emerge_options`
+--
+ALTER TABLE `build_logs_emerge_options`
+  ADD CONSTRAINT `build_logs_emerge_options_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `build_logs_errors`
+--
+ALTER TABLE `build_logs_errors`
+  ADD CONSTRAINT `build_logs_errors_ibfk_2` FOREIGN KEY (`error_id`) REFERENCES `errors` (`error_id`),
+  ADD CONSTRAINT `build_logs_errors_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`);
+
+--
+-- Constraints for table `build_logs_hilight`
+--
+ALTER TABLE `build_logs_hilight`
+  ADD CONSTRAINT `build_logs_hilight_ibfk_5` FOREIGN KEY (`log_id`) REFERENCES `build_logs_config` (`log_id`),
+  ADD CONSTRAINT `build_logs_hilight_ibfk_4` FOREIGN KEY (`hilight_css_id`) REFERENCES `hilight_css` (`hilight_css_id`);
+
+--
+-- Constraints for table `build_logs_qa`
+--
+ALTER TABLE `build_logs_qa`
+  ADD CONSTRAINT `build_logs_qa_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`);
+
+--
+-- Constraints for table `build_logs_repoman`
+--
+ALTER TABLE `build_logs_repoman`
+  ADD CONSTRAINT `build_logs_repoman_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`);
+
+--
+-- Constraints for table `build_logs_use`
+--
+ALTER TABLE `build_logs_use`
+  ADD CONSTRAINT `build_logs_use_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `configs_emerge_options`
+--
+ALTER TABLE `configs_emerge_options`
+  ADD CONSTRAINT `configs_emerge_options_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `configs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `configs_metadata`
+--
+ALTER TABLE `configs_metadata`
+  ADD CONSTRAINT `configs_metadata_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`),
+  ADD CONSTRAINT `configs_metadata_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `ebuilds`
+--
+ALTER TABLE `ebuilds`
+  ADD CONSTRAINT `ebuilds_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `packages` (`package_id`);
+
+--
+-- Constraints for table `ebuilds_iuse`
+--
+ALTER TABLE `ebuilds_iuse`
+  ADD CONSTRAINT `ebuilds_iuse_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_iuse_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `ebuilds_keywords`
+--
+ALTER TABLE `ebuilds_keywords`
+  ADD CONSTRAINT `ebuilds_keywords_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_keywords_ibfk_2` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`);
+
+--
+-- Constraints for table `ebuilds_metadata`
+--
+ALTER TABLE `ebuilds_metadata`
+  ADD CONSTRAINT `ebuilds_metadata_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
+
+--
+-- Constraints for table `ebuilds_restrictions`
+--
+ALTER TABLE `ebuilds_restrictions`
+  ADD CONSTRAINT `ebuilds_restrictions_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_restrictions_ibfk_2` FOREIGN KEY (`restriction_id`) REFERENCES `restrictions` (`restriction_id`);
+
+--
+-- Constraints for table `hilight`
+--
+ALTER TABLE `hilight`
+  ADD CONSTRAINT `hilight_ibfk_1` FOREIGN KEY (`hilight_css_id`) REFERENCES `hilight_css` (`hilight_css_id`);
+
+--
+-- Constraints for table `jobs`
+--
+ALTER TABLE `jobs`
+  ADD CONSTRAINT `jobs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `jobs_ibfk_2` FOREIGN KEY (`run_config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `jobs_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`job_type_id`);
+
+--
+-- Constraints for table `logs`
+--
+ALTER TABLE `logs`
+  ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `packages`
+--
+ALTER TABLE `packages`
+  ADD CONSTRAINT `packages_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`),
+  ADD CONSTRAINT `packages_ibfk_2` FOREIGN KEY (`repo_id`) REFERENCES `repos` (`repo_id`);
+
+DELIMITER $$
+--
+-- Events
+--
+DROP EVENT `add_esync_updatedb_jobs`$$
 CREATE DEFINER=`zobcs`@`localhost` EVENT `add_esync_updatedb_jobs` ON SCHEDULE EVERY 1 HOUR STARTS '2012-12-23 17:15:13' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
   CALL add_jobs('esync');
   CALL add_jobs('updatedb');
-END$$
-
-DELIMITER ;
-
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+END$$
+
+DELIMITER ;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] dev/zorry:master commit in: gobs/sql/
@ 2012-12-27 21:26 Magnus Granberg
  0 siblings, 0 replies; 6+ messages in thread
From: Magnus Granberg @ 2012-12-27 21:26 UTC (permalink / raw
  To: gentoo-commits

commit:     6629ea39faed6d4c0f93301f833e73233ffab859
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 27 21:25:57 2012 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Thu Dec 27 21:25:57 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=6629ea39

Update sql db structure dump

---
 gobs/sql/zobcs.sql | 1175 ++++++++++++++++++++++++++--------------------------
 1 files changed, 588 insertions(+), 587 deletions(-)

diff --git a/gobs/sql/zobcs.sql b/gobs/sql/zobcs.sql
index 62ba3f4..805c2fa 100644
--- a/gobs/sql/zobcs.sql
+++ b/gobs/sql/zobcs.sql
@@ -1,31 +1,31 @@
--- phpMyAdmin SQL Dump
--- version 3.5.2.2
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Generation Time: Dec 24, 2012 at 01:29 AM
--- Server version: 5.5.28-MariaDB-log
--- PHP Version: 5.4.6--pl0-gentoo
-
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-SET time_zone = "+00:00";
-
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-
---
--- Database: `zobcs`
---
-
-DELIMITER $$
---
--- Procedures
---
-CREATE DEFINER=`zobcs`@`localhost` PROCEDURE `add_jobs`(IN `in_type` VARCHAR(20) CHARSET utf8)
-    MODIFIES SQL DATA
+-- phpMyAdmin SQL Dump
+-- version 3.5.2.2
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: Dec 27, 2012 at 09:23 PM
+-- Server version: 5.5.28-MariaDB-log
+-- PHP Version: 5.4.6--pl0-gentoo
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `zobcs`
+--
+
+DELIMITER $$
+--
+-- Procedures
+--
+CREATE DEFINER=`zobcs`@`localhost` PROCEDURE `add_jobs`(IN `in_type` VARCHAR(20) CHARSET utf8)
+    MODIFIES SQL DATA
 BEGIN
   DECLARE in_config_id INT;
   DECLARE in_job_type_id INT;
@@ -44,565 +44,566 @@ BEGIN
   ELSE
     INSERT INTO jobs (job_type_id, user, config_id, run_config_id) VALUES ( in_job_type_id, 'cron', in_config_id, in_config_id);
   END IF;
-END$$
-
-DELIMITER ;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs` (
-  `build_job_id` int(11) NOT NULL AUTO_INCREMENT,
-  `ebuild_id` int(11) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `status` enum('Waiting','Now') NOT NULL DEFAULT 'Waiting',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`build_job_id`),
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `config_id` (`config_id`),
-  KEY `time_stamp` (`time_stamp`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='The build work list';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_emerge_options` (
-  `build_job_id` int(11) NOT NULL,
-  `eoption_id` int(11) NOT NULL,
-  KEY `build_job_id` (`build_job_id`),
-  KEY `eoption_id` (`eoption_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_redo`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_redo` (
-  `build_job_id` int(11) NOT NULL COMMENT 'build job id',
-  `fail_times` int(1) NOT NULL COMMENT 'Fail times max 5',
-  `fail_type` varchar(30) NOT NULL COMMENT 'Type of fail',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Time',
-  KEY `build_job_id` (`build_job_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Build jobs that need to be redone';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_use`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_use` (
-  `build_job_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `build_job_id` (`build_job_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs` (
-  `build_log_id` int(11) NOT NULL AUTO_INCREMENT,
-  `ebuild_id` int(11) NOT NULL,
-  `fail` enum('True','False') NOT NULL DEFAULT 'False',
-  `summery_text` text NOT NULL,
-  `log_hash` varchar(100) NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`build_log_id`),
-  KEY `ebuild_id` (`ebuild_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main log info for the builds';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_config`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_config` (
-  `build_log_id` int(11) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `logname` varchar(150) NOT NULL COMMENT 'filename of the log',
-  KEY `config_id` (`config_id`),
-  KEY `build_log_id` (`build_log_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_emerge_options` (
-  `build_logs_id` int(11) NOT NULL,
-  `eoption_id` int(11) NOT NULL,
-  KEY `eoption_id` (`eoption_id`),
-  KEY `build_logs_id` (`build_logs_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_qa`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_qa` (
-  `build_log_id` int(11) NOT NULL,
-  `summery_text` text NOT NULL,
-  KEY `build_log_id` (`build_log_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_repoman`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_repoman` (
-  `build_logs_id` int(11) NOT NULL,
-  `summery_text` text NOT NULL,
-  KEY `build_logs_id` (`build_logs_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_use`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_use` (
-  `build_log_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `build_log_id` (`build_log_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `categories`
---
-
-CREATE TABLE IF NOT EXISTS `categories` (
-  `category_id` int(11) NOT NULL AUTO_INCREMENT,
-  `category` varchar(50) NOT NULL,
-  `active` enum('True','False') NOT NULL DEFAULT 'True',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`category_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Categories main table (C)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs`
---
-
-CREATE TABLE IF NOT EXISTS `configs` (
-  `config_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Config index',
-  `config` varchar(100) NOT NULL COMMENT 'Box/setup',
-  `default_config` enum('True','False') NOT NULL COMMENT 'Host setup',
-  PRIMARY KEY (`config_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main config table';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `configs_emerge_options` (
-  `config_id` int(11) NOT NULL COMMENT 'config id',
-  `eoption_id` int(11) NOT NULL COMMENT 'emerge option id',
-  KEY `config_id` (`config_id`),
-  KEY `eoption_id` (`eoption_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Emerge command options for the configs';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs_metadata`
---
-
-CREATE TABLE IF NOT EXISTS `configs_metadata` (
-  `config_id` int(11) NOT NULL,
-  `profile` varchar(50) NOT NULL,
-  `keyword_id` int(11) NOT NULL,
-  `make_conf_text` text NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL,
-  `config_error_text` text NOT NULL,
-  `updating` enum('True','False') NOT NULL,
-  `status` enum('Waiting','Runing','Stoped') NOT NULL,
-  `auto` enum('True','False') NOT NULL,
-  `git_www` varchar(100) NOT NULL COMMENT 'git repo www wiev address',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`config_id`),
-  KEY `keyword_id` (`keyword_id`),
-  KEY `config_id` (`config_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Config Status';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds` (
-  `ebuild_id` int(11) NOT NULL AUTO_INCREMENT,
-  `package_id` int(11) NOT NULL,
-  `version` varchar(50) NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL DEFAULT 'True',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`ebuild_id`),
-  KEY `package_id` (`package_id`),
-  KEY `checksum` (`checksum`),
-  KEY `version` (`version`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Version main table (V)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_iuse`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_iuse` (
-  `ebuild_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_keywords`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_keywords` (
-  `ebuild_id` int(11) NOT NULL,
-  `keyword_id` int(11) NOT NULL,
-  `status` enum('Stable','Unstable','Negative') NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `keyword_id` (`keyword_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_metadata`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_metadata` (
-  `ebuild_id` int(11) NOT NULL,
-  `revision` varchar(10) NOT NULL COMMENT 'CVS revision',
-  KEY `ebuild_id` (`ebuild_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_restrictions`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_restrictions` (
-  `ebuild_id` int(11) NOT NULL,
-  `restriction_id` int(11) NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `restriction_id` (`restriction_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `emerge_options` (
-  `eoption_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'emerge command options id',
-  `eoption` varchar(15) NOT NULL COMMENT 'emerge command options',
-  PRIMARY KEY (`eoption_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jobs`
---
-
-CREATE TABLE IF NOT EXISTS `jobs` (
-  `job_id` int(11) NOT NULL AUTO_INCREMENT,
-  `job_type_id` int(11) NOT NULL,
-  `status` enum('Runing','Done','Waiting') NOT NULL DEFAULT 'Waiting',
-  `user` varchar(20) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `run_config_id` int(11) NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`job_id`),
-  KEY `config_id` (`config_id`),
-  KEY `run_config_id` (`run_config_id`),
-  KEY `job_type_id` (`job_type_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `job_types`
---
-
-CREATE TABLE IF NOT EXISTS `job_types` (
-  `job_type_id` int(11) NOT NULL AUTO_INCREMENT,
-  `type` varchar(20) NOT NULL,
-  PRIMARY KEY (`job_type_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Table for what type of work';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `keywords`
---
-
-CREATE TABLE IF NOT EXISTS `keywords` (
-  `keyword_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'keyword index',
-  `keyword` varchar(15) NOT NULL COMMENT 'keyword',
-  PRIMARY KEY (`keyword_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='KEYWORD';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `logs`
---
-
-CREATE TABLE IF NOT EXISTS `logs` (
-  `log_id` int(11) NOT NULL AUTO_INCREMENT,
-  `config_id` int(11) NOT NULL,
-  `log_type` enum('info','error','debug') NOT NULL,
-  `msg` text NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`log_id`),
-  KEY `config_id` (`config_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `packages`
---
-
-CREATE TABLE IF NOT EXISTS `packages` (
-  `package_id` int(11) NOT NULL AUTO_INCREMENT,
-  `category_id` int(11) NOT NULL,
-  `package` varchar(50) NOT NULL,
-  `repo_id` int(11) NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`package_id`),
-  KEY `category_id` (`category_id`),
-  KEY `repo_id` (`repo_id`),
-  KEY `checksum` (`checksum`),
-  KEY `package` (`package`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Packages main table (P)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `repos`
---
-
-CREATE TABLE IF NOT EXISTS `repos` (
-  `repo_id` int(11) NOT NULL AUTO_INCREMENT,
-  `repo` varchar(100) NOT NULL,
-  PRIMARY KEY (`repo_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Repo main table (repo)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `restrictions`
---
-
-CREATE TABLE IF NOT EXISTS `restrictions` (
-  `restriction_id` int(11) NOT NULL AUTO_INCREMENT,
-  `restriction` varchar(50) NOT NULL,
-  PRIMARY KEY (`restriction_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `uses`
---
-
-CREATE TABLE IF NOT EXISTS `uses` (
-  `use_id` int(11) NOT NULL AUTO_INCREMENT,
-  `flag` varchar(50) NOT NULL,
-  PRIMARY KEY (`use_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Use flags main table';
-
---
--- Constraints for dumped tables
---
-
---
--- Constraints for table `build_jobs`
---
-ALTER TABLE `build_jobs`
-  ADD CONSTRAINT `build_jobs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `build_jobs_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `build_jobs_emerge_options`
---
-ALTER TABLE `build_jobs_emerge_options`
-  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
-  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `build_jobs_redo`
---
-ALTER TABLE `build_jobs_redo`
-  ADD CONSTRAINT `build_jobs_redo_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`);
-
---
--- Constraints for table `build_jobs_use`
---
-ALTER TABLE `build_jobs_use`
-  ADD CONSTRAINT `build_jobs_use_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
-  ADD CONSTRAINT `build_jobs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `build_logs`
---
-ALTER TABLE `build_logs`
-  ADD CONSTRAINT `build_logs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
-
---
--- Constraints for table `build_logs_config`
---
-ALTER TABLE `build_logs_config`
-  ADD CONSTRAINT `build_logs_config_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_config_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `build_logs_emerge_options`
---
-ALTER TABLE `build_logs_emerge_options`
-  ADD CONSTRAINT `build_logs_emerge_options_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `build_logs_qa`
---
-ALTER TABLE `build_logs_qa`
-  ADD CONSTRAINT `build_logs_qa_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`);
-
---
--- Constraints for table `build_logs_repoman`
---
-ALTER TABLE `build_logs_repoman`
-  ADD CONSTRAINT `build_logs_repoman_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`);
-
---
--- Constraints for table `build_logs_use`
---
-ALTER TABLE `build_logs_use`
-  ADD CONSTRAINT `build_logs_use_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `configs_emerge_options`
---
-ALTER TABLE `configs_emerge_options`
-  ADD CONSTRAINT `configs_emerge_options_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `configs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `configs_metadata`
---
-ALTER TABLE `configs_metadata`
-  ADD CONSTRAINT `configs_metadata_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`),
-  ADD CONSTRAINT `configs_metadata_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `ebuilds`
---
-ALTER TABLE `ebuilds`
-  ADD CONSTRAINT `ebuilds_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `packages` (`package_id`);
-
---
--- Constraints for table `ebuilds_iuse`
---
-ALTER TABLE `ebuilds_iuse`
-  ADD CONSTRAINT `ebuilds_iuse_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_iuse_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `ebuilds_keywords`
---
-ALTER TABLE `ebuilds_keywords`
-  ADD CONSTRAINT `ebuilds_keywords_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_keywords_ibfk_2` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`);
-
---
--- Constraints for table `ebuilds_metadata`
---
-ALTER TABLE `ebuilds_metadata`
-  ADD CONSTRAINT `ebuilds_metadata_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
-
---
--- Constraints for table `ebuilds_restrictions`
---
-ALTER TABLE `ebuilds_restrictions`
-  ADD CONSTRAINT `ebuilds_restrictions_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_restrictions_ibfk_2` FOREIGN KEY (`restriction_id`) REFERENCES `restrictions` (`restriction_id`);
-
---
--- Constraints for table `jobs`
---
-ALTER TABLE `jobs`
-  ADD CONSTRAINT `jobs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `jobs_ibfk_2` FOREIGN KEY (`run_config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `jobs_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`job_type_id`);
-
---
--- Constraints for table `logs`
---
-ALTER TABLE `logs`
-  ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `packages`
---
-ALTER TABLE `packages`
-  ADD CONSTRAINT `packages_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`),
-  ADD CONSTRAINT `packages_ibfk_2` FOREIGN KEY (`repo_id`) REFERENCES `repos` (`repo_id`);
-
-DELIMITER $$
---
--- Events
---
+END$$
+
+DELIMITER ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs` (
+  `build_job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `ebuild_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `status` enum('Waiting','Now') NOT NULL DEFAULT 'Waiting',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`build_job_id`),
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `config_id` (`config_id`),
+  KEY `time_stamp` (`time_stamp`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='The build work list';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs_emerge_options` (
+  `build_job_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL,
+  KEY `build_job_id` (`build_job_id`),
+  KEY `eoption_id` (`eoption_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_redo`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs_redo` (
+  `build_job_id` int(11) NOT NULL COMMENT 'build job id',
+  `fail_times` int(1) NOT NULL COMMENT 'Fail times max 5',
+  `fail_type` varchar(30) NOT NULL COMMENT 'Type of fail',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Time',
+  KEY `build_job_id` (`build_job_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Build jobs that need to be redone';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_use`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs_use` (
+  `build_job_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `build_job_id` (`build_job_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs` (
+  `build_log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `ebuild_id` int(11) NOT NULL,
+  `fail` enum('True','False') NOT NULL DEFAULT 'False',
+  `summery_text` text NOT NULL,
+  `log_hash` varchar(100) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`build_log_id`),
+  KEY `ebuild_id` (`ebuild_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main log info for the builds';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_config`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_config` (
+  `build_log_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `logname` varchar(150) NOT NULL COMMENT 'filename of the log',
+  KEY `config_id` (`config_id`),
+  KEY `build_log_id` (`build_log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_emerge_options` (
+  `build_logs_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL,
+  KEY `eoption_id` (`eoption_id`),
+  KEY `build_logs_id` (`build_logs_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_qa`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_qa` (
+  `build_log_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL,
+  KEY `build_log_id` (`build_log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_repoman`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_repoman` (
+  `build_logs_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL,
+  KEY `build_logs_id` (`build_logs_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_use`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_use` (
+  `build_log_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `build_log_id` (`build_log_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `categories`
+--
+
+CREATE TABLE IF NOT EXISTS `categories` (
+  `category_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category` varchar(50) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`category_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Categories main table (C)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs`
+--
+
+CREATE TABLE IF NOT EXISTS `configs` (
+  `config_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Config index',
+  `hostname` varchar(50) NOT NULL,
+  `config` varchar(100) NOT NULL COMMENT 'Box/setup',
+  `default_config` enum('True','False') NOT NULL COMMENT 'Host setup',
+  PRIMARY KEY (`config_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main config table';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `configs_emerge_options` (
+  `config_id` int(11) NOT NULL COMMENT 'config id',
+  `eoption_id` int(11) NOT NULL COMMENT 'emerge option id',
+  KEY `config_id` (`config_id`),
+  KEY `eoption_id` (`eoption_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Emerge command options for the configs';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_metadata`
+--
+
+CREATE TABLE IF NOT EXISTS `configs_metadata` (
+  `config_id` int(11) NOT NULL,
+  `profile` varchar(50) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `make_conf_text` text NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `config_error_text` text NOT NULL,
+  `updating` enum('True','False') NOT NULL,
+  `status` enum('Waiting','Runing','Stoped') NOT NULL,
+  `auto` enum('True','False') NOT NULL,
+  `git_www` varchar(100) NOT NULL COMMENT 'git repo www wiev address',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`config_id`),
+  KEY `keyword_id` (`keyword_id`),
+  KEY `config_id` (`config_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Config Status';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds` (
+  `ebuild_id` int(11) NOT NULL AUTO_INCREMENT,
+  `package_id` int(11) NOT NULL,
+  `version` varchar(50) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`ebuild_id`),
+  KEY `package_id` (`package_id`),
+  KEY `checksum` (`checksum`),
+  KEY `version` (`version`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Version main table (V)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_iuse`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_iuse` (
+  `ebuild_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_keywords`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_keywords` (
+  `ebuild_id` int(11) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `status` enum('Stable','Unstable','Negative') NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `keyword_id` (`keyword_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_metadata`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_metadata` (
+  `ebuild_id` int(11) NOT NULL,
+  `revision` varchar(10) NOT NULL COMMENT 'CVS revision',
+  KEY `ebuild_id` (`ebuild_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_restrictions`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_restrictions` (
+  `ebuild_id` int(11) NOT NULL,
+  `restriction_id` int(11) NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `restriction_id` (`restriction_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `emerge_options` (
+  `eoption_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'emerge command options id',
+  `eoption` varchar(15) NOT NULL COMMENT 'emerge command options',
+  PRIMARY KEY (`eoption_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `jobs`
+--
+
+CREATE TABLE IF NOT EXISTS `jobs` (
+  `job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `job_type_id` int(11) NOT NULL,
+  `status` enum('Runing','Done','Waiting') NOT NULL DEFAULT 'Waiting',
+  `user` varchar(20) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `run_config_id` int(11) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`job_id`),
+  KEY `config_id` (`config_id`),
+  KEY `run_config_id` (`run_config_id`),
+  KEY `job_type_id` (`job_type_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `job_types`
+--
+
+CREATE TABLE IF NOT EXISTS `job_types` (
+  `job_type_id` int(11) NOT NULL AUTO_INCREMENT,
+  `type` varchar(20) NOT NULL,
+  PRIMARY KEY (`job_type_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Table for what type of work';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `keywords`
+--
+
+CREATE TABLE IF NOT EXISTS `keywords` (
+  `keyword_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'keyword index',
+  `keyword` varchar(15) NOT NULL COMMENT 'keyword',
+  PRIMARY KEY (`keyword_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='KEYWORD';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `logs`
+--
+
+CREATE TABLE IF NOT EXISTS `logs` (
+  `log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `config_id` int(11) NOT NULL,
+  `log_type` enum('info','error','debug') NOT NULL,
+  `msg` text NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`log_id`),
+  KEY `config_id` (`config_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `packages`
+--
+
+CREATE TABLE IF NOT EXISTS `packages` (
+  `package_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category_id` int(11) NOT NULL,
+  `package` varchar(50) NOT NULL,
+  `repo_id` int(11) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`package_id`),
+  KEY `category_id` (`category_id`),
+  KEY `repo_id` (`repo_id`),
+  KEY `checksum` (`checksum`),
+  KEY `package` (`package`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Packages main table (P)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `repos`
+--
+
+CREATE TABLE IF NOT EXISTS `repos` (
+  `repo_id` int(11) NOT NULL AUTO_INCREMENT,
+  `repo` varchar(100) NOT NULL,
+  PRIMARY KEY (`repo_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Repo main table (repo)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `restrictions`
+--
+
+CREATE TABLE IF NOT EXISTS `restrictions` (
+  `restriction_id` int(11) NOT NULL AUTO_INCREMENT,
+  `restriction` varchar(50) NOT NULL,
+  PRIMARY KEY (`restriction_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `uses`
+--
+
+CREATE TABLE IF NOT EXISTS `uses` (
+  `use_id` int(11) NOT NULL AUTO_INCREMENT,
+  `flag` varchar(50) NOT NULL,
+  PRIMARY KEY (`use_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Use flags main table';
+
+--
+-- Constraints for dumped tables
+--
+
+--
+-- Constraints for table `build_jobs`
+--
+ALTER TABLE `build_jobs`
+  ADD CONSTRAINT `build_jobs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `build_jobs_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `build_jobs_emerge_options`
+--
+ALTER TABLE `build_jobs_emerge_options`
+  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
+  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `build_jobs_redo`
+--
+ALTER TABLE `build_jobs_redo`
+  ADD CONSTRAINT `build_jobs_redo_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`);
+
+--
+-- Constraints for table `build_jobs_use`
+--
+ALTER TABLE `build_jobs_use`
+  ADD CONSTRAINT `build_jobs_use_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
+  ADD CONSTRAINT `build_jobs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `build_logs`
+--
+ALTER TABLE `build_logs`
+  ADD CONSTRAINT `build_logs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
+
+--
+-- Constraints for table `build_logs_config`
+--
+ALTER TABLE `build_logs_config`
+  ADD CONSTRAINT `build_logs_config_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_config_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `build_logs_emerge_options`
+--
+ALTER TABLE `build_logs_emerge_options`
+  ADD CONSTRAINT `build_logs_emerge_options_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `build_logs_qa`
+--
+ALTER TABLE `build_logs_qa`
+  ADD CONSTRAINT `build_logs_qa_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`);
+
+--
+-- Constraints for table `build_logs_repoman`
+--
+ALTER TABLE `build_logs_repoman`
+  ADD CONSTRAINT `build_logs_repoman_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`);
+
+--
+-- Constraints for table `build_logs_use`
+--
+ALTER TABLE `build_logs_use`
+  ADD CONSTRAINT `build_logs_use_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `configs_emerge_options`
+--
+ALTER TABLE `configs_emerge_options`
+  ADD CONSTRAINT `configs_emerge_options_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `configs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `configs_metadata`
+--
+ALTER TABLE `configs_metadata`
+  ADD CONSTRAINT `configs_metadata_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`),
+  ADD CONSTRAINT `configs_metadata_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `ebuilds`
+--
+ALTER TABLE `ebuilds`
+  ADD CONSTRAINT `ebuilds_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `packages` (`package_id`);
+
+--
+-- Constraints for table `ebuilds_iuse`
+--
+ALTER TABLE `ebuilds_iuse`
+  ADD CONSTRAINT `ebuilds_iuse_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_iuse_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `ebuilds_keywords`
+--
+ALTER TABLE `ebuilds_keywords`
+  ADD CONSTRAINT `ebuilds_keywords_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_keywords_ibfk_2` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`);
+
+--
+-- Constraints for table `ebuilds_metadata`
+--
+ALTER TABLE `ebuilds_metadata`
+  ADD CONSTRAINT `ebuilds_metadata_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
+
+--
+-- Constraints for table `ebuilds_restrictions`
+--
+ALTER TABLE `ebuilds_restrictions`
+  ADD CONSTRAINT `ebuilds_restrictions_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_restrictions_ibfk_2` FOREIGN KEY (`restriction_id`) REFERENCES `restrictions` (`restriction_id`);
+
+--
+-- Constraints for table `jobs`
+--
+ALTER TABLE `jobs`
+  ADD CONSTRAINT `jobs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `jobs_ibfk_2` FOREIGN KEY (`run_config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `jobs_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`job_type_id`);
+
+--
+-- Constraints for table `logs`
+--
+ALTER TABLE `logs`
+  ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `packages`
+--
+ALTER TABLE `packages`
+  ADD CONSTRAINT `packages_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`),
+  ADD CONSTRAINT `packages_ibfk_2` FOREIGN KEY (`repo_id`) REFERENCES `repos` (`repo_id`);
+
+DELIMITER $$
+--
+-- Events
+--
 CREATE DEFINER=`zobcs`@`localhost` EVENT `add_esync_updatedb_jobs` ON SCHEDULE EVERY 1 HOUR STARTS '2012-12-23 17:15:13' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
   CALL add_jobs('esync');
   CALL add_jobs('updatedb');
-END$$
-
-DELIMITER ;
-
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+END$$
+
+DELIMITER ;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] dev/zorry:master commit in: gobs/sql/
@ 2012-12-24  1:32 Magnus Granberg
  0 siblings, 0 replies; 6+ messages in thread
From: Magnus Granberg @ 2012-12-24  1:32 UTC (permalink / raw
  To: gentoo-commits

commit:     26d38b8cdb52e0fb7a44004eb270560d76dd5591
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 24 01:32:17 2012 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Mon Dec 24 01:32:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=26d38b8c

Update the sql structur dump with the Event scheduler code

---
 gobs/sql/zobcs.sql | 1206 ++++++++++++++++++++++++++--------------------------
 1 files changed, 608 insertions(+), 598 deletions(-)

diff --git a/gobs/sql/zobcs.sql b/gobs/sql/zobcs.sql
index 3f71b73..62ba3f4 100644
--- a/gobs/sql/zobcs.sql
+++ b/gobs/sql/zobcs.sql
@@ -1,598 +1,608 @@
--- phpMyAdmin SQL Dump
--- version 3.5.2.2
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Generation Time: Dec 22, 2012 at 09:14 PM
--- Server version: 5.5.28-MariaDB-log
--- PHP Version: 5.4.6--pl0-gentoo
-
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-SET time_zone = "+00:00";
-
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-
---
--- Database: `zobcs`
---
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs` (
-  `build_job_id` int(11) NOT NULL AUTO_INCREMENT,
-  `ebuild_id` int(11) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `status` enum('Waiting','Now') NOT NULL DEFAULT 'Waiting',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`build_job_id`),
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `config_id` (`config_id`),
-  KEY `time_stamp` (`time_stamp`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='The build work list';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_emerge_options` (
-  `build_job_id` int(11) NOT NULL,
-  `eoption_id` int(11) NOT NULL,
-  KEY `build_job_id` (`build_job_id`),
-  KEY `eoption_id` (`eoption_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_redo`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_redo` (
-  `build_job_id` int(11) NOT NULL COMMENT 'build job id',
-  `fail_times` int(1) NOT NULL COMMENT 'Fail times max 5',
-  `fail_type` varchar(30) NOT NULL COMMENT 'Type of fail',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Time',
-  KEY `build_job_id` (`build_job_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Build jobs that need to be redone';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_jobs_use`
---
-
-CREATE TABLE IF NOT EXISTS `build_jobs_use` (
-  `build_job_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `build_job_id` (`build_job_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs` (
-  `build_log_id` int(11) NOT NULL AUTO_INCREMENT,
-  `ebuild_id` int(11) NOT NULL,
-  `fail` enum('True','False') NOT NULL DEFAULT 'False',
-  `summery_text` text NOT NULL,
-  `log_hash` varchar(100) NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`build_log_id`),
-  KEY `ebuild_id` (`ebuild_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main log info for the builds';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_config`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_config` (
-  `build_log_id` int(11) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `logname` varchar(150) NOT NULL COMMENT 'filename of the log',
-  KEY `config_id` (`config_id`),
-  KEY `build_log_id` (`build_log_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_emerge_options` (
-  `build_logs_id` int(11) NOT NULL,
-  `eoption_id` int(11) NOT NULL,
-  KEY `eoption_id` (`eoption_id`),
-  KEY `build_logs_id` (`build_logs_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_qa`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_qa` (
-  `build_log_id` int(11) NOT NULL,
-  `summery_text` text NOT NULL,
-  KEY `build_log_id` (`build_log_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_repoman`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_repoman` (
-  `build_logs_id` int(11) NOT NULL,
-  `summery_text` text NOT NULL,
-  KEY `build_logs_id` (`build_logs_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `build_logs_use`
---
-
-CREATE TABLE IF NOT EXISTS `build_logs_use` (
-  `build_log_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `build_log_id` (`build_log_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `categories`
---
-
-CREATE TABLE IF NOT EXISTS `categories` (
-  `category_id` int(11) NOT NULL AUTO_INCREMENT,
-  `category` varchar(50) NOT NULL,
-  `active` enum('True','False') NOT NULL DEFAULT 'True',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`category_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Categories main table (C)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs`
---
-
-CREATE TABLE IF NOT EXISTS `configs` (
-  `config_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Config index',
-  `config` varchar(100) NOT NULL COMMENT 'Box/setup',
-  `default_config` enum('True','False') NOT NULL COMMENT 'Host setup',
-  PRIMARY KEY (`config_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main config table';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs_emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `configs_emerge_options` (
-  `config_id` int(11) NOT NULL COMMENT 'config id',
-  `eoption_id` int(11) NOT NULL COMMENT 'emerge option id',
-  KEY `config_id` (`config_id`),
-  KEY `eoption_id` (`eoption_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Emerge command options for the configs';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `configs_metadata`
---
-
-CREATE TABLE IF NOT EXISTS `configs_metadata` (
-  `config_id` int(11) NOT NULL,
-  `profile` varchar(50) NOT NULL,
-  `keyword_id` int(11) NOT NULL,
-  `make_conf_text` text NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL,
-  `config_error_text` text NOT NULL,
-  `updating` enum('True','False') NOT NULL,
-  `status` enum('Waiting','Runing','Stoped') NOT NULL,
-  `auto` enum('True','False') NOT NULL,
-  `git_www` varchar(100) NOT NULL COMMENT 'git repo www wiev address',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`config_id`),
-  KEY `keyword_id` (`keyword_id`),
-  KEY `config_id` (`config_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Config Status';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `cron`
---
-
-CREATE TABLE IF NOT EXISTS `cron` (
-  `cron_id` int(11) NOT NULL AUTO_INCREMENT,
-  `job_type_id` int(11) NOT NULL,
-  `time_when` int(11) NOT NULL COMMENT 'When to run it (min)',
-  `config_id` int(11) NOT NULL,
-  `run_config_id` int(11) NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`cron_id`),
-  KEY `job_type_id` (`job_type_id`),
-  KEY `config_id` (`config_id`),
-  KEY `run_config_id` (`run_config_id`),
-  KEY `time_stamp` (`time_stamp`),
-  KEY `time_when` (`time_when`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Cron table';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds` (
-  `ebuild_id` int(11) NOT NULL AUTO_INCREMENT,
-  `package_id` int(11) NOT NULL,
-  `version` varchar(50) NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL DEFAULT 'True',
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`ebuild_id`),
-  KEY `package_id` (`package_id`),
-  KEY `checksum` (`checksum`),
-  KEY `version` (`version`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Version main table (V)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_iuse`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_iuse` (
-  `ebuild_id` int(11) NOT NULL,
-  `use_id` int(11) NOT NULL,
-  `status` enum('True','False') NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `use_id` (`use_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_keywords`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_keywords` (
-  `ebuild_id` int(11) NOT NULL,
-  `keyword_id` int(11) NOT NULL,
-  `status` enum('Stable','Unstable','Negative') NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `keyword_id` (`keyword_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_metadata`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_metadata` (
-  `ebuild_id` int(11) NOT NULL,
-  `revision` varchar(10) NOT NULL COMMENT 'CVS revision',
-  KEY `ebuild_id` (`ebuild_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `ebuilds_restrictions`
---
-
-CREATE TABLE IF NOT EXISTS `ebuilds_restrictions` (
-  `ebuild_id` int(11) NOT NULL,
-  `restriction_id` int(11) NOT NULL,
-  KEY `ebuild_id` (`ebuild_id`),
-  KEY `restriction_id` (`restriction_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `emerge_options`
---
-
-CREATE TABLE IF NOT EXISTS `emerge_options` (
-  `eoption_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'emerge command options id',
-  `eoption` varchar(15) NOT NULL COMMENT 'emerge command options',
-  PRIMARY KEY (`eoption_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `jobs`
---
-
-CREATE TABLE IF NOT EXISTS `jobs` (
-  `job_id` int(11) NOT NULL AUTO_INCREMENT,
-  `job_type_id` int(11) NOT NULL,
-  `status` enum('Runing','Done','Waiting') NOT NULL DEFAULT 'Waiting',
-  `user` varchar(20) NOT NULL,
-  `config_id` int(11) NOT NULL,
-  `run_config_id` int(11) NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`job_id`),
-  KEY `config_id` (`config_id`),
-  KEY `run_config_id` (`run_config_id`),
-  KEY `job_type_id` (`job_type_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `job_types`
---
-
-CREATE TABLE IF NOT EXISTS `job_types` (
-  `job_type_id` int(11) NOT NULL AUTO_INCREMENT,
-  `type` varchar(20) NOT NULL,
-  PRIMARY KEY (`job_type_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Table for what type of work';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `keywords`
---
-
-CREATE TABLE IF NOT EXISTS `keywords` (
-  `keyword_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'keyword index',
-  `keyword` varchar(15) NOT NULL COMMENT 'keyword',
-  PRIMARY KEY (`keyword_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='KEYWORD';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `logs`
---
-
-CREATE TABLE IF NOT EXISTS `logs` (
-  `log_id` int(11) NOT NULL AUTO_INCREMENT,
-  `config_id` int(11) NOT NULL,
-  `log_type` enum('info','error','debug') NOT NULL,
-  `msg` text NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`log_id`),
-  KEY `config_id` (`config_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `packages`
---
-
-CREATE TABLE IF NOT EXISTS `packages` (
-  `package_id` int(11) NOT NULL AUTO_INCREMENT,
-  `category_id` int(11) NOT NULL,
-  `package` varchar(50) NOT NULL,
-  `repo_id` int(11) NOT NULL,
-  `checksum` varchar(100) NOT NULL,
-  `active` enum('True','False') NOT NULL,
-  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  PRIMARY KEY (`package_id`),
-  KEY `category_id` (`category_id`),
-  KEY `repo_id` (`repo_id`),
-  KEY `checksum` (`checksum`),
-  KEY `package` (`package`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Packages main table (P)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `repos`
---
-
-CREATE TABLE IF NOT EXISTS `repos` (
-  `repo_id` int(11) NOT NULL AUTO_INCREMENT,
-  `repo` varchar(100) NOT NULL,
-  PRIMARY KEY (`repo_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Repo main table (repo)';
-
--- --------------------------------------------------------
-
---
--- Table structure for table `restrictions`
---
-
-CREATE TABLE IF NOT EXISTS `restrictions` (
-  `restriction_id` int(11) NOT NULL AUTO_INCREMENT,
-  `restriction` varchar(50) NOT NULL,
-  PRIMARY KEY (`restriction_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `uses`
---
-
-CREATE TABLE IF NOT EXISTS `uses` (
-  `use_id` int(11) NOT NULL AUTO_INCREMENT,
-  `flag` varchar(50) NOT NULL,
-  PRIMARY KEY (`use_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Use flags main table';
-
---
--- Constraints for dumped tables
---
-
---
--- Constraints for table `build_jobs`
---
-ALTER TABLE `build_jobs`
-  ADD CONSTRAINT `build_jobs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `build_jobs_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `build_jobs_emerge_options`
---
-ALTER TABLE `build_jobs_emerge_options`
-  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
-  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `build_jobs_redo`
---
-ALTER TABLE `build_jobs_redo`
-  ADD CONSTRAINT `build_jobs_redo_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`);
-
---
--- Constraints for table `build_jobs_use`
---
-ALTER TABLE `build_jobs_use`
-  ADD CONSTRAINT `build_jobs_use_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
-  ADD CONSTRAINT `build_jobs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `build_logs`
---
-ALTER TABLE `build_logs`
-  ADD CONSTRAINT `build_logs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
-
---
--- Constraints for table `build_logs_config`
---
-ALTER TABLE `build_logs_config`
-  ADD CONSTRAINT `build_logs_config_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_config_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `build_logs_emerge_options`
---
-ALTER TABLE `build_logs_emerge_options`
-  ADD CONSTRAINT `build_logs_emerge_options_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `build_logs_qa`
---
-ALTER TABLE `build_logs_qa`
-  ADD CONSTRAINT `build_logs_qa_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`);
-
---
--- Constraints for table `build_logs_repoman`
---
-ALTER TABLE `build_logs_repoman`
-  ADD CONSTRAINT `build_logs_repoman_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`);
-
---
--- Constraints for table `build_logs_use`
---
-ALTER TABLE `build_logs_use`
-  ADD CONSTRAINT `build_logs_use_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
-  ADD CONSTRAINT `build_logs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `configs_emerge_options`
---
-ALTER TABLE `configs_emerge_options`
-  ADD CONSTRAINT `configs_emerge_options_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `configs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
-
---
--- Constraints for table `configs_metadata`
---
-ALTER TABLE `configs_metadata`
-  ADD CONSTRAINT `configs_metadata_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`),
-  ADD CONSTRAINT `configs_metadata_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `cron`
---
-ALTER TABLE `cron`
-  ADD CONSTRAINT `cron_ibfk_1` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`job_type_id`),
-  ADD CONSTRAINT `cron_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `cron_ibfk_3` FOREIGN KEY (`run_config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `ebuilds`
---
-ALTER TABLE `ebuilds`
-  ADD CONSTRAINT `ebuilds_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `packages` (`package_id`);
-
---
--- Constraints for table `ebuilds_iuse`
---
-ALTER TABLE `ebuilds_iuse`
-  ADD CONSTRAINT `ebuilds_iuse_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_iuse_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
-
---
--- Constraints for table `ebuilds_keywords`
---
-ALTER TABLE `ebuilds_keywords`
-  ADD CONSTRAINT `ebuilds_keywords_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_keywords_ibfk_2` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`);
-
---
--- Constraints for table `ebuilds_metadata`
---
-ALTER TABLE `ebuilds_metadata`
-  ADD CONSTRAINT `ebuilds_metadata_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
-
---
--- Constraints for table `ebuilds_restrictions`
---
-ALTER TABLE `ebuilds_restrictions`
-  ADD CONSTRAINT `ebuilds_restrictions_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
-  ADD CONSTRAINT `ebuilds_restrictions_ibfk_2` FOREIGN KEY (`restriction_id`) REFERENCES `restrictions` (`restriction_id`);
-
---
--- Constraints for table `jobs`
---
-ALTER TABLE `jobs`
-  ADD CONSTRAINT `jobs_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`job_type_id`),
-  ADD CONSTRAINT `jobs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
-  ADD CONSTRAINT `jobs_ibfk_2` FOREIGN KEY (`run_config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `logs`
---
-ALTER TABLE `logs`
-  ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
-
---
--- Constraints for table `packages`
---
-ALTER TABLE `packages`
-  ADD CONSTRAINT `packages_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`),
-  ADD CONSTRAINT `packages_ibfk_2` FOREIGN KEY (`repo_id`) REFERENCES `repos` (`repo_id`);
-
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+-- phpMyAdmin SQL Dump
+-- version 3.5.2.2
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: Dec 24, 2012 at 01:29 AM
+-- Server version: 5.5.28-MariaDB-log
+-- PHP Version: 5.4.6--pl0-gentoo
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `zobcs`
+--
+
+DELIMITER $$
+--
+-- Procedures
+--
+CREATE DEFINER=`zobcs`@`localhost` PROCEDURE `add_jobs`(IN `in_type` VARCHAR(20) CHARSET utf8)
+    MODIFIES SQL DATA
+BEGIN
+  DECLARE in_config_id INT;
+  DECLARE in_job_type_id INT;
+  DECLARE in_job_id INT;
+  SET in_config_id = (SELECT config_id
+    FROM configs WHERE default_config = 'True');
+  SET in_job_type_id = (SELECT job_type_id
+    FROM job_types WHERE type = in_type);
+  SET in_job_id = (SELECT job_id FROM jobs 
+    WHERE job_type_id = in_job_type_id
+    AND config_id = in_config_id 
+    AND (status = 'Runing' OR status = 'Waiting')
+    LIMIT 1);
+  IF in_job_id >= 1 THEN
+    SET in_job_id = 0;
+  ELSE
+    INSERT INTO jobs (job_type_id, user, config_id, run_config_id) VALUES ( in_job_type_id, 'cron', in_config_id, in_config_id);
+  END IF;
+END$$
+
+DELIMITER ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs` (
+  `build_job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `ebuild_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `status` enum('Waiting','Now') NOT NULL DEFAULT 'Waiting',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`build_job_id`),
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `config_id` (`config_id`),
+  KEY `time_stamp` (`time_stamp`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='The build work list';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs_emerge_options` (
+  `build_job_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL,
+  KEY `build_job_id` (`build_job_id`),
+  KEY `eoption_id` (`eoption_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_redo`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs_redo` (
+  `build_job_id` int(11) NOT NULL COMMENT 'build job id',
+  `fail_times` int(1) NOT NULL COMMENT 'Fail times max 5',
+  `fail_type` varchar(30) NOT NULL COMMENT 'Type of fail',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Time',
+  KEY `build_job_id` (`build_job_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Build jobs that need to be redone';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_use`
+--
+
+CREATE TABLE IF NOT EXISTS `build_jobs_use` (
+  `build_job_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `build_job_id` (`build_job_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs` (
+  `build_log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `ebuild_id` int(11) NOT NULL,
+  `fail` enum('True','False') NOT NULL DEFAULT 'False',
+  `summery_text` text NOT NULL,
+  `log_hash` varchar(100) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`build_log_id`),
+  KEY `ebuild_id` (`ebuild_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main log info for the builds';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_config`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_config` (
+  `build_log_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `logname` varchar(150) NOT NULL COMMENT 'filename of the log',
+  KEY `config_id` (`config_id`),
+  KEY `build_log_id` (`build_log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_emerge_options` (
+  `build_logs_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL,
+  KEY `eoption_id` (`eoption_id`),
+  KEY `build_logs_id` (`build_logs_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_qa`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_qa` (
+  `build_log_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL,
+  KEY `build_log_id` (`build_log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_repoman`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_repoman` (
+  `build_logs_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL,
+  KEY `build_logs_id` (`build_logs_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_use`
+--
+
+CREATE TABLE IF NOT EXISTS `build_logs_use` (
+  `build_log_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `build_log_id` (`build_log_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `categories`
+--
+
+CREATE TABLE IF NOT EXISTS `categories` (
+  `category_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category` varchar(50) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`category_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Categories main table (C)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs`
+--
+
+CREATE TABLE IF NOT EXISTS `configs` (
+  `config_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Config index',
+  `config` varchar(100) NOT NULL COMMENT 'Box/setup',
+  `default_config` enum('True','False') NOT NULL COMMENT 'Host setup',
+  PRIMARY KEY (`config_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main config table';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `configs_emerge_options` (
+  `config_id` int(11) NOT NULL COMMENT 'config id',
+  `eoption_id` int(11) NOT NULL COMMENT 'emerge option id',
+  KEY `config_id` (`config_id`),
+  KEY `eoption_id` (`eoption_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Emerge command options for the configs';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_metadata`
+--
+
+CREATE TABLE IF NOT EXISTS `configs_metadata` (
+  `config_id` int(11) NOT NULL,
+  `profile` varchar(50) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `make_conf_text` text NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `config_error_text` text NOT NULL,
+  `updating` enum('True','False') NOT NULL,
+  `status` enum('Waiting','Runing','Stoped') NOT NULL,
+  `auto` enum('True','False') NOT NULL,
+  `git_www` varchar(100) NOT NULL COMMENT 'git repo www wiev address',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`config_id`),
+  KEY `keyword_id` (`keyword_id`),
+  KEY `config_id` (`config_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Config Status';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds` (
+  `ebuild_id` int(11) NOT NULL AUTO_INCREMENT,
+  `package_id` int(11) NOT NULL,
+  `version` varchar(50) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`ebuild_id`),
+  KEY `package_id` (`package_id`),
+  KEY `checksum` (`checksum`),
+  KEY `version` (`version`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Version main table (V)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_iuse`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_iuse` (
+  `ebuild_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `use_id` (`use_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_keywords`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_keywords` (
+  `ebuild_id` int(11) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `status` enum('Stable','Unstable','Negative') NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `keyword_id` (`keyword_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_metadata`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_metadata` (
+  `ebuild_id` int(11) NOT NULL,
+  `revision` varchar(10) NOT NULL COMMENT 'CVS revision',
+  KEY `ebuild_id` (`ebuild_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_restrictions`
+--
+
+CREATE TABLE IF NOT EXISTS `ebuilds_restrictions` (
+  `ebuild_id` int(11) NOT NULL,
+  `restriction_id` int(11) NOT NULL,
+  KEY `ebuild_id` (`ebuild_id`),
+  KEY `restriction_id` (`restriction_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `emerge_options`
+--
+
+CREATE TABLE IF NOT EXISTS `emerge_options` (
+  `eoption_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'emerge command options id',
+  `eoption` varchar(15) NOT NULL COMMENT 'emerge command options',
+  PRIMARY KEY (`eoption_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `jobs`
+--
+
+CREATE TABLE IF NOT EXISTS `jobs` (
+  `job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `job_type_id` int(11) NOT NULL,
+  `status` enum('Runing','Done','Waiting') NOT NULL DEFAULT 'Waiting',
+  `user` varchar(20) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `run_config_id` int(11) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`job_id`),
+  KEY `config_id` (`config_id`),
+  KEY `run_config_id` (`run_config_id`),
+  KEY `job_type_id` (`job_type_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `job_types`
+--
+
+CREATE TABLE IF NOT EXISTS `job_types` (
+  `job_type_id` int(11) NOT NULL AUTO_INCREMENT,
+  `type` varchar(20) NOT NULL,
+  PRIMARY KEY (`job_type_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Table for what type of work';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `keywords`
+--
+
+CREATE TABLE IF NOT EXISTS `keywords` (
+  `keyword_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'keyword index',
+  `keyword` varchar(15) NOT NULL COMMENT 'keyword',
+  PRIMARY KEY (`keyword_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='KEYWORD';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `logs`
+--
+
+CREATE TABLE IF NOT EXISTS `logs` (
+  `log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `config_id` int(11) NOT NULL,
+  `log_type` enum('info','error','debug') NOT NULL,
+  `msg` text NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`log_id`),
+  KEY `config_id` (`config_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `packages`
+--
+
+CREATE TABLE IF NOT EXISTS `packages` (
+  `package_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category_id` int(11) NOT NULL,
+  `package` varchar(50) NOT NULL,
+  `repo_id` int(11) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`package_id`),
+  KEY `category_id` (`category_id`),
+  KEY `repo_id` (`repo_id`),
+  KEY `checksum` (`checksum`),
+  KEY `package` (`package`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Packages main table (P)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `repos`
+--
+
+CREATE TABLE IF NOT EXISTS `repos` (
+  `repo_id` int(11) NOT NULL AUTO_INCREMENT,
+  `repo` varchar(100) NOT NULL,
+  PRIMARY KEY (`repo_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Repo main table (repo)';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `restrictions`
+--
+
+CREATE TABLE IF NOT EXISTS `restrictions` (
+  `restriction_id` int(11) NOT NULL AUTO_INCREMENT,
+  `restriction` varchar(50) NOT NULL,
+  PRIMARY KEY (`restriction_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `uses`
+--
+
+CREATE TABLE IF NOT EXISTS `uses` (
+  `use_id` int(11) NOT NULL AUTO_INCREMENT,
+  `flag` varchar(50) NOT NULL,
+  PRIMARY KEY (`use_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Use flags main table';
+
+--
+-- Constraints for dumped tables
+--
+
+--
+-- Constraints for table `build_jobs`
+--
+ALTER TABLE `build_jobs`
+  ADD CONSTRAINT `build_jobs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `build_jobs_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `build_jobs_emerge_options`
+--
+ALTER TABLE `build_jobs_emerge_options`
+  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
+  ADD CONSTRAINT `build_jobs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `build_jobs_redo`
+--
+ALTER TABLE `build_jobs_redo`
+  ADD CONSTRAINT `build_jobs_redo_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`);
+
+--
+-- Constraints for table `build_jobs_use`
+--
+ALTER TABLE `build_jobs_use`
+  ADD CONSTRAINT `build_jobs_use_ibfk_1` FOREIGN KEY (`build_job_id`) REFERENCES `build_jobs` (`build_job_id`),
+  ADD CONSTRAINT `build_jobs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `build_logs`
+--
+ALTER TABLE `build_logs`
+  ADD CONSTRAINT `build_logs_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
+
+--
+-- Constraints for table `build_logs_config`
+--
+ALTER TABLE `build_logs_config`
+  ADD CONSTRAINT `build_logs_config_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_config_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `build_logs_emerge_options`
+--
+ALTER TABLE `build_logs_emerge_options`
+  ADD CONSTRAINT `build_logs_emerge_options_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `build_logs_qa`
+--
+ALTER TABLE `build_logs_qa`
+  ADD CONSTRAINT `build_logs_qa_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`);
+
+--
+-- Constraints for table `build_logs_repoman`
+--
+ALTER TABLE `build_logs_repoman`
+  ADD CONSTRAINT `build_logs_repoman_ibfk_1` FOREIGN KEY (`build_logs_id`) REFERENCES `build_logs` (`build_log_id`);
+
+--
+-- Constraints for table `build_logs_use`
+--
+ALTER TABLE `build_logs_use`
+  ADD CONSTRAINT `build_logs_use_ibfk_1` FOREIGN KEY (`build_log_id`) REFERENCES `build_logs` (`build_log_id`),
+  ADD CONSTRAINT `build_logs_use_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `configs_emerge_options`
+--
+ALTER TABLE `configs_emerge_options`
+  ADD CONSTRAINT `configs_emerge_options_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `configs_emerge_options_ibfk_2` FOREIGN KEY (`eoption_id`) REFERENCES `emerge_options` (`eoption_id`);
+
+--
+-- Constraints for table `configs_metadata`
+--
+ALTER TABLE `configs_metadata`
+  ADD CONSTRAINT `configs_metadata_ibfk_1` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`),
+  ADD CONSTRAINT `configs_metadata_ibfk_2` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `ebuilds`
+--
+ALTER TABLE `ebuilds`
+  ADD CONSTRAINT `ebuilds_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `packages` (`package_id`);
+
+--
+-- Constraints for table `ebuilds_iuse`
+--
+ALTER TABLE `ebuilds_iuse`
+  ADD CONSTRAINT `ebuilds_iuse_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_iuse_ibfk_2` FOREIGN KEY (`use_id`) REFERENCES `uses` (`use_id`);
+
+--
+-- Constraints for table `ebuilds_keywords`
+--
+ALTER TABLE `ebuilds_keywords`
+  ADD CONSTRAINT `ebuilds_keywords_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_keywords_ibfk_2` FOREIGN KEY (`keyword_id`) REFERENCES `keywords` (`keyword_id`);
+
+--
+-- Constraints for table `ebuilds_metadata`
+--
+ALTER TABLE `ebuilds_metadata`
+  ADD CONSTRAINT `ebuilds_metadata_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`);
+
+--
+-- Constraints for table `ebuilds_restrictions`
+--
+ALTER TABLE `ebuilds_restrictions`
+  ADD CONSTRAINT `ebuilds_restrictions_ibfk_1` FOREIGN KEY (`ebuild_id`) REFERENCES `ebuilds` (`ebuild_id`),
+  ADD CONSTRAINT `ebuilds_restrictions_ibfk_2` FOREIGN KEY (`restriction_id`) REFERENCES `restrictions` (`restriction_id`);
+
+--
+-- Constraints for table `jobs`
+--
+ALTER TABLE `jobs`
+  ADD CONSTRAINT `jobs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `jobs_ibfk_2` FOREIGN KEY (`run_config_id`) REFERENCES `configs` (`config_id`),
+  ADD CONSTRAINT `jobs_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`job_type_id`);
+
+--
+-- Constraints for table `logs`
+--
+ALTER TABLE `logs`
+  ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`config_id`) REFERENCES `configs` (`config_id`);
+
+--
+-- Constraints for table `packages`
+--
+ALTER TABLE `packages`
+  ADD CONSTRAINT `packages_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`),
+  ADD CONSTRAINT `packages_ibfk_2` FOREIGN KEY (`repo_id`) REFERENCES `repos` (`repo_id`);
+
+DELIMITER $$
+--
+-- Events
+--
+CREATE DEFINER=`zobcs`@`localhost` EVENT `add_esync_updatedb_jobs` ON SCHEDULE EVERY 1 HOUR STARTS '2012-12-23 17:15:13' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+  CALL add_jobs('esync');
+  CALL add_jobs('updatedb');
+END$$
+
+DELIMITER ;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] dev/zorry:master commit in: gobs/sql/
@ 2012-12-21  1:05 Magnus Granberg
  0 siblings, 0 replies; 6+ messages in thread
From: Magnus Granberg @ 2012-12-21  1:05 UTC (permalink / raw
  To: gentoo-commits

commit:     837c39fb561cbf670afc0453b2b8f7f0bc3988bf
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 21 01:05:25 2012 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Fri Dec 21 01:05:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=837c39fb

Add the structur of the mysql db

---
 gobs/sql/pgdump.sql.gz |  Bin 10547 -> 0 bytes
 gobs/sql/zobcs.sql     |  412 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 412 insertions(+), 0 deletions(-)

diff --git a/gobs/sql/pgdump.sql.gz b/gobs/sql/pgdump.sql.gz
deleted file mode 100644
index d259808..0000000
Binary files a/gobs/sql/pgdump.sql.gz and /dev/null differ

diff --git a/gobs/sql/zobcs.sql b/gobs/sql/zobcs.sql
new file mode 100644
index 0000000..eb9f32d
--- /dev/null
+++ b/gobs/sql/zobcs.sql
@@ -0,0 +1,412 @@
+-- phpMyAdmin SQL Dump
+-- version 3.5.2.2
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: Dec 21, 2012 at 01:02 AM
+-- Server version: 5.5.28-MariaDB-log
+-- PHP Version: 5.4.6--pl0-gentoo
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `zobcs`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs`
+--
+
+DROP TABLE IF EXISTS `build_jobs`;
+CREATE TABLE IF NOT EXISTS `build_jobs` (
+  `build_job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `ebuild_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `status` enum('Waiting','Now') NOT NULL DEFAULT 'Waiting',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`build_job_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=15222 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_emerge_options`
+--
+
+DROP TABLE IF EXISTS `build_jobs_emerge_options`;
+CREATE TABLE IF NOT EXISTS `build_jobs_emerge_options` (
+  `build_job_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_redo`
+--
+
+DROP TABLE IF EXISTS `build_jobs_redo`;
+CREATE TABLE IF NOT EXISTS `build_jobs_redo` (
+  `build_job_id` int(11) NOT NULL COMMENT 'build job id',
+  `fail_times` int(1) NOT NULL COMMENT 'Fail times max 5',
+  `fail_type` varchar(15) NOT NULL COMMENT 'Type of fail',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Time'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Build jobs that need to be redone';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_jobs_use`
+--
+
+DROP TABLE IF EXISTS `build_jobs_use`;
+CREATE TABLE IF NOT EXISTS `build_jobs_use` (
+  `build_job_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs`
+--
+
+DROP TABLE IF EXISTS `build_logs`;
+CREATE TABLE IF NOT EXISTS `build_logs` (
+  `build_log_id` int(11) NOT NULL,
+  `ebuild_id` int(11) NOT NULL,
+  `fail` enum('True','False') NOT NULL DEFAULT 'False',
+  `summery_text` text NOT NULL,
+  `log_hash` varchar(100) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Main log info for the builds';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_config`
+--
+
+DROP TABLE IF EXISTS `build_logs_config`;
+CREATE TABLE IF NOT EXISTS `build_logs_config` (
+  `build_log_id` int(11) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `logname` varchar(150) NOT NULL COMMENT 'filename of the log'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_emerge_options`
+--
+
+DROP TABLE IF EXISTS `build_logs_emerge_options`;
+CREATE TABLE IF NOT EXISTS `build_logs_emerge_options` (
+  `build_job_id` int(11) NOT NULL,
+  `eoption_id` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_qa`
+--
+
+DROP TABLE IF EXISTS `build_logs_qa`;
+CREATE TABLE IF NOT EXISTS `build_logs_qa` (
+  `build_log_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_logs_repoman`
+--
+
+DROP TABLE IF EXISTS `build_logs_repoman`;
+CREATE TABLE IF NOT EXISTS `build_logs_repoman` (
+  `build_job_id` int(11) NOT NULL,
+  `summery_text` text NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `build_log_use`
+--
+
+DROP TABLE IF EXISTS `build_log_use`;
+CREATE TABLE IF NOT EXISTS `build_log_use` (
+  `build_log_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `categories`
+--
+
+DROP TABLE IF EXISTS `categories`;
+CREATE TABLE IF NOT EXISTS `categories` (
+  `category_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category` varchar(50) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`category_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Categories main table (C)' AUTO_INCREMENT=158 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs`
+--
+
+DROP TABLE IF EXISTS `configs`;
+CREATE TABLE IF NOT EXISTS `configs` (
+  `config_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Config index',
+  `config` varchar(100) NOT NULL COMMENT 'Box/setup',
+  `default_config` enum('True','False') NOT NULL COMMENT 'Host setup',
+  PRIMARY KEY (`config_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Main config table' AUTO_INCREMENT=3 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_emerge_options`
+--
+
+DROP TABLE IF EXISTS `configs_emerge_options`;
+CREATE TABLE IF NOT EXISTS `configs_emerge_options` (
+  `config_id` int(11) NOT NULL COMMENT 'config id',
+  `eoption_id` int(11) NOT NULL COMMENT 'emerge option id',
+  KEY `config_id` (`config_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Emerge command options for the configs';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `configs_metadata`
+--
+
+DROP TABLE IF EXISTS `configs_metadata`;
+CREATE TABLE IF NOT EXISTS `configs_metadata` (
+  `config_id` int(11) NOT NULL,
+  `profile` varchar(50) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `make_conf_text` text NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `config_error_text` text NOT NULL,
+  `updating` enum('True','False') NOT NULL,
+  `status` enum('Waiting','Runing','Stoped') NOT NULL,
+  `auto` enum('True','False') NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Config Status';
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds`
+--
+
+DROP TABLE IF EXISTS `ebuilds`;
+CREATE TABLE IF NOT EXISTS `ebuilds` (
+  `ebuild_id` int(11) NOT NULL AUTO_INCREMENT,
+  `package_id` int(11) NOT NULL,
+  `version` varchar(50) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL DEFAULT 'True',
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`ebuild_id`),
+  KEY `package_id` (`package_id`),
+  KEY `checksum` (`checksum`),
+  KEY `version` (`version`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Version main table (V)' AUTO_INCREMENT=32628 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_iuse`
+--
+
+DROP TABLE IF EXISTS `ebuilds_iuse`;
+CREATE TABLE IF NOT EXISTS `ebuilds_iuse` (
+  `ebuild_id` int(11) NOT NULL,
+  `use_id` int(11) NOT NULL,
+  `status` enum('True','False') NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_keywords`
+--
+
+DROP TABLE IF EXISTS `ebuilds_keywords`;
+CREATE TABLE IF NOT EXISTS `ebuilds_keywords` (
+  `ebuild_id` int(11) NOT NULL,
+  `keyword_id` int(11) NOT NULL,
+  `status` enum('Stable','Unstable','Negative') NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_metadata`
+--
+
+DROP TABLE IF EXISTS `ebuilds_metadata`;
+CREATE TABLE IF NOT EXISTS `ebuilds_metadata` (
+  `ebuild_id` int(11) NOT NULL,
+  `revision` varchar(10) NOT NULL COMMENT 'CVS revision'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `ebuilds_restrictions`
+--
+
+DROP TABLE IF EXISTS `ebuilds_restrictions`;
+CREATE TABLE IF NOT EXISTS `ebuilds_restrictions` (
+  `ebuild_id` int(11) NOT NULL,
+  `restriction_id` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `emerge_options`
+--
+
+DROP TABLE IF EXISTS `emerge_options`;
+CREATE TABLE IF NOT EXISTS `emerge_options` (
+  `eoption_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'emerge command options id',
+  `eoption` varchar(15) NOT NULL COMMENT 'emerge command options',
+  PRIMARY KEY (`eoption_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `jobs`
+--
+
+DROP TABLE IF EXISTS `jobs`;
+CREATE TABLE IF NOT EXISTS `jobs` (
+  `job_id` int(11) NOT NULL AUTO_INCREMENT,
+  `job` enum('updatedb','gitsync','esync','lsync') NOT NULL,
+  `status` enum('Runing','Done','Waiting') NOT NULL,
+  `user` varchar(20) NOT NULL,
+  `config_id` int(11) NOT NULL,
+  `run_config_id` int(11) NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`job_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `keywords`
+--
+
+DROP TABLE IF EXISTS `keywords`;
+CREATE TABLE IF NOT EXISTS `keywords` (
+  `keyword_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'keyword index',
+  `keyword` varchar(15) NOT NULL COMMENT 'keyword',
+  PRIMARY KEY (`keyword_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='KEYWORD' AUTO_INCREMENT=41 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `logs`
+--
+
+DROP TABLE IF EXISTS `logs`;
+CREATE TABLE IF NOT EXISTS `logs` (
+  `log_id` int(11) NOT NULL AUTO_INCREMENT,
+  `config_id` int(11) NOT NULL,
+  `log_type` enum('info','error','debug') NOT NULL,
+  `msg` text NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`log_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=185787 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `packages`
+--
+
+DROP TABLE IF EXISTS `packages`;
+CREATE TABLE IF NOT EXISTS `packages` (
+  `package_id` int(11) NOT NULL AUTO_INCREMENT,
+  `category_id` int(11) NOT NULL,
+  `package` varchar(50) NOT NULL,
+  `repo_id` int(11) NOT NULL,
+  `checksum` varchar(100) NOT NULL,
+  `active` enum('True','False') NOT NULL,
+  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`package_id`),
+  KEY `category_id` (`category_id`),
+  KEY `repo_id` (`repo_id`),
+  KEY `checksum` (`checksum`),
+  KEY `package` (`package`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Packages main table (P)' AUTO_INCREMENT=16312 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `repos`
+--
+
+DROP TABLE IF EXISTS `repos`;
+CREATE TABLE IF NOT EXISTS `repos` (
+  `repo_id` int(11) NOT NULL AUTO_INCREMENT,
+  `repo` varchar(100) NOT NULL,
+  PRIMARY KEY (`repo_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Repo main table (repo)' AUTO_INCREMENT=3 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `restrictions`
+--
+
+DROP TABLE IF EXISTS `restrictions`;
+CREATE TABLE IF NOT EXISTS `restrictions` (
+  `restriction_id` int(11) NOT NULL AUTO_INCREMENT,
+  `restriction` varchar(50) NOT NULL,
+  PRIMARY KEY (`restriction_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `uses`
+--
+
+DROP TABLE IF EXISTS `uses`;
+CREATE TABLE IF NOT EXISTS `uses` (
+  `use_id` int(11) NOT NULL AUTO_INCREMENT,
+  `flag` varchar(50) NOT NULL,
+  PRIMARY KEY (`use_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Use flags main table' AUTO_INCREMENT=4606 ;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] dev/zorry:master commit in: gobs/sql/
@ 2011-11-02 16:24 Magnus Granberg
  0 siblings, 0 replies; 6+ messages in thread
From: Magnus Granberg @ 2011-11-02 16:24 UTC (permalink / raw
  To: gentoo-commits

commit:     0f5fb0f0c94150c2922a9ca11415dd4efd03e7e4
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  2 16:24:03 2011 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Wed Nov  2 16:24:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=0f5fb0f0

 Updated pg structure db

---
 gobs/sql/pgdump.sql.gz |  Bin 7741 -> 10547 bytes
 1 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/gobs/sql/pgdump.sql.gz b/gobs/sql/pgdump.sql.gz
index 9c4cd52..d259808 100644
Binary files a/gobs/sql/pgdump.sql.gz and b/gobs/sql/pgdump.sql.gz differ



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [gentoo-commits] dev/zorry:master commit in: gobs/sql/
@ 2011-04-25 10:35 Magnus Granberg
  0 siblings, 0 replies; 6+ messages in thread
From: Magnus Granberg @ 2011-04-25 10:35 UTC (permalink / raw
  To: gentoo-commits

commit:     c517b7fa57b7a9ff4ab11bb1a10816b081fba86b
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 25 10:34:15 2011 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 10:34:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=c517b7fa

added the pg sql dump

---
 gobs/sql/pgdump.sql | 1852 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1852 insertions(+), 0 deletions(-)

diff --git a/gobs/sql/pgdump.sql b/gobs/sql/pgdump.sql
new file mode 100644
index 0000000..2058353
--- /dev/null
+++ b/gobs/sql/pgdump.sql
@@ -0,0 +1,1852 @@
+--
+-- PostgreSQL database dump
+--
+
+SET statement_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = off;
+SET check_function_bodies = false;
+SET client_min_messages = warning;
+SET escape_string_warning = off;
+
+--
+-- Name: buildhost; Type: COMMENT; Schema: -; Owner: pgadmin
+--
+
+COMMENT ON DATABASE buildhost IS 'The main db for the gobs';
+
+
+--
+-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
+--
+
+CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;
+
+
+ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;
+
+SET search_path = public, pg_catalog;
+
+--
+-- Name: ebuild_package; Type: TYPE; Schema: public; Owner: pgadmin
+--
+
+CREATE TYPE ebuild_package AS (
+	ebuild integer,
+	package integer
+);
+
+
+ALTER TYPE public.ebuild_package OWNER TO pgadmin;
+
+--
+-- Name: comparearrays(anyarray, anyarray); Type: FUNCTION; Schema: public; Owner: pgadmin
+--
+
+CREATE FUNCTION comparearrays(oldarray anyarray, newarray anyarray) RETURNS anyarray
+    LANGUAGE plpgsql IMMUTABLE
+    AS $$
+  DECLARE 
+  returnArray oldArray%TYPE;
+
+  BEGIN
+--figure out if the new array contians the old one if that is true do nothing if not iterate over the old array and remove those that isnt in the new one.
+  IF oldArray <@ newArray=FALSE THEN
+    FOR i IN array_lower(oldArray,1)..array_upper(oldArray,1) LOOP
+      IF newArray@> ARRAY[oldArray[i]] = FALSE THEN
+	SELECT array_append(returnArray, oldArray[i]) into returnArray;
+      END IF;
+    END LOOP;
+   END IF;
+    RETURN returnArray;
+  END;
+
+$$;
+
+
+ALTER FUNCTION public.comparearrays(oldarray anyarray, newarray anyarray) OWNER TO pgadmin;
+
+--
+-- Name: insert_buildqueue(integer, character varying, character varying[], boolean[], text); Type: FUNCTION; Schema: public; Owner: pgadmin
+--
+
+CREATE FUNCTION insert_buildqueue(ebuildid integer, buildhost character varying, inuseflags character varying[], inenabled boolean[], message text) RETURNS integer
+    LANGUAGE plpgsql
+    AS $$
+  DECLARE
+    oldQid INTEGER[];
+    result BOOLEAN;
+    ret INTEGER;
+
+  BEGIN
+    -- find out if the buildhost haves the ebuild in the query
+    SELECT ARRAY(SELECT queue_id FROM buildqueue WHERE ebuild_id=ebuildID AND config=buildhost) INTO oldQid;
+    -- if not NULL check if the useflags have changed if there is any "new" useflags
+    IF inUseFlags IS NOT NULL AND array_lower(oldQid,1) IS NOT NULL THEN
+      --add the new useflags to a temp table
+      CREATE TEMPORARY TABLE mid(
+	useflag VARCHAR(128) NOT NULL,
+	enabled BOOLEAN NOT NULL
+      );
+      
+      FOR i IN array_lower(inUseFlags,1)..array_upper(inUseFlags,1) LOOP
+	INSERT INTO mid(useflag,enabled) VALUES(inUseFlags[i], inEnabled[i]);
+      END LOOP;
+
+
+    -- finally check if the useflags have changed since the queued version
+      FOR i IN array_lower(oldQid,1)..array_upper(oldQid,1) LOOP
+	PERFORM useflag,enabled FROM mid EXCEPT SELECT useflag,enabled FROM ebuildQueuedWithUses WHERE queue_id=oldQid[i] ORDER BY useflag;
+	ret:=oldQid[i];
+	IF NOT FOUND THEN
+	  PERFORM useflag,enabled FROM ebuildQueuedWithUses WHERE queue_id=oldQid[i] EXCEPT SELECT useflag,enabled FROM mid ORDER BY useflag;
+	  IF FOUND THEN
+	    result:=TRUE;
+	    EXIT;  
+	  END IF;
+	ELSE
+	  result:=TRUE;
+	  EXIT;
+	END IF;
+      END LOOP;
+    -- if result is null the useflags havent changed then dont add the ebuild to the queue
+      IF result IS TRUE THEN
+	INSERT INTO buildqueue(ebuild_id,config,post_message,timestamp) VALUES(ebuildID,buildhost,message,now()) RETURNING queue_id INTO ret;
+	FOR i IN array_lower(inUseFlags,1)..array_upper(inUseFlags,1) LOOP
+	  INSERT INTO useflags(useflag) SELECT inUseFlags[i] WHERE inUseFlags[i] NOT IN(SELECT useflag FROM useflags);
+	  INSERT INTO ebuildQueuedWithUses(useflag,enabled,queue_id) VALUES(inUseFlags[i],inEnabled[i],ret);
+	END LOOP;	
+      END IF;
+      DROP TABLE mid;
+    ELSE
+    --insert a new build with out hassle
+      IF inUseFlags IS NOT NULL THEN -- (oldQid IS EMPTY)
+	INSERT INTO buildqueue(ebuild_id,config,post_message,timestamp) VALUES(ebuildID,buildhost,message,now()) RETURNING queue_id INTO ret;
+	FOR i IN array_lower(inUseFlags,1)..array_upper(inUseFlags,1) LOOP
+	    INSERT INTO useflags(useflag) SELECT inUseFlags[i] WHERE inUseFlags[i] NOT IN(SELECT useflag FROM useflags);
+	    INSERT INTO ebuildQueuedWithUses(useflag,enabled,queue_id) VALUES(inUseFlags[i],inEnabled[i],ret);
+	END LOOP;
+	
+      ELSE
+	-- corner case if the ebuild haves 0 useflags
+	IF array_lower(oldQid,1) IS NULL THEN
+	  INSERT INTO buildqueue(ebuild_id,config,post_message,timestamp) VALUES(ebuildID,buildhost,message,now())RETURNING queue_id INTO ret;	
+
+	ELSE
+	  FOR i IN array_lower(oldQid,1)..array_upper(oldQid,1) LOOP
+	    SElECT queue_id FROM buildqueue WHERE queue_id=oldQid[i] AND queue_id NOT IN(SELECT queue_id FROM ebuildQueuedWithUses WHERE queue_id=oldQid[i]) INTO ret;
+	    IF FOUND THEN
+	      result=TRUE;
+	      EXIT;
+	    END IF;
+	  END LOOP;
+
+	  IF result IS NOT TRUE THEN
+	    -- double corner case where an ebuild exists in the queue with one or more useflags and we are adding a new build with NO useflags
+	    INSERT INTO buildqueue(ebuild_id,config,useflags,post_message,timestamp) VALUES(ebuildID,buildhost,NULL,message,now())RETURNING queue_id INTO ret;
+	  END IF;
+	
+	END IF;	
+      END IF; 
+    END IF;
+    RETURN ret;
+  END;
+$$;
+
+
+ALTER FUNCTION public.insert_buildqueue(ebuildid integer, buildhost character varying, inuseflags character varying[], inenabled boolean[], message text) OWNER TO pgadmin;
+
+--
+-- Name: insert_ebuild(character varying, character varying, character varying, character varying, character varying, text, text, text, text, character varying, text, text, text, text, text, text, text, character varying, text, text, boolean); Type: FUNCTION; Schema: public; Owner: pgadmin
+--
+
+CREATE FUNCTION insert_ebuild(incategory character varying, inpackage_name character varying, inebuild_version character varying, inlive_version character varying, inebuild_checksum character varying, inebuild_text text, independ text, inrdepend text, inpdepend text, inslot character varying, insrc_url text, inhomepage text, inlicense text, indescription text, ininherited text, inrequired_use text, inprovides text, ineapi character varying, inproperties text, indefined_phases text, inactive boolean) RETURNS integer[]
+    LANGUAGE plpgsql
+    AS $$
+  DECLARE
+    act BOOLEAN;
+    ebuild_package INTEGER[];
+    var INTEGER;
+
+  BEGIN
+  --check if the category exists if not create it
+    INSERT INTO categories(category) SELECT inCategory 
+      WHERE incategory NOT IN(
+	SELECT category FROM categories WHERE category=inCategory);
+
+    --check if the package exists if not create it
+    ebuild_package[0]:= package_id FROM packages WHERE category=inCategory AND package_name=inPackage_name;
+    
+    IF ebuild_package[0] ISNULL THEN
+      INSERT INTO packages VALUES(DEFAULT, inCategory, inPackage_name) RETURNING package_id INTO var;
+      ebuild_package[0]:=var;
+    END IF;
+
+    IF inActive IS NULL OR inActive IS TRUE THEN
+      act=TRUE;
+    END IF;
+
+    --insert the new ebuild and put new ebuild ID into a variable and return it
+    INSERT INTO ebuilds(package_id,ebuild_version,live_version,ebuild_checksum,ebuild_text,depend,rdepend,pdepend,slot,src_url,homepage,license,description,inherited,required_use,provides,eapi,properties,defined_phases,active)
+    VALUES(ebuild_package[0],inEbuild_version,inLive_version,inEbuild_checksum,inEbuild_text,inDepend,inRdepend,inPdepend,inSlot,inSrc_url,inHomepage,inLicense,inDescription,inInherited,inRequired_use,inProvides,inEapi,inProperties,inDefined_phases,act) 
+    RETURNING id INTO var;
+    ebuild_package[1]:=var;
+-- if the ebuild was added as active add the current time to the timestamp field
+    
+    IF act IS TRUE THEN
+      UPDATE ebuilds SET timestamp=now() WHERE id=ebuild_package[1]; 
+    END IF;
+
+    RETURN ebuild_package;
+  END;
+$$;
+
+
+ALTER FUNCTION public.insert_ebuild(incategory character varying, inpackage_name character varying, inebuild_version character varying, inlive_version character varying, inebuild_checksum character varying, inebuild_text text, independ text, inrdepend text, inpdepend text, inslot character varying, insrc_url text, inhomepage text, inlicense text, indescription text, ininherited text, inrequired_use text, inprovides text, ineapi character varying, inproperties text, indefined_phases text, inactive boolean) OWNER TO pgadmin;
+
+--
+-- Name: make_buildlog(integer, text, text, text, text[], text[]); Type: FUNCTION; Schema: public; Owner: pgadmin
+--
+
+CREATE FUNCTION make_buildlog(inqueue_id integer, inerror text, inbuild text, inlogfilename text, qaproblems text[], repomanproblems text[]) RETURNS integer
+    LANGUAGE plpgsql
+    AS $$
+--inQeue_id is the id of the queue "item" that is going to be moved or simply dropped
+--inError being the error_summary we want to put into the buildlog table
+--inBuild is the build_error (same as above)
+  DECLARE
+    ret INTEGER;
+    Eid INTEGER;
+    conf VARCHAR(100);
+    time TIMESTAMP;
+    use VARCHAR(128)[];
+    en BOOLEAN[];
+    inHash TEXT;
+    hashs TEXT[];
+    FOUND BOOLEAN;
+    qaString TEXT;
+    repoString TEXT;
+
+  BEGIN
+    FOUND=NULL;
+    SELECT ebuild_id,config,timestamp FROM buildqueue WHERE queue_id=inQueue_id INTO Eid,conf,time;
+    --check if there exists a buildlog item against the same ebuild if not dont check the hashs
+    SELECT ARRAY(SELECT hash FROM buildlog WHERE ebuild_id=Eid AND config=conf) INTO hashs;
+    --setup the strings build from the QA/repoman context
+    SELECT array_to_string(qaProblems,':') INTO qaString;
+    SELECT array_to_string(repomanProblems,':') INTO repoString;
+    --generate hash of the new buildlog item (that dosent exists in the table yet)
+    IF qaString IS NOT NULL AND repoString IS NOT NULL THEN
+      inhash:=qaString||repoString;
+    ELSE
+      IF qaString IS NOT NULL THEN
+	inHash:=qaString;
+      END IF;
+      IF repoString IS NOT NULL THEN
+	inHash:=repoString;
+      END IF;
+      SELECT md5(CAST((Eid||conf||inError||inBuild||inHash)AS text)) INTO inHash;
+    END IF;
+    IF qaString IS NULL AND repoString IS NULL THEN
+	SELECT md5(CAST((Eid||conf||inError||inBuild) AS text)) INTO inHash;
+    END IF;
+    IF array_lower(hashs,1) IS NOT NULL THEN
+    FOUND=FALSE;
+      FOR i IN array_lower(hashs,1)..array_upper(hashs,1) LOOP
+	--compare the hash`s and exit out of the loop when a match is found
+	IF hashs[i]=inHash THEN
+	  FOUND=TRUE;
+	  EXIT;
+	END IF;
+      END LOOP;
+    END IF;
+    
+    --if no matching hashs are found 
+      RAISE NOTICE 'found is: %', FOUND;
+    IF FOUND IS FALSE OR FOUND IS NULL THEN
+      --insert the build log yay
+      INSERT INTO buildlog(ebuild_id,config,timestamp,error_summary,build_error,hash,logfileName) VALUES(Eid,conf,time,inError,inBuild,inHash,inLogFileName) RETURNING build_id INTO ret;
+      --insert the useflags
+      SELECT ARRAY(SELECT useflag FROM ebuildQueuedWithUses WHERE queue_id=inQueue_id ORDER BY useflag) INTO use;
+      SELECT ARRAY(SELECT enabled FROM ebuildQueuedWithUses WHERE queue_id=inQueue_id ORDER BY useflag) INTO en;
+      IF array_lower(en,1) IS NOT NULL THEN
+	FOR i IN array_lower(use,1)..array_upper(use,1) LOOP
+	  INSERT INTO ebuildBuildWithUses(useflag,enabled,build_id) VALUES(use[i],en[i],ret);
+	END LOOP;
+      END IF;
+
+    --insert the qaProblems and repoman Problems
+      IF array_lower(qaProblems,1) IS NOT NULL THEN
+	FOR i in array_lower(qaProblems,1)..array_upper(qaProblems,1) LOOP
+	  INSERT INTO QA_problems(problem,build_id) VALUES(qaProblems[i],ret);
+	END LOOP;
+      END IF;
+
+      IF array_lower(repomanProblems,1) IS NOT NULL THEN
+	FOR i in array_lower(repomanProblems,1)..array_upper(repomanProblems,1) LOOP
+	  INSERT INTO repoman_problems(problem,build_id) VALUES(repomanProblems[i],ret);
+	END LOOP;
+      END IF;
+    END IF;
+    --always delete the queue entry even if it is a duplicate
+    DELETE FROM ebuildQueuedWithUses WHERE queue_id=inQueue_id;
+    DELETE FROM buildqueue WHERE queue_id=inQueue_id;
+    RETURN ret;
+  END;
+$$;
+
+
+ALTER FUNCTION public.make_buildlog(inqueue_id integer, inerror text, inbuild text, inlogfilename text, qaproblems text[], repomanproblems text[]) OWNER TO pgadmin;
+
+--
+-- Name: updateiuse(integer, character varying[]); Type: FUNCTION; Schema: public; Owner: pgadmin
+--
+
+CREATE FUNCTION updateiuse(ebuildid integer, iniuses character varying[]) RETURNS void
+    LANGUAGE plpgsql
+    AS $$  DECLARE
+   oldIuses VARCHAR[];
+   deletIuses VARCHAR[];
+   explicitNewIuses VARCHAR[];
+
+  BEGIN
+
+-- add iuses to the ebuild in question
+
+    IF inIuses IS NOT NULL THEN 
+    --find all the old iuses (if any) that needs to be deleted
+      SELECT ARRAY(SELECT iuse FROM ebuildHavesIuses WHERE ebuild_id=ebuildID) INTO oldIuses;
+    
+
+      -- IF there is any old iuses we need to find those that needs to be removed (because of updated ebuild etc).
+      IF oldIuses IS NOT NULL THEN
+	SELECT compareArrays(oldIuses,inIuses)INTO deletIuses;
+	IF deletIuses IS NOT NULL THEN
+	  FOR i IN array_lower(deletIuses,1)..array_upper(deletIuses,1) LOOP
+	    DELETE FROM ebuildHavesIuses WHERE ebuild_id=ebuildID AND iuse=deletIuses[i];
+	  END LOOP;
+	END IF;
+	-- Find all the new iuses that isnt present in the oldIuses array.
+	SELECT compareArrays(inIuses,oldIuses) INTO explicitNewIuses;
+      END IF;
+
+      -- Time to add the new iuses (if any) to the iuses table and
+      -- Then add the new iuses to the ebuildHavesIuses table.
+	IF explicitNewIuses IS NOT NULL THEN
+	  FOR i IN array_lower(explicitNewIuses,1)..array_upper(explicitNewIuses,1) LOOP
+	    INSERT INTO iuses(iuse) SELECT explicitNewIuses[i] 
+	      WHERE explicitNewIuses[i] NOT IN(
+		SELECT iuse FROM iuses WHERE iuse=explicitNewIuses[i]);
+	
+	      INSERT INTO ebuildHavesIuses(ebuild_id,iuse) VALUES(ebuildID, explicitNewIuses[i]);
+	  END LOOP;
+	END IF;
+    ELSE
+    -- if inIuses is NULL simply delete all isuses 
+      DELETE FROM ebuildHavesIuses WHERE ebuild_id=ebuildID;
+    END IF;
+  END;
+
+$$;
+
+
+ALTER FUNCTION public.updateiuse(ebuildid integer, iniuses character varying[]) OWNER TO pgadmin;
+
+--
+-- Name: updatekeywords(integer, character varying[]); Type: FUNCTION; Schema: public; Owner: pgadmin
+--
+
+CREATE FUNCTION updatekeywords(ebuildid integer, inkeywords character varying[]) RETURNS void
+    LANGUAGE plpgsql
+    AS $$
+  DECLARE
+   oldKeywords VARCHAR[];
+   deletKeywords VARCHAR[];
+   explicitNewKeywords VARCHAR[];
+
+  BEGIN
+
+    IF inKeywords IS NOT NULL THEN 
+    --find all the old keywords (if any) that needs to be deleted
+      SELECT ARRAY(SELECT keyword FROM ebuildHavesKeywords WHERE ebuild_id=ebuildID) INTO oldKeywords;
+
+      -- IF there is any old keywords we need to find those that needs to be removed (because of updated ebuild etc).
+      IF oldKeywords IS NOT NULL THEN
+	SELECT compareArrays(oldKeywords,inKeywords)INTO deletKeywords;
+	IF deletKeywords IS NOT NULL THEN
+	  FOR i IN array_lower(deletKeywords,1)..array_upper(deletKeywords,1) LOOP
+	    DELETE FROM ebuildHavesKeywords WHERE ebuild_id=ebuildID AND keyword=deletKeywords[i];
+	  END LOOP;
+	END IF;
+	-- Find all the new restrictions that isnt present in the oldKeywords array.
+	SELECT compareArrays(inKeywords,oldKeywords) INTO explicitNewKeywords;
+      END IF;
+
+
+	-- Add the new keywords to the ebuildHavesIuses table.
+	IF explicitNewKeywords IS NOT NULL THEN
+	  FOR i IN array_lower(explicitNewKeywords,1)..array_upper(explicitNewKeywords,1) LOOP
+	      INSERT INTO ebuildHavesKeywords(ebuild_id,keyword) VALUES(ebuildID, explicitNewKeywords[i]);
+	  END LOOP;
+	END IF;
+    ELSE
+      --if inkeywords is NULL then remove all keywords from the ebuild
+      DELETE FROM ebuildHavesKeywords WHERE ebuild_id=ebuildID;
+    END IF;
+  END;
+
+$$;
+
+
+ALTER FUNCTION public.updatekeywords(ebuildid integer, inkeywords character varying[]) OWNER TO pgadmin;
+
+--
+-- Name: updaterestrictions(integer, character varying[]); Type: FUNCTION; Schema: public; Owner: pgadmin
+--
+
+CREATE FUNCTION updaterestrictions(ebuildid integer, inrestrictions character varying[]) RETURNS void
+    LANGUAGE plpgsql
+    AS $$
+  DECLARE
+   oldRestrictions VARCHAR[];
+   deletRestrictions VARCHAR[];
+   explicitNewRestrictions VARCHAR[];
+
+  BEGIN
+
+    IF inRestrictions IS NOT NULL THEN
+    --find all the old restrictions (if any) that needs to be deleted
+      SELECT ARRAY(SELECT restriction FROM ebuildHavesRestrictions WHERE ebuild_id=ebuildID) INTO oldRestrictions;
+
+      -- IF there is any old restrictions we need to find those that needs to be removed (because of updated ebuild etc).
+      IF oldRestrictions IS NOT NULL THEN
+	SELECT compareArrays(oldRestrictions,inRestrictions)INTO deletRestrictions;
+	IF deletRestrictions IS NOT NULL THEN
+	  FOR i IN array_lower(deletRestrictions,1)..array_upper(deletRestrictions,1) LOOP
+	    DELETE FROM ebuildHavesRestrictions WHERE ebuild_id=ebuildID AND restriction=deletRestrictions[i];
+	  END LOOP;
+	END IF;
+	-- Find all the new restrictions that isnt present in the oldRestrictions array.
+	SELECT compareArrays(inRestrictions,oldRestrictions) INTO explicitNewRestrictions;
+      END IF;
+
+
+	-- Add the new restriction to the ebuildHavesRestrictions table.
+	IF explicitNewRestrictions IS NOT NULL THEN
+	  FOR i IN array_lower(explicitNewRestrictions,1)..array_upper(explicitNewRestrictions,1) LOOP
+	       INSERT INTO restrictions(restriction_name) SELECT explicitNewRestrictions[i] 
+		WHERE explicitNewRestrictions[i] NOT IN(
+		  SELECT restriction_name FROM restrictions WHERE restriction_name=explicitNewRestrictions[i]);
+	      INSERT INTO ebuildHavesRestrictions(ebuild_id,restriction) VALUES(ebuildID, explicitNewRestrictions[i]);
+	  END LOOP;
+	END IF;
+    ELSE
+      --delete all restrictions if any on the ebuild
+	DELETE FROM ebuildHavesRestrictions WHERE ebuild_id=ebuildID;
+    END IF;
+  END;
+
+$$;
+
+
+ALTER FUNCTION public.updaterestrictions(ebuildid integer, inrestrictions character varying[]) OWNER TO pgadmin;
+
+SET default_tablespace = '';
+
+SET default_with_oids = false;
+
+--
+-- Name: buildlog; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE buildlog (
+    build_id integer NOT NULL,
+    ebuild_id integer,
+    config character varying(100),
+    "timestamp" timestamp without time zone NOT NULL,
+    error_summary text,
+    build_error text,
+    hash text NOT NULL,
+    logfilename text
+);
+
+
+ALTER TABLE public.buildlog OWNER TO pgadmin;
+
+--
+-- Name: buildlog_build_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE buildlog_build_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.buildlog_build_id_seq OWNER TO pgadmin;
+
+--
+-- Name: buildlog_build_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE buildlog_build_id_seq OWNED BY buildlog.build_id;
+
+
+--
+-- Name: buildqueue; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE buildqueue (
+    queue_id integer NOT NULL,
+    ebuild_id integer,
+    config character varying(100),
+    post_message text,
+    "timestamp" timestamp without time zone
+);
+
+
+ALTER TABLE public.buildqueue OWNER TO pgadmin;
+
+--
+-- Name: buildqueue_queue_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE buildqueue_queue_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.buildqueue_queue_id_seq OWNER TO pgadmin;
+
+--
+-- Name: buildqueue_queue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE buildqueue_queue_id_seq OWNED BY buildqueue.queue_id;
+
+
+--
+-- Name: categories; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE categories (
+    category character varying(30) NOT NULL
+);
+
+
+ALTER TABLE public.categories OWNER TO pgadmin;
+
+--
+-- Name: categories_meta; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE categories_meta (
+    category character varying(30) NOT NULL,
+    metadata_xml_checksum character varying(70) NOT NULL,
+    metadata_xml_text text NOT NULL
+);
+
+
+ALTER TABLE public.categories_meta OWNER TO pgadmin;
+
+--
+-- Name: configs; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE configs (
+    id character varying(100) NOT NULL,
+    profile character varying(30) NOT NULL,
+    arch character varying(10) NOT NULL,
+    default_config boolean DEFAULT false NOT NULL,
+    make_conf_text text NOT NULL,
+    make_conf_checksum character varying(80) NOT NULL,
+    active boolean DEFAULT false NOT NULL,
+    config_error text,
+    updateing boolean DEFAULT false NOT NULL,
+    auto boolean DEFAULT true NOT NULL
+);
+
+
+ALTER TABLE public.configs OWNER TO pgadmin;
+
+--
+-- Name: ebuildbuildwithuses; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE ebuildbuildwithuses (
+    id integer NOT NULL,
+    useflag character varying(128),
+    enabled boolean NOT NULL,
+    build_id integer
+);
+
+
+ALTER TABLE public.ebuildbuildwithuses OWNER TO pgadmin;
+
+--
+-- Name: ebuildbuildwithuses_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE ebuildbuildwithuses_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ebuildbuildwithuses_id_seq OWNER TO pgadmin;
+
+--
+-- Name: ebuildbuildwithuses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE ebuildbuildwithuses_id_seq OWNED BY ebuildbuildwithuses.id;
+
+
+--
+-- Name: ebuildhavesiuses; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE ebuildhavesiuses (
+    id integer NOT NULL,
+    ebuild_id integer,
+    iuse character varying(128)
+);
+
+
+ALTER TABLE public.ebuildhavesiuses OWNER TO pgadmin;
+
+--
+-- Name: ebuildhavesiuses_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE ebuildhavesiuses_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ebuildhavesiuses_id_seq OWNER TO pgadmin;
+
+--
+-- Name: ebuildhavesiuses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE ebuildhavesiuses_id_seq OWNED BY ebuildhavesiuses.id;
+
+
+--
+-- Name: ebuildhaveskeywords; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE ebuildhaveskeywords (
+    id integer NOT NULL,
+    ebuild_id integer,
+    keyword character varying(25)
+);
+
+
+ALTER TABLE public.ebuildhaveskeywords OWNER TO pgadmin;
+
+--
+-- Name: ebuildhaveskeywords_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE ebuildhaveskeywords_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ebuildhaveskeywords_id_seq OWNER TO pgadmin;
+
+--
+-- Name: ebuildhaveskeywords_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE ebuildhaveskeywords_id_seq OWNED BY ebuildhaveskeywords.id;
+
+
+--
+-- Name: ebuildhavesrestrictions; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE ebuildhavesrestrictions (
+    ebuildtorestriction_id integer NOT NULL,
+    ebuild_id integer,
+    restriction character varying(20)
+);
+
+
+ALTER TABLE public.ebuildhavesrestrictions OWNER TO pgadmin;
+
+--
+-- Name: ebuildhavesrestrictions_ebuildtorestriction_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE ebuildhavesrestrictions_ebuildtorestriction_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ebuildhavesrestrictions_ebuildtorestriction_id_seq OWNER TO pgadmin;
+
+--
+-- Name: ebuildhavesrestrictions_ebuildtorestriction_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE ebuildhavesrestrictions_ebuildtorestriction_id_seq OWNED BY ebuildhavesrestrictions.ebuildtorestriction_id;
+
+
+--
+-- Name: ebuildqueuedwithuses; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE ebuildqueuedwithuses (
+    id integer NOT NULL,
+    useflag character varying(128),
+    enabled boolean NOT NULL,
+    queue_id integer
+);
+
+
+ALTER TABLE public.ebuildqueuedwithuses OWNER TO pgadmin;
+
+--
+-- Name: ebuildqueuedwithuses_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE ebuildqueuedwithuses_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ebuildqueuedwithuses_id_seq OWNER TO pgadmin;
+
+--
+-- Name: ebuildqueuedwithuses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE ebuildqueuedwithuses_id_seq OWNED BY ebuildqueuedwithuses.id;
+
+
+--
+-- Name: ebuilds; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE ebuilds (
+    id integer NOT NULL,
+    package_id integer,
+    ebuild_version character varying(30) NOT NULL,
+    live_version character varying(30) NOT NULL,
+    ebuild_checksum character varying(70) NOT NULL,
+    ebuild_text text,
+    depend text,
+    rdepend text,
+    pdepend text,
+    slot character varying(30),
+    src_url text NOT NULL,
+    homepage text NOT NULL,
+    license text,
+    description text NOT NULL,
+    inherited text,
+    required_use text,
+    provides text,
+    eapi character varying(5) NOT NULL,
+    properties text,
+    defined_phases text,
+    "timestamp" timestamp without time zone,
+    active boolean NOT NULL
+);
+
+
+ALTER TABLE public.ebuilds OWNER TO pgadmin;
+
+--
+-- Name: ebuilds_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE ebuilds_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ebuilds_id_seq OWNER TO pgadmin;
+
+--
+-- Name: ebuilds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE ebuilds_id_seq OWNED BY ebuilds.id;
+
+
+--
+-- Name: iuses; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE iuses (
+    iuse character varying(128) NOT NULL
+);
+
+
+ALTER TABLE public.iuses OWNER TO pgadmin;
+
+--
+-- Name: keywords; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE keywords (
+    keyword character varying(25) NOT NULL
+);
+
+
+ALTER TABLE public.keywords OWNER TO pgadmin;
+
+--
+-- Name: manifest; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE manifest (
+    id integer NOT NULL,
+    package_id integer,
+    manifest text NOT NULL,
+    checksum character varying(70) NOT NULL
+);
+
+
+ALTER TABLE public.manifest OWNER TO pgadmin;
+
+--
+-- Name: manifest_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE manifest_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.manifest_id_seq OWNER TO pgadmin;
+
+--
+-- Name: manifest_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE manifest_id_seq OWNED BY manifest.id;
+
+
+--
+-- Name: packages; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE packages (
+    package_id integer NOT NULL,
+    category character varying(30),
+    package_name character varying(75) NOT NULL
+);
+
+
+ALTER TABLE public.packages OWNER TO pgadmin;
+
+--
+-- Name: packages_meta; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE packages_meta (
+    package_id integer NOT NULL,
+    changelog_text text,
+    changelog_checksum character varying(70),
+    metadata_text text,
+    metadata_checksum character varying(70)
+);
+
+
+ALTER TABLE public.packages_meta OWNER TO pgadmin;
+
+--
+-- Name: packages_package_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE packages_package_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.packages_package_id_seq OWNER TO pgadmin;
+
+--
+-- Name: packages_package_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE packages_package_id_seq OWNED BY packages.package_id;
+
+
+--
+-- Name: qa_problems; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE qa_problems (
+    id integer NOT NULL,
+    problem text NOT NULL,
+    build_id integer
+);
+
+
+ALTER TABLE public.qa_problems OWNER TO pgadmin;
+
+--
+-- Name: qa_problems_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE qa_problems_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.qa_problems_id_seq OWNER TO pgadmin;
+
+--
+-- Name: qa_problems_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE qa_problems_id_seq OWNED BY qa_problems.id;
+
+
+--
+-- Name: repoman_problems; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE repoman_problems (
+    id integer NOT NULL,
+    problem text NOT NULL,
+    build_id integer
+);
+
+
+ALTER TABLE public.repoman_problems OWNER TO pgadmin;
+
+--
+-- Name: repoman_problems_id_seq; Type: SEQUENCE; Schema: public; Owner: pgadmin
+--
+
+CREATE SEQUENCE repoman_problems_id_seq
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.repoman_problems_id_seq OWNER TO pgadmin;
+
+--
+-- Name: repoman_problems_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pgadmin
+--
+
+ALTER SEQUENCE repoman_problems_id_seq OWNED BY repoman_problems.id;
+
+
+--
+-- Name: restrictions; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE restrictions (
+    restriction_name character varying(20) NOT NULL
+);
+
+
+ALTER TABLE public.restrictions OWNER TO pgadmin;
+
+--
+-- Name: useflags; Type: TABLE; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE TABLE useflags (
+    useflag character varying(128) NOT NULL
+);
+
+
+ALTER TABLE public.useflags OWNER TO pgadmin;
+
+--
+-- Name: build_id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE buildlog ALTER COLUMN build_id SET DEFAULT nextval('buildlog_build_id_seq'::regclass);
+
+
+--
+-- Name: queue_id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE buildqueue ALTER COLUMN queue_id SET DEFAULT nextval('buildqueue_queue_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ebuildbuildwithuses ALTER COLUMN id SET DEFAULT nextval('ebuildbuildwithuses_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ebuildhavesiuses ALTER COLUMN id SET DEFAULT nextval('ebuildhavesiuses_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ebuildhaveskeywords ALTER COLUMN id SET DEFAULT nextval('ebuildhaveskeywords_id_seq'::regclass);
+
+
+--
+-- Name: ebuildtorestriction_id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ebuildhavesrestrictions ALTER COLUMN ebuildtorestriction_id SET DEFAULT nextval('ebuildhavesrestrictions_ebuildtorestriction_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ebuildqueuedwithuses ALTER COLUMN id SET DEFAULT nextval('ebuildqueuedwithuses_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ebuilds ALTER COLUMN id SET DEFAULT nextval('ebuilds_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE manifest ALTER COLUMN id SET DEFAULT nextval('manifest_id_seq'::regclass);
+
+
+--
+-- Name: package_id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE packages ALTER COLUMN package_id SET DEFAULT nextval('packages_package_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE qa_problems ALTER COLUMN id SET DEFAULT nextval('qa_problems_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE repoman_problems ALTER COLUMN id SET DEFAULT nextval('repoman_problems_id_seq'::regclass);
+
+
+--
+-- Name: buildlog_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY buildlog
+    ADD CONSTRAINT buildlog_pkey PRIMARY KEY (build_id);
+
+
+--
+-- Name: buildqueue_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY buildqueue
+    ADD CONSTRAINT buildqueue_pkey PRIMARY KEY (queue_id);
+
+
+--
+-- Name: categories_meta_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY categories_meta
+    ADD CONSTRAINT categories_meta_pkey PRIMARY KEY (category);
+
+
+--
+-- Name: categories_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY categories
+    ADD CONSTRAINT categories_pkey PRIMARY KEY (category);
+
+
+--
+-- Name: configs_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY configs
+    ADD CONSTRAINT configs_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ebuildbuildwithuses_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY ebuildbuildwithuses
+    ADD CONSTRAINT ebuildbuildwithuses_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ebuildhavesiuses_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY ebuildhavesiuses
+    ADD CONSTRAINT ebuildhavesiuses_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ebuildhaveskeywords_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY ebuildhaveskeywords
+    ADD CONSTRAINT ebuildhaveskeywords_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ebuildhavesrestrictions_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY ebuildhavesrestrictions
+    ADD CONSTRAINT ebuildhavesrestrictions_pkey PRIMARY KEY (ebuildtorestriction_id);
+
+
+--
+-- Name: ebuildqueuedwithuses_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY ebuildqueuedwithuses
+    ADD CONSTRAINT ebuildqueuedwithuses_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ebuilds_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY ebuilds
+    ADD CONSTRAINT ebuilds_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: iuses_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY iuses
+    ADD CONSTRAINT iuses_pkey PRIMARY KEY (iuse);
+
+
+--
+-- Name: keywords_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY keywords
+    ADD CONSTRAINT keywords_pkey PRIMARY KEY (keyword);
+
+
+--
+-- Name: manifest_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY manifest
+    ADD CONSTRAINT manifest_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: packages_meta_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY packages_meta
+    ADD CONSTRAINT packages_meta_pkey PRIMARY KEY (package_id);
+
+
+--
+-- Name: packages_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY packages
+    ADD CONSTRAINT packages_pkey PRIMARY KEY (package_id);
+
+
+--
+-- Name: qa_problems_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY qa_problems
+    ADD CONSTRAINT qa_problems_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: repoman_problems_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY repoman_problems
+    ADD CONSTRAINT repoman_problems_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: restrictions_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY restrictions
+    ADD CONSTRAINT restrictions_pkey PRIMARY KEY (restriction_name);
+
+
+--
+-- Name: useflags_pkey; Type: CONSTRAINT; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+ALTER TABLE ONLY useflags
+    ADD CONSTRAINT useflags_pkey PRIMARY KEY (useflag);
+
+
+--
+-- Name: ebuilbuildwithuses_buildlog_idx; Type: INDEX; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE INDEX ebuilbuildwithuses_buildlog_idx ON ebuildbuildwithuses USING btree (build_id);
+
+
+--
+-- Name: ebuils_package_id_idx; Type: INDEX; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE INDEX ebuils_package_id_idx ON ebuilds USING btree (package_id);
+
+
+--
+-- Name: packages_category_idx; Type: INDEX; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE INDEX packages_category_idx ON packages USING btree (category);
+
+
+--
+-- Name: packages_name_idx; Type: INDEX; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE INDEX packages_name_idx ON packages USING btree (package_name);
+
+
+--
+-- Name: qa_problems_buildlog_idx; Type: INDEX; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE INDEX qa_problems_buildlog_idx ON qa_problems USING btree (build_id);
+
+
+--
+-- Name: repoman_problems_buildlog_idx; Type: INDEX; Schema: public; Owner: pgadmin; Tablespace: 
+--
+
+CREATE INDEX repoman_problems_buildlog_idx ON repoman_problems USING btree (build_id);
+
+
+--
+-- Name: buildlog_config_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY buildlog
+    ADD CONSTRAINT buildlog_config_fkey FOREIGN KEY (config) REFERENCES configs(id);
+
+
+--
+-- Name: buildlog_ebuild_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY buildlog
+    ADD CONSTRAINT buildlog_ebuild_id_fkey FOREIGN KEY (ebuild_id) REFERENCES ebuilds(id);
+
+
+--
+-- Name: buildqueue_config_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY buildqueue
+    ADD CONSTRAINT buildqueue_config_fkey FOREIGN KEY (config) REFERENCES configs(id);
+
+
+--
+-- Name: buildqueue_ebuild_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY buildqueue
+    ADD CONSTRAINT buildqueue_ebuild_id_fkey FOREIGN KEY (ebuild_id) REFERENCES ebuilds(id);
+
+
+--
+-- Name: categories_meta_category_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY categories_meta
+    ADD CONSTRAINT categories_meta_category_fkey FOREIGN KEY (category) REFERENCES categories(category);
+
+
+--
+-- Name: ebuildbuildwithuses_build_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildbuildwithuses
+    ADD CONSTRAINT ebuildbuildwithuses_build_id_fkey FOREIGN KEY (build_id) REFERENCES buildlog(build_id);
+
+
+--
+-- Name: ebuildbuildwithuses_useflag_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildbuildwithuses
+    ADD CONSTRAINT ebuildbuildwithuses_useflag_fkey FOREIGN KEY (useflag) REFERENCES useflags(useflag);
+
+
+--
+-- Name: ebuildhavesiuses_ebuild_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildhavesiuses
+    ADD CONSTRAINT ebuildhavesiuses_ebuild_fkey FOREIGN KEY (ebuild_id) REFERENCES ebuilds(id);
+
+
+--
+-- Name: ebuildhavesiuses_iuse_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildhavesiuses
+    ADD CONSTRAINT ebuildhavesiuses_iuse_fkey FOREIGN KEY (iuse) REFERENCES iuses(iuse);
+
+
+--
+-- Name: ebuildhaveskeywords_ebuild_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildhaveskeywords
+    ADD CONSTRAINT ebuildhaveskeywords_ebuild_id_fkey FOREIGN KEY (ebuild_id) REFERENCES ebuilds(id);
+
+
+--
+-- Name: ebuildhaveskeywords_keyword_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildhaveskeywords
+    ADD CONSTRAINT ebuildhaveskeywords_keyword_fkey FOREIGN KEY (keyword) REFERENCES keywords(keyword);
+
+
+--
+-- Name: ebuildhavesrestrictions_ebuild_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildhavesrestrictions
+    ADD CONSTRAINT ebuildhavesrestrictions_ebuild_id_fkey FOREIGN KEY (ebuild_id) REFERENCES ebuilds(id);
+
+
+--
+-- Name: ebuildhavesrestrictions_restriction_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildhavesrestrictions
+    ADD CONSTRAINT ebuildhavesrestrictions_restriction_fkey FOREIGN KEY (restriction) REFERENCES restrictions(restriction_name);
+
+
+--
+-- Name: ebuildqueuedwithuses_queue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildqueuedwithuses
+    ADD CONSTRAINT ebuildqueuedwithuses_queue_id_fkey FOREIGN KEY (queue_id) REFERENCES buildqueue(queue_id);
+
+
+--
+-- Name: ebuildqueuedwithuses_useflag_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuildqueuedwithuses
+    ADD CONSTRAINT ebuildqueuedwithuses_useflag_fkey FOREIGN KEY (useflag) REFERENCES useflags(useflag);
+
+
+--
+-- Name: ebuilds_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY ebuilds
+    ADD CONSTRAINT ebuilds_package_id_fkey FOREIGN KEY (package_id) REFERENCES packages(package_id);
+
+
+--
+-- Name: manifest_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY manifest
+    ADD CONSTRAINT manifest_package_id_fkey FOREIGN KEY (package_id) REFERENCES packages(package_id);
+
+
+--
+-- Name: packages_category_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY packages
+    ADD CONSTRAINT packages_category_fkey FOREIGN KEY (category) REFERENCES categories(category);
+
+
+--
+-- Name: packages_meta_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY packages_meta
+    ADD CONSTRAINT packages_meta_package_id_fkey FOREIGN KEY (package_id) REFERENCES packages(package_id);
+
+
+--
+-- Name: qa_problems_build_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY qa_problems
+    ADD CONSTRAINT qa_problems_build_id_fkey FOREIGN KEY (build_id) REFERENCES buildlog(build_id);
+
+
+--
+-- Name: repoman_problems_build_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: pgadmin
+--
+
+ALTER TABLE ONLY repoman_problems
+    ADD CONSTRAINT repoman_problems_build_id_fkey FOREIGN KEY (build_id) REFERENCES buildlog(build_id);
+
+
+--
+-- Name: public; Type: ACL; Schema: -; Owner: postgres
+--
+
+REVOKE ALL ON SCHEMA public FROM PUBLIC;
+REVOKE ALL ON SCHEMA public FROM postgres;
+GRANT ALL ON SCHEMA public TO postgres;
+GRANT ALL ON SCHEMA public TO PUBLIC;
+GRANT ALL ON SCHEMA public TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: comparearrays(anyarray, anyarray); Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON FUNCTION comparearrays(oldarray anyarray, newarray anyarray) FROM PUBLIC;
+REVOKE ALL ON FUNCTION comparearrays(oldarray anyarray, newarray anyarray) FROM pgadmin;
+GRANT ALL ON FUNCTION comparearrays(oldarray anyarray, newarray anyarray) TO pgadmin;
+GRANT ALL ON FUNCTION comparearrays(oldarray anyarray, newarray anyarray) TO PUBLIC;
+GRANT ALL ON FUNCTION comparearrays(oldarray anyarray, newarray anyarray) TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: insert_buildqueue(integer, character varying, character varying[], boolean[], text); Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON FUNCTION insert_buildqueue(ebuildid integer, buildhost character varying, inuseflags character varying[], inenabled boolean[], message text) FROM PUBLIC;
+REVOKE ALL ON FUNCTION insert_buildqueue(ebuildid integer, buildhost character varying, inuseflags character varying[], inenabled boolean[], message text) FROM pgadmin;
+GRANT ALL ON FUNCTION insert_buildqueue(ebuildid integer, buildhost character varying, inuseflags character varying[], inenabled boolean[], message text) TO pgadmin;
+GRANT ALL ON FUNCTION insert_buildqueue(ebuildid integer, buildhost character varying, inuseflags character varying[], inenabled boolean[], message text) TO PUBLIC;
+GRANT ALL ON FUNCTION insert_buildqueue(ebuildid integer, buildhost character varying, inuseflags character varying[], inenabled boolean[], message text) TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: make_buildlog(integer, text, text, text, text[], text[]); Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON FUNCTION make_buildlog(inqueue_id integer, inerror text, inbuild text, inlogfilename text, qaproblems text[], repomanproblems text[]) FROM PUBLIC;
+REVOKE ALL ON FUNCTION make_buildlog(inqueue_id integer, inerror text, inbuild text, inlogfilename text, qaproblems text[], repomanproblems text[]) FROM pgadmin;
+GRANT ALL ON FUNCTION make_buildlog(inqueue_id integer, inerror text, inbuild text, inlogfilename text, qaproblems text[], repomanproblems text[]) TO pgadmin;
+GRANT ALL ON FUNCTION make_buildlog(inqueue_id integer, inerror text, inbuild text, inlogfilename text, qaproblems text[], repomanproblems text[]) TO PUBLIC;
+GRANT ALL ON FUNCTION make_buildlog(inqueue_id integer, inerror text, inbuild text, inlogfilename text, qaproblems text[], repomanproblems text[]) TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: updateiuse(integer, character varying[]); Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON FUNCTION updateiuse(ebuildid integer, iniuses character varying[]) FROM PUBLIC;
+REVOKE ALL ON FUNCTION updateiuse(ebuildid integer, iniuses character varying[]) FROM pgadmin;
+GRANT ALL ON FUNCTION updateiuse(ebuildid integer, iniuses character varying[]) TO pgadmin;
+GRANT ALL ON FUNCTION updateiuse(ebuildid integer, iniuses character varying[]) TO PUBLIC;
+GRANT ALL ON FUNCTION updateiuse(ebuildid integer, iniuses character varying[]) TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: updatekeywords(integer, character varying[]); Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON FUNCTION updatekeywords(ebuildid integer, inkeywords character varying[]) FROM PUBLIC;
+REVOKE ALL ON FUNCTION updatekeywords(ebuildid integer, inkeywords character varying[]) FROM pgadmin;
+GRANT ALL ON FUNCTION updatekeywords(ebuildid integer, inkeywords character varying[]) TO pgadmin;
+GRANT ALL ON FUNCTION updatekeywords(ebuildid integer, inkeywords character varying[]) TO PUBLIC;
+GRANT ALL ON FUNCTION updatekeywords(ebuildid integer, inkeywords character varying[]) TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: updaterestrictions(integer, character varying[]); Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON FUNCTION updaterestrictions(ebuildid integer, inrestrictions character varying[]) FROM PUBLIC;
+REVOKE ALL ON FUNCTION updaterestrictions(ebuildid integer, inrestrictions character varying[]) FROM pgadmin;
+GRANT ALL ON FUNCTION updaterestrictions(ebuildid integer, inrestrictions character varying[]) TO pgadmin;
+GRANT ALL ON FUNCTION updaterestrictions(ebuildid integer, inrestrictions character varying[]) TO PUBLIC;
+GRANT ALL ON FUNCTION updaterestrictions(ebuildid integer, inrestrictions character varying[]) TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: buildlog; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE buildlog FROM PUBLIC;
+REVOKE ALL ON TABLE buildlog FROM pgadmin;
+GRANT ALL ON TABLE buildlog TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE buildlog TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: buildlog_build_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE buildlog_build_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE buildlog_build_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE buildlog_build_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE buildlog_build_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: buildqueue; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE buildqueue FROM PUBLIC;
+REVOKE ALL ON TABLE buildqueue FROM pgadmin;
+GRANT ALL ON TABLE buildqueue TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE buildqueue TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: buildqueue_queue_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE buildqueue_queue_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE buildqueue_queue_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE buildqueue_queue_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE buildqueue_queue_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: categories; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE categories FROM PUBLIC;
+REVOKE ALL ON TABLE categories FROM pgadmin;
+GRANT ALL ON TABLE categories TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE categories TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: categories_meta; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE categories_meta FROM PUBLIC;
+REVOKE ALL ON TABLE categories_meta FROM pgadmin;
+GRANT ALL ON TABLE categories_meta TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE categories_meta TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: configs; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE configs FROM PUBLIC;
+REVOKE ALL ON TABLE configs FROM pgadmin;
+GRANT ALL ON TABLE configs TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE configs TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildbuildwithuses; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE ebuildbuildwithuses FROM PUBLIC;
+REVOKE ALL ON TABLE ebuildbuildwithuses FROM pgadmin;
+GRANT ALL ON TABLE ebuildbuildwithuses TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE ebuildbuildwithuses TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildbuildwithuses_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE ebuildbuildwithuses_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE ebuildbuildwithuses_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE ebuildbuildwithuses_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE ebuildbuildwithuses_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildhavesiuses; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE ebuildhavesiuses FROM PUBLIC;
+REVOKE ALL ON TABLE ebuildhavesiuses FROM pgadmin;
+GRANT ALL ON TABLE ebuildhavesiuses TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE ebuildhavesiuses TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildhavesiuses_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE ebuildhavesiuses_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE ebuildhavesiuses_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE ebuildhavesiuses_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE ebuildhavesiuses_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildhaveskeywords; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE ebuildhaveskeywords FROM PUBLIC;
+REVOKE ALL ON TABLE ebuildhaveskeywords FROM pgadmin;
+GRANT ALL ON TABLE ebuildhaveskeywords TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE ebuildhaveskeywords TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildhaveskeywords_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE ebuildhaveskeywords_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE ebuildhaveskeywords_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE ebuildhaveskeywords_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE ebuildhaveskeywords_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildhavesrestrictions; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE ebuildhavesrestrictions FROM PUBLIC;
+REVOKE ALL ON TABLE ebuildhavesrestrictions FROM pgadmin;
+GRANT ALL ON TABLE ebuildhavesrestrictions TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE ebuildhavesrestrictions TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildhavesrestrictions_ebuildtorestriction_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE ebuildhavesrestrictions_ebuildtorestriction_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE ebuildhavesrestrictions_ebuildtorestriction_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE ebuildhavesrestrictions_ebuildtorestriction_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE ebuildhavesrestrictions_ebuildtorestriction_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildqueuedwithuses; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE ebuildqueuedwithuses FROM PUBLIC;
+REVOKE ALL ON TABLE ebuildqueuedwithuses FROM pgadmin;
+GRANT ALL ON TABLE ebuildqueuedwithuses TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE ebuildqueuedwithuses TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuildqueuedwithuses_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE ebuildqueuedwithuses_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE ebuildqueuedwithuses_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE ebuildqueuedwithuses_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE ebuildqueuedwithuses_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuilds; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE ebuilds FROM PUBLIC;
+REVOKE ALL ON TABLE ebuilds FROM pgadmin;
+GRANT ALL ON TABLE ebuilds TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE ebuilds TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: ebuilds_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE ebuilds_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE ebuilds_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE ebuilds_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE ebuilds_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: iuses; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE iuses FROM PUBLIC;
+REVOKE ALL ON TABLE iuses FROM pgadmin;
+GRANT ALL ON TABLE iuses TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE iuses TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: keywords; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE keywords FROM PUBLIC;
+REVOKE ALL ON TABLE keywords FROM pgadmin;
+GRANT ALL ON TABLE keywords TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE keywords TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: manifest; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE manifest FROM PUBLIC;
+REVOKE ALL ON TABLE manifest FROM pgadmin;
+GRANT ALL ON TABLE manifest TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE manifest TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: manifest_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE manifest_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE manifest_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE manifest_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE manifest_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: packages; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE packages FROM PUBLIC;
+REVOKE ALL ON TABLE packages FROM pgadmin;
+GRANT ALL ON TABLE packages TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE packages TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: packages_meta; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE packages_meta FROM PUBLIC;
+REVOKE ALL ON TABLE packages_meta FROM pgadmin;
+GRANT ALL ON TABLE packages_meta TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE packages_meta TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: packages_package_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE packages_package_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE packages_package_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE packages_package_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE packages_package_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: qa_problems; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE qa_problems FROM PUBLIC;
+REVOKE ALL ON TABLE qa_problems FROM pgadmin;
+GRANT ALL ON TABLE qa_problems TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE qa_problems TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: qa_problems_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE qa_problems_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE qa_problems_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE qa_problems_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE qa_problems_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: repoman_problems; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE repoman_problems FROM PUBLIC;
+REVOKE ALL ON TABLE repoman_problems FROM pgadmin;
+GRANT ALL ON TABLE repoman_problems TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE repoman_problems TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: repoman_problems_id_seq; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON SEQUENCE repoman_problems_id_seq FROM PUBLIC;
+REVOKE ALL ON SEQUENCE repoman_problems_id_seq FROM pgadmin;
+GRANT ALL ON SEQUENCE repoman_problems_id_seq TO pgadmin;
+GRANT SELECT,UPDATE ON SEQUENCE repoman_problems_id_seq TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: restrictions; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE restrictions FROM PUBLIC;
+REVOKE ALL ON TABLE restrictions FROM pgadmin;
+GRANT ALL ON TABLE restrictions TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE restrictions TO buildhost WITH GRANT OPTION;
+
+
+--
+-- Name: useflags; Type: ACL; Schema: public; Owner: pgadmin
+--
+
+REVOKE ALL ON TABLE useflags FROM PUBLIC;
+REVOKE ALL ON TABLE useflags FROM pgadmin;
+GRANT ALL ON TABLE useflags TO pgadmin;
+GRANT SELECT,INSERT,REFERENCES,DELETE,UPDATE ON TABLE useflags TO buildhost WITH GRANT OPTION;
+
+
+--
+-- PostgreSQL database dump complete
+--
+



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-25  0:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25  0:38 [gentoo-commits] dev/zorry:master commit in: gobs/sql/ Magnus Granberg
  -- strict thread matches above, loose matches on Subject: below --
2012-12-27 21:26 Magnus Granberg
2012-12-24  1:32 Magnus Granberg
2012-12-21  1:05 Magnus Granberg
2011-11-02 16:24 Magnus Granberg
2011-04-25 10:35 Magnus Granberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox