You are here

nopremium.install in Node Option Premium 6

Same filename and directory in other branches
  1. 8 nopremium.install
  2. 7 nopremium.install

Written by Henri MEDOT <henri.medot[AT]absyx[DOT]fr> http://www.absyx.fr

File

nopremium.install
View source
<?php

/**
 * @file
 * Written by Henri MEDOT <henri.medot[AT]absyx[DOT]fr>
 * http://www.absyx.fr
 */

/**
 * Implementation of hook_schema_alter().
 */
function nopremium_schema_alter(&$schema) {
  $schema['node']['fields']['premium'] = array(
    'type' => 'int',
    'size' => 'tiny',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  );
  $schema['node']['indexes']['node_premium_status'] = array(
    'premium',
    'status',
  );
}

/**
 * Implementation of hook_install().
 */
function nopremium_install() {
  db_query("UPDATE {system} SET weight = %d WHERE name = '%s'", 10, 'nopremium');
  $ret = array();
  db_add_field($ret, 'node', 'premium', array(
    'type' => 'int',
    'size' => 'tiny',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ), array(
    'indexes' => array(
      'node_premium_status' => array(
        'premium',
        'status',
      ),
    ),
  ));
}

/**
 * Implementation of hook_uninstall().
 */
function nopremium_uninstall() {
  $ret = array();
  db_drop_index($ret, 'node', 'node_premium_status');
  db_drop_field($ret, 'node', 'premium');
  db_query("DELETE FROM {variable} WHERE name LIKE 'nopremium_%%'");
}

/**
 * Implementation of hook_update_N().
 */
function nopremium_update_6001() {
  db_query("UPDATE {system} SET weight = %d WHERE name = '%s'", 10, 'nopremium');
  return array();
}

Functions

Namesort descending Description
nopremium_install Implementation of hook_install().
nopremium_schema_alter Implementation of hook_schema_alter().
nopremium_uninstall Implementation of hook_uninstall().
nopremium_update_6001 Implementation of hook_update_N().