From 24036ef94687300e98c742cfc268a2b5e9e87a88 Mon Sep 17 00:00:00 2001
From: Trygve Laugstøl <trygvis@inamo.no>
Date: Sat, 5 Jan 2013 17:24:07 +0100
Subject: o Trying out dbdeploy.

---
 src/main/sql/base-schema/ddl-gitorious.sql | 40 ++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 src/main/sql/base-schema/ddl-gitorious.sql

(limited to 'src/main/sql/base-schema/ddl-gitorious.sql')

diff --git a/src/main/sql/base-schema/ddl-gitorious.sql b/src/main/sql/base-schema/ddl-gitorious.sql
new file mode 100644
index 0000000..121a4ff
--- /dev/null
+++ b/src/main/sql/base-schema/ddl-gitorious.sql
@@ -0,0 +1,40 @@
+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
+);
+
+COMMIT;
-- 
cgit v1.2.3

