mod/data: tidyup of Postgres schema -- thanks to Nigel McNie

This commit is contained in:
martinlanghoff
2005-12-12 03:32:55 +00:00
parent d57f7fda7c
commit 11eb0ee62c
+20 -26
View File
@@ -1,39 +1,37 @@
CREATE TABLE prefix_data (
id SERIAL,
course int4 unsigned NOT NULL default '0',
id SERIAL PRIMARY KEY,
course int4 NOT NULL default '0',
name varchar(255) NOT NULL default '',
intro text NOT NULL default '',
ratings int4 NOT NULL default '0',
comments int unsigned NOT NULL default '0',
timedue int unsigned NOT NULL default '0',
timeavailable integer unsigned NOT NULL default '0',
participants integer unsigned NOT NULL default '0',
required integer unsigned NOT NULL default '0',
rsstype integer unsigned NOT NULL default '0',
rssarticles integer unsigned NOT NULL default '0',
comments int NOT NULL default '0',
timedue int NOT NULL default '0',
timeavailable integer NOT NULL default '0',
participants integer NOT NULL default '0',
required integer NOT NULL default '0',
rsstype integer NOT NULL default '0',
rssarticles integer NOT NULL default '0',
singletemplate text NOT NULL default '',
listtemplate text NOT NULL default '',
addtemplate text NOT NULL default '',
rsstemplate text NOT NULL default '',
listtemplateheader text NOT NULL default '',
listtemplatefooter text NOT NULL default '',
PRIMARY KEY (id)
listtemplatefooter text NOT NULL default ''
);
CREATE TABLE prefix_data_content (
id SERIAL,
id SERIAL PRIMARY KEY,
fieldid int4 NOT NULL default '0',
recordid int4 NOT NULL default '0',
content longtext NOT NULL,
PRIMARY KEY (id)
content text NOT NULL
);
CREATE TABLE prefix_data_fields (
id SERIAL,
id SERIAL PRIMARY KEY,
dataid int4 NOT NULL default '0',
type varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
@@ -47,37 +45,33 @@ CREATE TABLE prefix_data_fields (
param7 text,
param8 text,
param9 text,
param10 text,
PRIMARY KEY (id)
param10 text
);
CREATE TABLE prefix_data_records (
id SERIAL,
id SERIAL PRIMARY KEY,
userid int4 NOT NULL default '0',
groupid int4 NOT NULL default '0',
dataid int4 NOT NULL default '0',
timecreated int4 NOT NULL default '0',
timemodified int4 NOT NULL default '0',
PRIMARY KEY (id)
timemodified int4 NOT NULL default '0'
);
CREATE TABLE prefix_data_comments (
id SERIAL,
id SERIAL PRIMARY KEY,
userid int4 NOT NULL default '0',
recordid int4 NOT NULL default '0',
content text,
PRIMARY KEY (id)
content text
);
CREATE TABLE prefix_data_ratings (
id SERIAL,
id SERIAL PRIMARY KEY,
userid int4 NOT NULL default '0',
recordid int4 NOT NULL default '0',
rating int4 NOT NULL default '0',
PRIMARY KEY (id)
rating int4 NOT NULL default '0'
);