diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-11-09 15:26:55 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-11-09 15:26:55 +0100 |
commit | a742500840276ec694a6d25230ee52c05b385661 (patch) | |
tree | b02eebec6f385efa057feea15a17112e1f97e0d4 /src/main/resources | |
parent | 8b3db6ef6307191609d2dab837032db16aa13375 (diff) | |
download | esper-testing-a742500840276ec694a6d25230ee52c05b385661.tar.gz esper-testing-a742500840276ec694a6d25230ee52c05b385661.tar.bz2 esper-testing-a742500840276ec694a6d25230ee52c05b385661.tar.xz esper-testing-a742500840276ec694a6d25230ee52c05b385661.zip |
wip
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/ddl-core.sql | 20 | ||||
-rw-r--r-- | src/main/resources/ddl-gitorious.sql | 43 | ||||
-rw-r--r-- | src/main/resources/ddl.sql | 26 |
3 files changed, 63 insertions, 26 deletions
diff --git a/src/main/resources/ddl-core.sql b/src/main/resources/ddl-core.sql new file mode 100644 index 0000000..662ed10 --- /dev/null +++ b/src/main/resources/ddl-core.sql @@ -0,0 +1,20 @@ +BEGIN; + +DROP TABLE IF EXISTS subscription_gitorious_repository; +DROP TABLE IF EXISTS subscriber; + +CREATE TABLE subscriber ( + name VARCHAR(100) PRIMARY KEY +); + +CREATE TABLE subscription_gitorious_repository ( + subscriber_name VARCHAR(100) REFERENCES subscriber (name), + gitorious_repository_project_slug VARCHAR(100), + gitorious_repository_name VARCHAR(100) +-- CONSTRAINT subscription_gitorious_repository_2_gitorious_repository FOREIGN KEY (gitorious_repository_project_slug, gitorious_repository_name) REFERENCES gitorious_repository (project_slug, name) +); + +INSERT INTO subscriber VALUES ('trygvis'); +INSERT INTO subscription_gitorious_repository VALUES ('trygvis','esper-test-project', 'esper-test-project'); + +COMMIT; diff --git a/src/main/resources/ddl-gitorious.sql b/src/main/resources/ddl-gitorious.sql new file mode 100644 index 0000000..929a326 --- /dev/null +++ b/src/main/resources/ddl-gitorious.sql @@ -0,0 +1,43 @@ +BEGIN; + +DROP TABLE IF EXISTS gitorious_event; +DROP TABLE IF EXISTS gitorious_repository; +DROP TABLE IF EXISTS gitorious_project; + +CREATE TABLE gitorious_project ( + slug VARCHAR(1000) PRIMARY KEY +); + +CREATE TABLE gitorious_repository ( + project_slug VARCHAR(1000) NOT NULL, + name VARCHAR(1000) NOT NULL, + atom_feed VARCHAR(1000) NOT NULL, + last_update TIMESTAMP, + last_successful_update TIMESTAMP, + CONSTRAINT gitorious_repository_pk PRIMARY KEY (project_slug, name), + CONSTRAINT gitorious_repository_2_gitorious_project FOREIGN KEY (project_slug) REFERENCES gitorious_project (slug) +); + +CREATE TABLE gitorious_event ( + project_slug VARCHAR(1000) NOT NULL, + name VARCHAR(1000) NOT NULL, + +-- The raw values for debugging + entry_id VARCHAR(1000) PRIMARY KEY, + published TIMESTAMP NOT NULL, + title VARCHAR(1000), + content VARCHAR(1000), + + event_type VARCHAR(20), + who VARCHAR(100), +-- Push + "from" CHAR(40), + "to" CHAR(40), + branch VARCHAR(100), + commit_count INTEGER +); + +INSERT INTO gitorious_project VALUES ('esper-test-project'); +INSERT INTO gitorious_repository VALUES ('esper-test-project', 'esper-test-project', 'https://gitorious.org/esper-test-project/esper-test-project.atom'); + +COMMIT; diff --git a/src/main/resources/ddl.sql b/src/main/resources/ddl.sql deleted file mode 100644 index 4e641cc..0000000 --- a/src/main/resources/ddl.sql +++ /dev/null @@ -1,26 +0,0 @@ -BEGIN; - -DROP TABLE IF EXISTS gitorious_event; -DROP TABLE IF EXISTS gitorious_repository; -DROP TABLE IF EXISTS gitorious_project; - -CREATE TABLE gitorious_project ( - slug VARCHAR(1000) PRIMARY KEY -); - -CREATE TABLE gitorious_repository ( - project_slug VARCHAR(1000) NOT NULL, - name VARCHAR(1000) NOT NULL, - atom_feed VARCHAR(1000) NOT NULL, - last_update TIMESTAMP, - last_successful_update TIMESTAMP, - CONSTRAINT gitorious_repository_pk PRIMARY KEY (project_slug, name), - CONSTRAINT gitorious_repository_2_gitorious_project FOREIGN KEY (project_slug) REFERENCES gitorious_project (slug) -); - -CREATE TABLE gitorious_event ( - entry_id VARCHAR(1000) PRIMARY KEY, - text VARCHAR(1000) -); - -COMMIT; |