Now all modules are in core modules folder
This commit is contained in:
parent
5ba1cdfa0b
commit
05b6a91b0c
1907 changed files with 0 additions and 0 deletions
85
modules/geshifilter/geshinode.install
Normal file
85
modules/geshifilter/geshinode.install
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Installation and uninstallation functions for the GeSHi node module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_schema()
|
||||
*/
|
||||
function geshinode_schema() {
|
||||
$schema['geshinode'] = array(
|
||||
'description' => t('The table for geshinodes.'),
|
||||
'fields' => array(
|
||||
'nid' => array(
|
||||
'description' => t('The primary identifier for a node.'),
|
||||
'type' => 'int',
|
||||
'unsigned' => TRUE,
|
||||
'not null' => TRUE,
|
||||
),
|
||||
'vid' => array(
|
||||
'description' => t('The current {node_revisions}.vid version identifier.'),
|
||||
'type' => 'int',
|
||||
'unsigned' => TRUE,
|
||||
'not null' => TRUE,
|
||||
'default' => 0,
|
||||
),
|
||||
'language' => array(
|
||||
'description' => t('The source code language of the node.'),
|
||||
'type' => 'varchar',
|
||||
'length' => 64,
|
||||
'not null' => TRUE,
|
||||
'default' => '',
|
||||
),
|
||||
),
|
||||
'primary key' => array('vid'),
|
||||
'indexes' => array('nid' => array('nid')),
|
||||
);
|
||||
return $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create tables on install
|
||||
*/
|
||||
function geshinode_install() {
|
||||
// Create geshinode tables.
|
||||
drupal_install_schema('geshinode');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove tables on uninstall.
|
||||
*/
|
||||
function geshinode_uninstall() {
|
||||
// Drop geshinode tables.
|
||||
drupal_uninstall_schema('geshinode');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of hook_update_N().
|
||||
*
|
||||
* Fix the primary key and indices on the geshinode table.
|
||||
* See http://drupal.org/node/363770 .
|
||||
*/
|
||||
function geshinode_update_6001() {
|
||||
$ret = array();
|
||||
// Drop unique key on 'vid'.
|
||||
db_drop_unique_key($ret, 'geshinode', 'vid');
|
||||
// Change the 'nid' field to 'int' (from 'serial').
|
||||
db_change_field($ret, 'geshinode', 'nid', 'nid',
|
||||
array(
|
||||
'description' => t('The primary identifier for a node.'),
|
||||
'type' => 'int',
|
||||
'unsigned' => TRUE,
|
||||
'not null' => TRUE,
|
||||
)
|
||||
);
|
||||
// Drop primary key ('nid').
|
||||
db_drop_primary_key($ret, 'geshinode');
|
||||
// Add primary key on 'vid'.
|
||||
db_add_primary_key($ret, 'geshinode', array('vid'));
|
||||
// Add an index on 'nid'.
|
||||
db_add_index($ret, 'geshinode', 'nid', array('nid'));
|
||||
return $ret;
|
||||
}
|
Reference in a new issue