[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/panels/panels_node/ -> panels_node.install (source)

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


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7