added primary keys
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 23 Jul 2005 18:39:44 +0000 (18:39 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 23 Jul 2005 18:39:44 +0000 (18:39 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@26 07558da8-63fa-0310-ba24-9fe276d99e06

sql/Makefile
sql/schema.sql

index 9a1e2a8..6f8f31d 100644 (file)
@@ -3,7 +3,6 @@ db=webpac2
 init:
        dropdb $(db) || true
        createdb $(db)
-       psql $(db) < schema.sql
        ./mkindex.pl schema.sql | psql $(db)
        test -f data.sql && psql $(db) < data.sql
 
index 2678879..bf03de1 100644 (file)
@@ -9,7 +9,8 @@ create table catalogs (
 
 create table catalog_webarchive (
        uri     text not null,                  -- unique index
-       last_crawled timestamp
+       last_crawled timestamp,
+       primary key(id)
 ) inherits (catalogs) ;
 
 -- Entries in Catalog
@@ -30,10 +31,11 @@ create table catalog_entry (
 
 -- Pg General Bits entries
 create table entries_pgbits (
-       issue   int not null                    -- unique index
+       issue   int not null,                   -- unique index
+       primary key(id)
 ) inherits (entries) ;
 
--- Items in Entries
+-- Items for each Entry
 create table items (
        id      serial,
        title   text,
@@ -48,7 +50,8 @@ create table items (
 create table items_est (
        path    text,                   -- unique index
        uri     text not null,          -- unique index
-       size    int
+       size    int,
+       primary key(id)
 ) inherits (items) ;
 
 -- Tags for Entries