--- trunk/sql/schema.sql	2005/07/23 18:39:44	26
+++ trunk/sql/schema.sql	2005/07/23 19:21:07	27
@@ -29,12 +29,6 @@
 	primary key (catalog_id, entry_id)
 );
 
--- Pg General Bits entries
-create table entries_pgbits (
-	issue	int not null,			-- unique index
-	primary key(id)
-) inherits (entries) ;
-
 -- Items for each Entry
 create table items (
 	id	serial,
@@ -71,3 +65,29 @@
 	primary key (entry_id, tag_id)
 );
 
+-- Pg General Bits
+create table entries_pgbits (
+	issue	int not null,			-- unique index
+	primary key(id)
+) inherits (entries) ;
+
+create table items_pgbits (
+	mytitle	text not null,
+	ititle	text not null,
+	ikey	text,
+	html	text,
+	contributors text,
+	primary key(id)
+) inherits (items) ;
+
+-- some views
+
+create view pgbits_articles as select
+	issue,
+	entries_pgbits.date as issue_date,
+	ititle,
+	mytitle,
+	items_pgbits.date as date
+from items_pgbits
+join entries_pgbits on entry_id = entries_pgbits.id ;
+
