You are here

panels_sections.install in Panels Sections 6

Same filename and directory in other branches
  1. 6.2 panels_sections.install

File

panels_sections.install
View source
<?php

function panels_sections_install() {

  // Create tables.
  drupal_install_schema('panels_sections');

  // Set module weight to negative value to be the first called.
  db_query("UPDATE {system} SET weight = '-100' WHERE name = 'panels_sections'");
}

/**
 * Implementation of hook_uninstall().
 */
function panels_sections_uninstall() {

  // Remove tables.
  drupal_uninstall_schema('panels_sections');
}

/**
 * Implementation of hook_schema().
 */
function panels_sections_schema() {
  $schema = array();
  $schema['panels_sections_data'] = array(
    'fields' => array(
      'sid' => array(
        'type' => 'serial',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 255,
        'default' => '',
      ),
      'status' => array(
        'type' => 'int',
        'size' => 'tiny',
        'default' => '0',
      ),
      'path' => array(
        'type' => 'text',
        'size' => 'normal',
      ),
      'panels_page' => array(
        'type' => 'int',
        'size' => 'tiny',
        'default' => '0',
      ),
      'visibility' => array(
        'type' => 'int',
        'size' => 'tiny',
        'default' => '0',
      ),
      'weight' => array(
        'type' => 'int',
        'size' => 'normal',
        'default' => '0',
      ),
    ),
    'primary key' => array(
      'sid',
    ),
  );
  return $schema;
}

Functions