panels_node.install 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * Implementation of hook_schema().
  4. */
  5. function panels_node_schema() {
  6. // This should always point to our 'current' schema. This makes it relatively easy
  7. // to keep a record of schema as we make changes to it.
  8. return panels_node_schema_1();
  9. }
  10. /**
  11. * Schema version 1 for Panels in D6.
  12. */
  13. function panels_node_schema_1() {
  14. $schema = array();
  15. $schema['panels_node'] = array(
  16. 'fields' => array(
  17. 'nid' => array(
  18. 'type' => 'int',
  19. 'not null' => TRUE,
  20. 'default' => 0,
  21. ),
  22. 'css_id' => array(
  23. 'type' => 'varchar',
  24. 'length' => '255',
  25. ),
  26. 'did' => array(
  27. 'type' => 'int',
  28. 'not null' => TRUE,
  29. ),
  30. 'pipeline' => array(
  31. 'type' => 'varchar',
  32. 'length' => '255',
  33. ),
  34. ),
  35. 'primary key' => array('did'),
  36. );
  37. return $schema;
  38. }
  39. /**
  40. * Implementation of hook_install().
  41. */
  42. function panels_node_install() {
  43. db_query("UPDATE {system} SET weight = 11 WHERE name = 'panels_node'");
  44. }
  45. /**
  46. * Implementation of hook_uninstall().
  47. */
  48. function panels_node_uninstall() {
  49. db_query("DELETE FROM {node} WHERE type = 'panel'");
  50. drupal_uninstall_schema('panels_node');
  51. }
  52. /**
  53. * Implementation of hook_update to handle adding a pipeline
  54. */
  55. function panels_node_update_6001() {
  56. $ret = array();
  57. $field = array(
  58. 'type' => 'varchar',
  59. 'length' => '255',
  60. );
  61. db_add_field('panels_node', 'pipeline', $field);
  62. return $ret;
  63. }