Current Path : /var/www/html/clients/td-teplouchet.ru/old/sites/all/modules/node_field/ |
Current File : /var/www/html/clients/td-teplouchet.ru/old/sites/all/modules/node_field/node_field.install |
<?php /** * Implements hook_schema(). */ function node_field_schema() { $schema = array(); $schema['node_field'] = array( 'fields' => array( 'id' => array( 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ), 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'type' => array( 'type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'text', ), 'title' => array( 'type' => 'varchar', 'length' => 256, 'not null' => TRUE, 'default' => 'unassigned', ), 'machine_name' => array( 'type' => 'varchar', 'length' => 256, 'not null' => TRUE, 'default' => '', ), 'show_title' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'size' => 'tiny', 'default' => 0, ), 'hidden' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'size' => 'tiny', 'default' => 0, ), 'value' => array( 'type' => 'text', 'size' => 'big', 'not null' => FALSE, ), 'weight' => array( 'type' => 'int', 'unsigned' => FALSE, 'not null' => TRUE, 'size' => 'small', 'default' => 0, ), 'settings' => array( 'type' => 'text', 'size' => 'big', 'not null' => FALSE, 'serialize' => TRUE, ), ), 'primary key' => array('id',), 'indexes' => array( 'target' => array('nid',), ), ); return $schema; } /** * Implements hook_install(). */ function node_field_install() { variable_set('node_field_node_types', array()); } /** * Implements hook_uninstall(). */ function node_field_uninstall() { variable_del('node_field_node_types'); } /** * Add machine_name field. */ function node_field_update_7004() { if (!db_field_exists('node_field', 'machine_name')) { $field = array( 'type' => 'varchar', 'length' => 256, 'not null' => TRUE, 'default' => '', ); db_add_field('node_field', 'machine_name', $field); } } /** * Update for D7 version */ function node_field_update_7003() { if (!db_field_exists('node_field', 'hidden')) { $field = array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'size' => 'tiny', 'default' => 0, ); db_add_field('node_field', 'hidden', $field); } } /** * Update for D7 version */ function node_field_update_7002() { db_change_field('node_field', 'options', 'settings', array('type' => 'text', 'size' => 'big', 'not null' => FALSE, 'serialize' => TRUE)); } /** * Update for D7 version */ function node_field_update_7001() { db_change_field('node_field', 'type', 'type', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => 'text')); } /** * Initial update for D7 version */ function node_field_update_7000() { db_change_field('node_field', 'value', 'value', array('type' => 'text', 'size' => 'big', 'not null' => FALSE)); }