| 1 |
<?php
|
| 2 |
|
| 3 |
// Database schema for yahoo_bbauth plug-in
|
| 4 |
// Version 1.0
|
| 5 |
|
| 6 |
function yahoo_bbauth_install() {
|
| 7 |
switch ($GLOBALS['db_type']) {
|
| 8 |
case 'mysql':
|
| 9 |
case 'mysqli':
|
| 10 |
$created = db_query("CREATE TABLE IF NOT EXISTS {yahoo_bbauth} (
|
| 11 |
uid INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
| 12 |
userhash varchar(100) NOT NULL DEFAULT '',
|
| 13 |
alvl int(10) UNSIGNED,
|
| 14 |
PRIMARY KEY (userhash)
|
| 15 |
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 16 |
break;
|
| 17 |
|
| 18 |
case 'pgsql':
|
| 19 |
$created = db_query("CREATE TABLE {yahoo_bbauth} (
|
| 20 |
uid integer NOT NULL DEFAULT '0',
|
| 21 |
userhash varchar(100) NOT NULL default '',
|
| 22 |
alvl integer,
|
| 23 |
PRIMARY KEY (userhash)
|
| 24 |
);");
|
| 25 |
break;
|
| 26 |
}
|
| 27 |
|
| 28 |
if ($created) {
|
| 29 |
drupal_set_message(t('Yahoo_bbauth module table creation successful.'));
|
| 30 |
}
|
| 31 |
else {
|
| 32 |
drupal_set_message(t('Yahoo_bbauth module table creation was unsuccessful.'), 'error');
|
| 33 |
}
|
| 34 |
}
|
| 35 |
|
| 36 |
?>
|