diff options
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/ddl-core.sql | 38 | ||||
-rw-r--r-- | src/main/resources/ddl-jenkins.sql | 12 |
2 files changed, 41 insertions, 9 deletions
diff --git a/src/main/resources/ddl-core.sql b/src/main/resources/ddl-core.sql index 8201c31..fb85585 100644 --- a/src/main/resources/ddl-core.sql +++ b/src/main/resources/ddl-core.sql @@ -1,17 +1,37 @@ BEGIN; -DROP TABLE IF EXISTS subscription_gitorious_repository; -DROP TABLE IF EXISTS subscriber; +CREATE TABLE table_poller_status ( + poller_name VARCHAR(100) NOT NULL, + last_created_date TIMESTAMP, + last_run TIMESTAMP, + duration INT, + status VARCHAR(1000), + CONSTRAINT pk_job_status PRIMARY KEY (poller_name) +); + +CREATE TABLE person ( + uuid CHAR(36) NOT NULL, + created_date TIMESTAMP NOT NULL, +--The users from the different jenkins servers this user has claimed + jenkins_users CHAR(36) [], + CONSTRAINT pk_person PRIMARY KEY (uuid) +); -CREATE TABLE subscriber ( - name VARCHAR(100) PRIMARY KEY +-- Badges received +CREATE TABLE person_badge ( + uuid CHAR(36) NOT NULL, + created_date TIMESTAMP NOT NULL, + CONSTRAINT pk_person_badge PRIMARY KEY (uuid) ); -CREATE TABLE subscription_gitorious_repository ( - subscriber_name VARCHAR(100) REFERENCES subscriber (name), - gitorious_repository_project_slug VARCHAR(100), - gitorious_repository_name VARCHAR(100), - CONSTRAINT gitorious_repository FOREIGN KEY (gitorious_repository_project_slug, gitorious_repository_name) REFERENCES gitorious_repository (project_slug, name) +-- Badges the person is working on +CREATE TABLE person_badge_progress ( + uuid CHAR(36) NOT NULL, + created_date TIMESTAMP NOT NULL, + + name VARCHAR(100) NOT NULL, + + CONSTRAINT pk_person_badge_progress PRIMARY KEY (uuid) ); COMMIT; diff --git a/src/main/resources/ddl-jenkins.sql b/src/main/resources/ddl-jenkins.sql index 01275eb..65b3e35 100644 --- a/src/main/resources/ddl-jenkins.sql +++ b/src/main/resources/ddl-jenkins.sql @@ -46,6 +46,18 @@ CREATE TABLE jenkins_build ( CONSTRAINT uq_jenkins_build__id UNIQUE (entry_id) ); +CREATE INDEX ix_jenkins_build__created_date ON jenkins_build (created_date); + +CREATE TABLE jenkins_user ( + uuid CHAR(36) NOT NULL, + created_date TIMESTAMP NOT NULL, + server CHAR(36) NOT NULL, + absolute_url VARCHAR(1000) NOT NULL, + CONSTRAINT pk_jenkins_user PRIMARY KEY (uuid), + CONSTRAINT fk_jenkins_user__server FOREIGN KEY (server) REFERENCES jenkins_server (uuid), + CONSTRAINT uq_jenkins_user__absolute_url UNIQUE (absolute_url) +); + INSERT INTO jenkins_server (uuid, created_date, url, enabled) VALUES ('782a75f6-40a4-11e2-aca6-20cf30557fa0', CURRENT_TIMESTAMP, 'https://builds.apache.org', FALSE), ('4c473c86-40ad-11e2-ae61-20cf30557fa0', CURRENT_TIMESTAMP, 'http://ci.jruby.org', FALSE), |