/[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 24 - (hide annotations)
Sat Jul 23 15:46:24 2005 UTC (18 years, 9 months ago) by dpavlin
File size: 1416 byte(s)
implemented core of catalog-entry-item schema based on PostgreSQL General Bits
issue 110, Accessing Inherited Table Data

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     last_crawled timestamp
13     ) inherits (catalogs) ;
14    
15     -- Entries in Catalog
16     create table entries (
17     id serial,
18     title text,
19     path text,
20     date timestamp not null default now(),
21     primary key(id)
22     );
23    
24     create table catalog_entry (
25     catalog_id int references catalogs(id),
26     entry_id int references entries(id),
27     e_type text not null, -- index
28     primary key (catalog_id, entry_id)
29     );
30    
31     -- Pg General Bits entries
32     create table entries_pgbits (
33     issue int not null -- unique index
34     ) inherits (entries) ;
35    
36     -- Items in Entries
37     create table items (
38     id serial,
39     title text,
40     entry_id int references entries(id),
41    
42     i_type text not null,
43     date timestamp not null default now(),
44     primary key(id)
45     );
46    
47     -- HyperEstraier support table
48     create table items_est (
49     path text, -- unique index
50     uri text not null, -- unique index
51     size int
52     ) inherits (items) ;
53    
54     -- Tags for Entries
55     create table tags (
56     id serial,
57     title text, -- index
58     date timestamp not null default now(),
59     primary key(id)
60     );
61    
62     create table entry_tag (
63     entry_id int references entries(id),
64     tag_id int references tags(id),
65     value text not null,
66     t_type text not null, -- index
67     date timestamp not null default now(),
68     primary key (entry_id, tag_id)
69     );
70    

  ViewVC Help
Powered by ViewVC 1.1.26