uc_field_attribute.install in Ubercart Field attributes 7
Install, update and uninstall functions for the UC Field Attribute module.
(C)2011 Michael Moritz miiimooo/at/drupal.org http://drupal.org/user/62954
File
uc_field_attribute.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the UC Field Attribute module.
*
* (C)2011 Michael Moritz miiimooo/at/drupal.org http://drupal.org/user/62954
*/
/**
* Implements hook_uninstall().
*/
/// TODO remove uc_field_attribute_* variables
/**
* Implements hook_schema().
*/
function uc_field_attribute_schema() {
$schema['uc_field_attribute_node'] = array(
'description' => 'Stores which attribute belongs to which node and is maintained by us.',
'fields' => array(
'aid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: The {uc_attribute}.aid.',
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {node}.nid of the product.',
),
'field_instance_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {field_instance_config}.id.',
),
),
'primary key' => array(
'aid',
),
///TODO
'indexes' => array(
'nid-field_instance_id' => array(
'nid',
'field_instance_id',
),
),
);
$schema['uc_field_attribute_options'] = array(
'description' => 'Stores options for synchronisation.',
'fields' => array(
'aid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: The {uc_attribute}.aid.',
),
'oid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {uc_attribute_options}.oid.',
),
'name' => array(
'description' => 'The name of the option.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'aid',
'oid',
),
///TODO
'indexes' => array(
'aid' => array(
'aid',
),
),
);
return $schema;
}
Functions
Name![]() |
Description |
---|---|
uc_field_attribute_schema | Implements hook_schema(). |