uc_atctweaks.install 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. // $Id: uc_atctweaks.install,v 1.1 2009/05/19 18:53:48 rszrama Exp $
  3. /**
  4. * @file
  5. * Installs the necessary table for the Add to Cart Tweaks product features.
  6. */
  7. /**
  8. * Implementation of hook_schema()
  9. */
  10. function uc_atctweaks_schema() {
  11. $schema = array();
  12. $schema['uc_atctweaks_products'] = array(
  13. 'fields' => array(
  14. 'vpid' => array(
  15. 'type' => 'serial',
  16. 'unsigned' => TRUE,
  17. 'not null' => TRUE,
  18. ),
  19. 'pfid' => array(
  20. 'type' => 'int',
  21. 'unsigned' => TRUE,
  22. 'not null' => TRUE,
  23. 'default' => 0,
  24. ),
  25. 'cart_empty' => array(
  26. 'description' => 'Cart empty setting for this instance of the feature.',
  27. 'type' => 'int',
  28. 'size' => 'small',
  29. 'not null' => TRUE,
  30. 'default' => 0,
  31. ),
  32. 'redirect' => array(
  33. 'description' => 'Add to cart redirect for this instance of the feature.',
  34. 'type' => 'varchar',
  35. 'length' => 255,
  36. 'not null' => TRUE,
  37. 'default' => '',
  38. ),
  39. ),
  40. 'indexes' => array(
  41. 'pfid' => array('pfid'),
  42. ),
  43. 'primary key' => array('vpid'),
  44. );
  45. return $schema;
  46. }
  47. /**
  48. * Implementation of hook_uninstall()
  49. */
  50. function uc_atctweaks_uninstall() {
  51. db_delete('uc_product_features')
  52. ->condition('fid', 'atctweaks')
  53. ->execute();
  54. }