From 2eae4836279646050e7e342752cde6e8f7c5b6cb Mon Sep 17 00:00:00 2001
From: Trygve Laugstøl <trygvis@inamo.no>
Date: Thu, 8 Nov 2012 22:24:01 +0100
Subject: wip

---
 src/main/resources/ddl.sql | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'src/main/resources')

diff --git a/src/main/resources/ddl.sql b/src/main/resources/ddl.sql
index a8bec8f..6f213dc 100644
--- a/src/main/resources/ddl.sql
+++ b/src/main/resources/ddl.sql
@@ -1,6 +1,8 @@
 BEGIN;
 
 DROP TABLE IF EXISTS gitorious_change;
+DROP TABLE IF EXISTS gitorious_repository;
+DROP TABLE IF EXISTS gitorious_project;
 DROP TABLE IF EXISTS atom_feed;
 
 CREATE TABLE atom_feed (
@@ -8,9 +10,16 @@ CREATE TABLE atom_feed (
   last_update TIMESTAMP NOT NULL
 );
 
+CREATE TABLE gitorious_project (
+  slug VARCHAR(1000) PRIMARY KEY
+);
+
 CREATE TABLE gitorious_repository (
-  entry_id VARCHAR(1000) PRIMARY KEY,
-  text VARCHAR(1000)
+  project_slug VARCHAR(1000) NOT NULL,
+  name VARCHAR(1000) NOT NULL,
+  atom_feed VARCHAR(1000) NOT NULL,
+  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_change (
-- 
cgit v1.2.3