function node_expire_install in Node expire 5
Same name and namespace in other branches
- 6.2 node_expire.install \node_expire_install()
- 6 node_expire.install \node_expire_install()
Implamentation of hook_install()
File
- ./
node_expire.install, line 6
Code
function node_expire_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {node_expire} (\n nid int(10) unsigned NOT NULL,\n expire datetime default NULL,\n expiresec varchar(10) NOT NULL,\n expiremode enum('date','onupdate','none') NOT NULL default 'none',\n isroot tinyint(1) unsigned NOT NULL default '0',\n lastnotify int(10) unsigned NOT NULL default '0',\n PRIMARY KEY (nid),\n KEY expire (expire),\n KEY expiremode (expiremode),\n KEY lastnotify (lastnotify)\n );");
break;
case 'pgsql':
db_query("CREATE TABLE {node_expire} (\n nid int_unsigned NOT NULL,\n expire timestamp without time zone,\n expiresec character varying(10) NOT NULL,\n expiremode character varying(8) NOT NULL DEFAULT 'none'::character varying CHECK(expiremode IN('date','onupdate','none')),\n isroot smallint_unsigned NOT NULL DEFAULT 0::smallint,\n lastnotify int_unsigned NOT NULL DEFAULT 0,\n CONSTRAINT node_expire_pkey PRIMARY KEY (nid)\n );");
db_query("CREATE INDEX expire ON {node_expire} USING btree (expire);");
db_query("CREATE INDEX expiremode ON {node_expire} USING btree (expiremode);");
db_query("CREATE INDEX lastnotify ON node_expire USING btree (lastnotify);");
break;
}
}