| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function ezshop_install() {
|
| 8 |
switch ($GLOBALS['db_type']) {
|
| 9 |
case 'mysql':
|
| 10 |
case 'mysqli':
|
| 11 |
db_query("CREATE TABLE {ezshop_items} (
|
| 12 |
uid int unsigned default '0',
|
| 13 |
nid int unsigned default '0',
|
| 14 |
cnt tinyint unsigned default '0',
|
| 15 |
PRIMARY KEY (uid, nid),
|
| 16 |
KEY (uid)
|
| 17 |
) /*!40100 DEFAULT CHARACTER SET UTF8 */");
|
| 18 |
// TODO: Development path: store the orders to be able to follow and/or review them.
|
| 19 |
// db_query("CREATE TABLE {ezshop_orders} (
|
| 20 |
// oid int unsigned default '0',
|
| 21 |
// uid int unsigned default '0',
|
| 22 |
// status tinyint unsigned default '0',
|
| 23 |
// PRIMARY KEY (oid)
|
| 24 |
// ) /*!40100 DEFAULT CHARACTER SET UTF8 */"); // TODO: add more keys as needed.
|
| 25 |
break;
|
| 26 |
case 'pgsql':
|
| 27 |
// FIXME: to be implemented
|
| 28 |
break;
|
| 29 |
}
|
| 30 |
}
|
| 31 |
|
| 32 |
/**
|
| 33 |
* Implementation of hook_uninstall().
|
| 34 |
*/
|
| 35 |
function ezshop_uninstall() {
|
| 36 |
db_query('DROP TABLE {ezshop_items}');
|
| 37 |
// db_query('DROP TABLE {ezshop_orders}');
|
| 38 |
variable_del('ezshop_content_types');
|
| 39 |
variable_del('ezshop_linkweight');
|
| 40 |
variable_del('ezshop_ordermail');
|
| 41 |
variable_del('ezshop_mailfooter');
|
| 42 |
}
|
| 43 |
|
| 44 |
// vim: set ft=php syntax=php expandtab ts=2 sw=2 autoindent smartindent:
|