summaryrefslogtreecommitdiff
path: root/database/database.pgsql
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-09-20 17:58:14 +0000
committerDries Buytaert <dries@buytaert.net>2004-09-20 17:58:14 +0000
commit228b3c7cc84717e5deae769d7aa3a3e29fdae6a1 (patch)
tree2e307dc713e8c14acf6ed4e699989fc742bdf017 /database/database.pgsql
parent4fe5b52a219c7b2d7183003fe3b2a0bea5fa13bd (diff)
downloadbrdo-228b3c7cc84717e5deae769d7aa3a3e29fdae6a1.tar.gz
brdo-228b3c7cc84717e5deae769d7aa3a3e29fdae6a1.tar.bz2
- Patch #10945 by Adrian: more PostgreSQL fixes/updates.
Diffstat (limited to 'database/database.pgsql')
-rw-r--r--database/database.pgsql28
1 files changed, 27 insertions, 1 deletions
diff --git a/database/database.pgsql b/database/database.pgsql
index 43015661a..21a8408a6 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -162,7 +162,7 @@ CREATE TABLE aggregator_item (
CREATE TABLE cache (
cid varchar(255) NOT NULL default '',
- data bytea default '',
+ data text default '',
expire integer NOT NULL default '0',
created integer NOT NULL default '0',
headers text default '',
@@ -197,6 +197,20 @@ CREATE TABLE comments (
CREATE INDEX comments_nid_idx ON comments(nid);
--
+-- Table structre for table 'node_last_comment'
+--
+
+CREATE TABLE node_comment_statistics (
+ nid integer NOT NULL,
+ cid integer NOT NULL default '0',
+ last_comment_timestamp integer NOT NULL default '0',
+ last_comment_name varchar(60) default NULL,
+ last_comment_uid integer NOT NULL default '0',
+ comment_count integer NOT NULL default '0',
+ PRIMARY KEY (nid)
+);
+
+--
-- Table structure for directory
--
@@ -799,3 +813,15 @@ BEGIN
RETURN $1 || $2;
END;
' LANGUAGE 'plpgsql';
+
+CREATE FUNCTION "if"(integer, text, text) RETURNS text AS '
+BEGIN
+ IF $1 THEN
+ RETURN $2;
+ END IF;
+ IF NOT $1 THEN
+ RETURN $3;
+ END IF;
+END;
+' LANGUAGE 'plpgsql';
+