| 1 |
<?php
|
| 2 |
|
| 3 |
function adaptive_context_install() {
|
| 4 |
switch ($GLOBALS['db_type']) {
|
| 5 |
case 'mysqli':
|
| 6 |
case 'mysql':
|
| 7 |
db_query("CREATE TABLE if not exists {ac_group} (
|
| 8 |
gid int(10) unsigned NOT NULL auto_increment,
|
| 9 |
gtype char(16) NOT NULL,
|
| 10 |
name char(128) NOT NULL,
|
| 11 |
PRIMARY KEY (gid)
|
| 12 |
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 13 |
db_query("CREATE TABLE if not exists {ac_class} (
|
| 14 |
cid int(10) unsigned NOT NULL auto_increment,
|
| 15 |
ctype char(16) NOT NULL,
|
| 16 |
PRIMARY KEY (cid)
|
| 17 |
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 18 |
db_query("CREATE TABLE if not exists {ac_part} (
|
| 19 |
pid int(10) unsigned NOT NULL auto_increment,
|
| 20 |
ptype char(16) NOT NULL,
|
| 21 |
gid int(10) unsigned NOT NULL,
|
| 22 |
cid int(10) unsigned NOT NULL,
|
| 23 |
PRIMARY KEY (pid)
|
| 24 |
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 25 |
}
|
| 26 |
}
|
| 27 |
|
| 28 |
function adaptive_context_uninstall() {
|
| 29 |
db_query('DROP TABLE {ac_group}');
|
| 30 |
db_query('DROP TABLE {ac_class}');
|
| 31 |
db_query('DROP TABLE {ac_part}');
|
| 32 |
}
|
| 33 |
|
| 34 |
?>
|