function cas_server_install in CAS 5.3
Same name and namespace in other branches
- 5.4 cas_server.install \cas_server_install()
- 6.3 cas_server.install \cas_server_install()
- 6.2 cas_server.install \cas_server_install()
Inastall db tables.
File
- ./
cas_server.install, line 13 - Cas Server Schema Install
Code
function cas_server_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
// the {tablename} syntax is so multisite installs can add a
// prefix to the table name as set in the settings.php file
db_query("CREATE TABLE {cas_server_tickets} (\n service varchar(256) NOT NULL default '',\n\t\t ticket varchar(256) NOT NULL default '',\n\t\t uid int unsigned NOT NULL,\n\t\t timestamp int NOT NULL, \n PRIMARY KEY (ticket)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("CREATE TABLE {cas_server_tickets} (\n service varchar(256) NOT NULL default '',\n ticket varchar(256) NOT NULL default '',\n uid integer NOT NULL CHECK (uid >= 0),\n timestamp integer NOT NULL, \n PRIMARY KEY (ticket)\n )");
// Pgsql requires keys and indexes to be defined separately.
// It's important to name the index as {tablename}_fieldname_idx
// (the trailing _idx!) so update scripts can be written easily
db_query("CREATE INDEX {cas_server_tickets}_uid_idx\n ON {cas_server_tickets} (uid)");
break;
}
}