/[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

Annotation of /trunk/sql/schema.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 28 - (hide annotations)
Sun Jul 24 09:27:26 2005 UTC (18 years, 9 months ago) by dpavlin
File size: 1852 byte(s)
small improvements

1 dpavlin 24 -- Catalogs
2     create table catalogs (
3     id serial,
4     title text not null,
5     path text,
6     date timestamp not null default now(),
7     primary key(id)
8     );
9    
10     create table catalog_webarchive (
11     uri text not null, -- unique index
12 dpavlin 26 last_crawled timestamp,
13     primary key(id)
14 dpavlin 24 ) inherits (catalogs) ;
15    
16     -- Entries in Catalog
17     create table entries (
18     id serial,
19     title text,
20     path text,
21     date timestamp not null default now(),
22     primary key(id)
23     );
24    
25     create table catalog_entry (
26     catalog_id int references catalogs(id),
27     entry_id int references entries(id),
28     e_type text not null, -- index
29     primary key (catalog_id, entry_id)
30     );
31    
32 dpavlin 26 -- Items for each Entry
33 dpavlin 24 create table items (
34     id serial,
35     title text,
36     entry_id int references entries(id),
37    
38     i_type text not null,
39     date timestamp not null default now(),
40     primary key(id)
41     );
42    
43     -- HyperEstraier support table
44     create table items_est (
45     path text, -- unique index
46     uri text not null, -- unique index
47 dpavlin 26 size int,
48     primary key(id)
49 dpavlin 24 ) inherits (items) ;
50    
51     -- Tags for Entries
52     create table tags (
53     id serial,
54     title text, -- index
55     date timestamp not null default now(),
56     primary key(id)
57     );
58    
59     create table entry_tag (
60     entry_id int references entries(id),
61     tag_id int references tags(id),
62     value text not null,
63     t_type text not null, -- index
64     date timestamp not null default now(),
65     primary key (entry_id, tag_id)
66     );
67    
68 dpavlin 27 -- Pg General Bits
69     create table entries_pgbits (
70     issue int not null, -- unique index
71     primary key(id)
72     ) inherits (entries) ;
73    
74     create table items_pgbits (
75     mytitle text not null,
76     ititle text not null,
77     ikey text,
78     html text,
79     contributors text,
80     primary key(id)
81     ) inherits (items) ;
82    
83     -- some views
84    
85     create view pgbits_articles as select
86     issue,
87 dpavlin 28 date(entries_pgbits.date) as issue_date,
88 dpavlin 27 ititle,
89     mytitle,
90 dpavlin 28 date(items_pgbits.date) as date
91 dpavlin 27 from items_pgbits
92     join entries_pgbits on entry_id = entries_pgbits.id ;
93    

  ViewVC Help
Powered by ViewVC 1.1.26