'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '2')); } } /** * Implements hook_enable(). */ function ec_cart_enable() { // Reset the the ptypes cache so it loads up the new ptypes correctly ec_product_get_types('types', NULL, TRUE); } /** * Implements hook_uninstall(). */ function ec_cart_uninstall() { variable_del('ec_cart_empty_hide'); if (db_field_exists('ec_product', 'hide_cart_link')) { $ret = array(); db_drop_field('ec_product', 'hide_cart_link'); } } /** * Implements hook_schema(). */ function ec_cart_schema() { $schema = array(); $schema['ec_cart'] = array( 'fields' => array( 'cookie_id' => array( 'type' => 'varchar', 'length' => '64', 'not null' => FALSE, ), 'nid' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '10', ), 'qty' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '10', ), 'changed' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11', ), 'data' => array( 'type' => 'text', 'not null' => FALSE, 'serialize' => TRUE, ), ), 'indexes' => array( 'cookie_id' => array('cookie_id'), ), ); return $schema; } /** * Implements hook_schema_alter(). */ function ec_cart_schema_alter(&$schema) { $schema['ec_product']['fields']['hide_cart_link'] = array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ); } /** * Implements hook_update_last_removed(). */ function ec_cart_update_last_removed() { return 6400; } /** * Extend the length of the cookie_id */ function ec_cart_update_7400() { db_change_field('ec_cart', 'cookie_id', 'cookie_id', array( 'type' => 'varchar', 'length' => '64', 'not null' => FALSE, )); }