aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-05 13:09:49 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2012-12-07 20:06:53 +0100
commit1c2c16858e95db9ae90726fa0da69b88457c1807 (patch)
treedca86c80f715281bf39388de2a42fdba9e0ceef7 /src/main/resources
parent6d1dc3b1ca077312674ef05cd88ca5a7858bffd2 (diff)
downloadesper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.tar.gz
esper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.tar.bz2
esper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.tar.xz
esper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.zip
o More common XML parsing and HTTP client code. o Reimplemented the Nexus code to consume the timeline instead of calculating its own diff.
Diffstat (limited to 'src/main/resources')
-rwxr-xr-xsrc/main/resources/ddl-jenkins.sql9
-rwxr-xr-xsrc/main/resources/ddl-nexus.sql77
2 files changed, 48 insertions, 38 deletions
diff --git a/src/main/resources/ddl-jenkins.sql b/src/main/resources/ddl-jenkins.sql
new file mode 100755
index 0000000..37e82c1
--- /dev/null
+++ b/src/main/resources/ddl-jenkins.sql
@@ -0,0 +1,9 @@
+BEGIN;
+
+DROP TABLE IF EXISTS jenkins_server;
+
+CREATE TABLE jenkins_server(
+ url VARCHAR(1000) NOT NULL PRIMARY KEY
+);
+
+COMMIT;
diff --git a/src/main/resources/ddl-nexus.sql b/src/main/resources/ddl-nexus.sql
index 15ed482..1f7514f 100755
--- a/src/main/resources/ddl-nexus.sql
+++ b/src/main/resources/ddl-nexus.sql
@@ -6,55 +6,56 @@ DROP TABLE IF EXISTS nexus_repository;
DROP TABLE IF EXISTS nexus_server;
CREATE TABLE nexus_server (
- url VARCHAR(1000) PRIMARY KEY,
- name VARCHAR(100) NOT NULL
+ uuid CHAR(36) NOT NULL,
+ url VARCHAR(1000) NOT NULL,
+ name VARCHAR(1000) NOT NULL,
+ CONSTRAINT pk_nexus_server PRIMARY KEY (uuid),
+ CONSTRAINT uq_nexus_server_url UNIQUE (url)
);
CREATE TABLE nexus_repository (
- id VARCHAR(1000),
- server_url VARCHAR(1000) NOT NULL,
- group_ids VARCHAR(100) [],
- created_date TIMESTAMP,
- last_update TIMESTAMP,
- last_successful_update TIMESTAMP,
- CONSTRAINT nexus_repository_pk PRIMARY KEY (id, server_url),
- CONSTRAINT nexus_server_fk FOREIGN KEY (server_url) REFERENCES nexus_server (url)
+ uuid CHAR(36) NOT NULL,
+ server CHAR(36) NOT NULL,
+ id VARCHAR(100),
+ group_ids VARCHAR(100) [],
+ CONSTRAINT pk_nexus_repository PRIMARY KEY (uuid),
+ CONSTRAINT fk_nexus_server FOREIGN KEY (server) REFERENCES nexus_server (uuid),
+ CONSTRAINT uq_nexus_repository_id UNIQUE (server, id)
);
CREATE TABLE nexus_artifact (
- server_url VARCHAR(1000) NOT NULL,
- repository_id VARCHAR(1000) NOT NULL,
- group_id VARCHAR(100) NOT NULL,
- artifact_id VARCHAR(100) NOT NULL,
- version VARCHAR(100) NOT NULL,
- snapshot_version VARCHAR(100),
- classifiers VARCHAR(100) [],
- packagings VARCHAR(100) [],
- created_date TIMESTAMP,
- last_update TIMESTAMP,
- last_successful_update TIMESTAMP,
- CONSTRAINT nexus_artifact_pk PRIMARY KEY (server_url, repository_id, group_id, artifact_id, version),
- CONSTRAINT nexus_repository_fk FOREIGN KEY (server_url, repository_id) REFERENCES nexus_repository (server_url, id)
+ uuid CHAR(36) NOT NULL,
+ repository CHAR(36) NOT NULL,
+ group_id VARCHAR(100) NOT NULL,
+ artifact_id VARCHAR(100) NOT NULL,
+ version VARCHAR(100) NOT NULL,
+ CONSTRAINT pk_nexus_artifact PRIMARY KEY (uuid),
+ CONSTRAINT uq_nexus_artifact_gid_aid_version UNIQUE (group_id, artifact_id, version),
+ CONSTRAINT fk_nexus_repository FOREIGN KEY (repository) REFERENCES nexus_repository (uuid)
);
CREATE TABLE nexus_event (
- timestamp VARCHAR(100),
- uuid VARCHAR(100),
- server_url VARCHAR(1000) NOT NULL,
- repository_id VARCHAR(1000) NOT NULL,
- group_id VARCHAR(100) NOT NULL,
- artifact_id VARCHAR(100) NOT NULL,
- version VARCHAR(100) NOT NULL,
- files VARCHAR(100) [],
- CONSTRAINT nexus_event_pk PRIMARY KEY (timestamp, server_url, repository_id, group_id, artifact_id, version),
- CONSTRAINT nexus_artifact_fk FOREIGN KEY (server_url, repository_id, group_id, artifact_id, version) REFERENCES nexus_artifact (server_url, repository_id, group_id, artifact_id, version)
+ uuid CHAR(36) NOT NULL,
+ artifact CHAR(36) NOT NULL,
+ timestamp VARCHAR(100),
+ guid VARCHAR(1000),
+
+ type VARCHAR(100) NOT NULL,
+
+-- new snapshot event
+ snapshot_timestamp VARCHAR(1000),
+ file VARCHAR(1000),
+ CONSTRAINT pk_nexus_event PRIMARY KEY (uuid),
+ CONSTRAINT fk_nexus_artifact FOREIGN KEY (artifact) REFERENCES nexus_artifact (uuid),
+ CONSTRAINT uq_guid UNIQUE (guid),
+ CONSTRAINT check_event_type CHECK (type IN ('new_snapshot'))
+-- CONSTRAINT pk_nexus_event PRIMARY KEY (timestamp, server_url, repository_id, group_id, artifact_id, version)
);
-INSERT INTO nexus_server (url, name) VALUES ('https://oss.sonatype.org', 'Central Repository');
--- INSERT INTO nexus_repository (id, server_url, group_ids) VALUES ('releases', 'https://oss.sonatype.org', ARRAY ['io.trygvis', 'no.arktekk', 'org.codehaus']);
-INSERT INTO nexus_repository (id, server_url, group_ids) VALUES ('releases', 'https://oss.sonatype.org', ARRAY ['io.trygvis', 'no.arktekk', 'org.codehaus']);
+INSERT INTO nexus_server (uuid, url, name) VALUES ('4666dba4-3e2e-11e2-8a1b-0bd430e00b36', 'https://oss.sonatype.org', 'Central Repository');
+INSERT INTO nexus_repository (uuid, server, id, group_ids) VALUES ('4a2d7ab2-3e2f-11e2-af03-eb1ace2381bb', '4666dba4-3e2e-11e2-8a1b-0bd430e00b36', 'releases', ARRAY ['io.trygvis', 'no.arktekk', 'org.codehaus']);
-INSERT INTO nexus_server (url, name) VALUES ('http://nexus.codehaus.org', 'Codehaus Snapshots');
-INSERT INTO nexus_repository (id, server_url, group_ids) VALUES ('snapshots', 'http://nexus.codehaus.org', ARRAY ['org.codehaus.mojo']);
+INSERT INTO nexus_server (uuid, url, name) VALUES ('91d942d8-3e2f-11e2-aaa0-a70628365abd', 'http://nexus.codehaus.org', 'Codehaus Snapshots');
+INSERT INTO nexus_repository (uuid, server, id, group_ids) VALUES ('a2415b88-3e2f-11e2-a2b8-2f066b90cf13', '91d942d8-3e2f-11e2-aaa0-a70628365abd', 'snapshots', ARRAY ['org.codehaus.mojo']);
COMMIT;