You are here

slickgrid.install in Slickgrid 6

Same filename and directory in other branches
  1. 7.2 slickgrid.install
  2. 7 slickgrid.install

File

slickgrid.install
View source
<?php

/**
 * Implementation of hook_install(). Installs the current version of the database schema.
 */
function slickgrid_install() {

  // Set the module's weight high so that it runs after other modules.
  db_query("UPDATE {system} SET weight = 100 WHERE name = 'slickgrid' and type = 'module'");
  if (module_exists('lightbox2')) {

    // Set the module's weight higher than 100 so that it runs after slickgrid
    // We need to do this so we can set variables before lightbox adds its js files in hook_init()
    db_query("UPDATE {system} SET weight = 101 WHERE name = 'lightbox2' and type = 'module'");
  }

  // Create tables.
  drupal_install_schema('slickgrid');
}
function slickgrid_uninstall() {
  drupal_uninstall_schema('slickgrid');
}

/**
 * Implementation of hook_schema().
 */
function slickgrid_schema() {
  $schema['slickgrid'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The users UID.',
      ),
      'view_name' => array(
        'type' => 'varchar',
        'length' => '32',
        'default' => '',
        'not null' => TRUE,
        'description' => 'The unique name of the view. May only be alphanumeric characters plus underscores.',
      ),
      'settings' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
        'description' => 'A serialized array of view settings.',
      ),
    ),
    'primary key' => array(
      'uid',
      'view_name',
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
slickgrid_install Implementation of hook_install(). Installs the current version of the database schema.
slickgrid_schema Implementation of hook_schema().
slickgrid_uninstall