function invite_install in Invite 5.2
Same name and namespace in other branches
- 8 invite.install \invite_install()
- 5 invite.install \invite_install()
- 6.2 invite.install \invite_install()
- 7.4 invite.install \invite_install()
Install the initial schema.
File
- ./
invite.install, line 11 - Installation file for invite module.
Code
function invite_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("\n CREATE TABLE {invite} (\n reg_code varchar(8) NOT NULL default '',\n email varchar(100) NOT NULL default '',\n uid int(10) NOT NULL default '0',\n invitee int(10) NOT NULL default '0',\n created int(10) NOT NULL default '0',\n expiry int(10) NOT NULL default '0',\n joined int(10) NOT NULL default '0',\n canceled tinyint(1) NOT NULL default '0',\n resent tinyint(3) NOT NULL default '0',\n data text NOT NULL,\n UNIQUE (reg_code),\n KEY (email),\n KEY (uid)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
db_query("\n CREATE TABLE {invite_notifications} (\n uid int(10) NOT NULL default '0',\n invitee int(10) NOT NULL default '0',\n UNIQUE (uid, invitee)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("\n CREATE TABLE {invite} (\n reg_code VARCHAR(8) NOT NULL DEFAULT '',\n email VARCHAR(100) NOT NULL DEFAULT '',\n uid INTEGER NOT NULL DEFAULT 0,\n invitee INTEGER NOT NULL DEFAULT 0,\n created INTEGER NOT NULL DEFAULT 0,\n expiry INTEGER NOT NULL DEFAULT 0,\n joined INTEGER NOT NULL DEFAULT 0,\n canceled SMALLINT NOT NULL DEFAULT 0,\n resent SMALLINT NOT NULL DEFAULT 0,\n data TEXT NOT NULL DEFAULT '',\n UNIQUE (reg_code)\n )");
db_query("CREATE INDEX {invite}_email_idx ON {invite}(email)");
db_query("CREATE INDEX {invite}_uid_idx ON {invite}(uid)");
db_query("\n CREATE TABLE {invite_notifications} (\n uid INTEGER NOT NULL DEFAULT 0,\n invitee INTEGER NOT NULL DEFAULT 0,\n UNIQUE (uid, invitee)\n )");
break;
}
}