/[webpac2]/trunk/sql/schema.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/sql/schema.sql

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 24 by dpavlin, Sat Jul 23 15:46:24 2005 UTC revision 36 by dpavlin, Tue Aug 2 00:42:29 2005 UTC
# Line 9  create table catalogs ( Line 9  create table catalogs (
9    
10  create table catalog_webarchive (  create table catalog_webarchive (
11          uri     text not null,                  -- unique index          uri     text not null,                  -- unique index
12          last_crawled timestamp          last_crawled timestamp,
13            primary key(id)
14  ) inherits (catalogs) ;  ) inherits (catalogs) ;
15    
16  -- Entries in Catalog  -- Entries in Catalog
# Line 28  create table catalog_entry ( Line 29  create table catalog_entry (
29          primary key (catalog_id, entry_id)          primary key (catalog_id, entry_id)
30  );  );
31    
32  -- Pg General Bits entries  -- Items for each Entry
 create table entries_pgbits (  
         issue   int not null                    -- unique index  
 ) inherits (entries) ;  
   
 -- Items in Entries  
33  create table items (  create table items (
34          id      serial,          id      serial,
35          title   text,          title   text,
36          entry_id int references entries(id),          entry_id int references entries(id),
   
37          i_type  text not null,          i_type  text not null,
38          date timestamp not null default now(),          date timestamp not null default now(),
39          primary key(id)          primary key(id)
# Line 48  create table items ( Line 43  create table items (
43  create table items_est (  create table items_est (
44          path    text,                   -- unique index          path    text,                   -- unique index
45          uri     text not null,          -- unique index          uri     text not null,          -- unique index
46          size    int          size    int,
47            primary key(id)
48  ) inherits (items) ;  ) inherits (items) ;
49    
50  -- Tags for Entries  -- Tags for Entries
# Line 68  create table entry_tag ( Line 64  create table entry_tag (
64          primary key (entry_id, tag_id)          primary key (entry_id, tag_id)
65  );  );
66    
67    -- Pg General Bits
68    create table entries_pgbits (
69            issue   int not null,                   -- unique index
70            primary key(id)
71    ) inherits (entries) ;
72    
73    create table items_pgbits (
74            mytitle text not null,
75            ititle  text not null,
76            ikey    text,
77            html    text,
78            contributors text,
79            primary key(id)
80    ) inherits (items) ;
81    
82    -- some views
83    
84    create view pgbits_articles as select
85            issue,
86            date(entries_pgbits.date) as issue_date,
87            ititle,
88            mytitle,
89            date(items_pgbits.date) as date
90    from items_pgbits
91    join entries_pgbits on entry_id = entries_pgbits.id ;
92    

Legend:
Removed from v.24  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.26