You are here

nopremium.install in Node Option Premium 7

Same filename and directory in other branches
  1. 8 nopremium.install
  2. 6 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_update('system')
    ->fields(array(
    'weight' => 10,
  ))
    ->condition('name', 'nopremium')
    ->execute();
  db_add_field('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() {
  db_drop_index('node', 'node_premium_status');
  db_drop_field('node', 'premium');
  db_query("DELETE FROM {variable} WHERE name LIKE 'nopremium_%%'");
}

/**
 * Implementation of hook_update_N().
 */
function nopremium_update_6001() {
}

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().