From a7f67e01de1626b8cba850c325ccf12806d312c0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 4 Aug 2006 06:58:44 +0000 Subject: - Patch #76681 by sammys: PostgreSQL support for install system. Woot! :) --- modules/poll/poll.install | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'modules/poll/poll.install') diff --git a/modules/poll/poll.install b/modules/poll/poll.install index 8c8feaef8..f05958cca 100644 --- a/modules/poll/poll.install +++ b/modules/poll/poll.install @@ -31,5 +31,33 @@ function poll_install() { PRIMARY KEY (chid), KEY nid (nid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); + case 'pgsql': + db_query("CREATE TABLE {poll} ( + nid uint NOT NULL default '0', + runtime int NOT NULL default '0', + active uint NOT NULL default '0', + PRIMARY KEY (nid) + )"); + + db_query("CREATE TABLE {poll_votes} ( + nid uint NOT NULL, + uid uint NOT NULL default 0, + chorder int NOT NULL default -1, + hostname varchar(128) NOT NULL default '' + )"); + db_query("CREATE INDEX {poll_votes}_nid_idx ON {poll_votes} (nid)"); + db_query("CREATE INDEX {poll_votes}_uid_idx ON {poll_votes} (uid)"); + db_query("CREATE INDEX {poll_votes}_hostname_idx ON {poll_votes} (hostname)"); + + db_query("CREATE TABLE {poll_choices} ( + chid serial CHECK (chid >= 0), + nid uint NOT NULL default '0', + chtext varchar(128) NOT NULL default '', + chvotes int NOT NULL default '0', + chorder int NOT NULL default '0', + PRIMARY KEY (chid) + )"); + db_query("CREATE INDEX {poll_choices}_nid_idx ON {poll_choices} (nid)"); + break; } } -- cgit v1.2.3