node_convert.install in Node Convert 6
Same filename and directory in other branches
The node_convert install file.
Installs necesarry tables for correct node_convert functionality
File
node_convert.installView source
<?php
/**
* @file
* The node_convert install file.
*
* Installs necesarry tables for correct node_convert functionality
*/
function node_convert_schema() {
$schema['node_convert_templates'] = array(
'fields' => array(
'nctid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'name' => array(
'type' => 'text',
'size' => 'small',
),
'source_type' => array(
'type' => 'text',
'size' => 'small',
'not null' => FALSE,
),
'destination_type' => array(
'type' => 'text',
'size' => 'small',
'not null' => TRUE,
),
'data' => array(
'type' => 'text',
'size' => 'medium',
),
),
'primary key' => array(
'nctid',
),
);
return $schema;
}
function node_convert_install() {
// Create my tables.
drupal_install_schema('node_convert');
}
function node_convert_uninstall() {
// Drop my tables.
drupal_uninstall_schema('node_convert');
db_query("DELETE FROM {actions} WHERE callback = 'node_convert_convert_action'");
}
/* Forgot about creating the table for those updating.
* Note: It's ok if it tells you that the table already exists. It's part of the plan.
* Couldn't avoid the error, but it's ok, really.
*/
function node_convert_update_6000() {
$schema['node_convert_templates'] = array(
'fields' => array(
'nctid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'name' => array(
'type' => 'text',
'size' => 'small',
),
'source_type' => array(
'type' => 'text',
'size' => 'small',
'not null' => FALSE,
),
'destination_type' => array(
'type' => 'text',
'size' => 'small',
'not null' => TRUE,
),
'data' => array(
'type' => 'text',
'size' => 'medium',
),
),
'primary key' => array(
'nctid',
),
);
$ret = array();
db_create_table($ret, 'node_convert_templates', $schema['node_convert_templates']);
return $ret;
}
/* Changing ctid to nctid, to prevent errors appearing on PostgreSQL installation.
* Note: It's ok if you get an field doesn't exist error. Couldn't avoid this error either.
*/
function node_convert_update_6001() {
$ret = array();
db_change_field($ret, 'node_convert_templates', 'ctid', 'nctid', array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
));
return $ret;
}
Functions
Name | Description |
---|---|
node_convert_install | |
node_convert_schema | @file The node_convert install file. |
node_convert_uninstall | |
node_convert_update_6000 | |
node_convert_update_6001 |