| 1 |
<?php |
<?php |
| 2 |
// $Id: importexportapi.install,v 1.5 2006/11/05 07:03:29 jaza Exp $ |
// $Id: importexportapi.install,v 1.5.6.1 2009/05/05 17:48:44 earnie Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 13 |
function importexportapi_install() { |
function importexportapi_install() { |
| 14 |
// Create tables |
// Create tables |
| 15 |
drupal_install_schema('importexportapi'); |
drupal_install_schema('importexportapi'); |
|
//drupal_install_schema('importexportapi_db_put_map'); |
|
|
//drupal_install_schema('importexportapi_db_put_map_alt'); |
|
| 16 |
} |
} |
| 17 |
|
|
| 18 |
/** |
/** |
| 20 |
*/ |
*/ |
| 21 |
function importexportapi_uninstall() { |
function importexportapi_uninstall() { |
| 22 |
// Drop tables |
// Drop tables |
| 23 |
drupal_uninstall_schema('importexportapi'); |
drupal_uninstall_schema('importexportapi'); |
|
//drupal_uninstall_schema('importexportapi_db_put_map'); |
|
|
//drupal_uninstall_schema('importexportapi_db_put_map_alt'); |
|
| 24 |
} |
} |
| 25 |
|
|
| 26 |
|
|
| 31 |
$schema['importexportapi_db_put_map'] = array( |
$schema['importexportapi_db_put_map'] = array( |
| 32 |
'fields' => array( |
'fields' => array( |
| 33 |
'put_map_id' => array( |
'put_map_id' => array( |
| 34 |
'type' => 'int', |
'type' => 'serial', |
| 35 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 36 |
'not null' => TRUE, |
'not null' => TRUE, |
| 37 |
'auto_increment'), |
), |
| 38 |
'put_id' => array( |
'put_id' => array( |
| 39 |
'type' => 'int', |
'type' => 'int', |
| 40 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 69 |
$schema['importexportapi_db_put_map_alt'] = array( |
$schema['importexportapi_db_put_map_alt'] = array( |
| 70 |
'fields' => array( |
'fields' => array( |
| 71 |
'put_map_alt_id' => array( |
'put_map_alt_id' => array( |
| 72 |
'type' => 'int', |
'type' => 'serial', |
| 73 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 74 |
'not null' => TRUE, |
'not null' => TRUE, |
| 75 |
'auto_increment'), |
), |
| 76 |
'put_id' => array( |
'put_id' => array( |
| 77 |
'type' => 'int', |
'type' => 'int', |
| 78 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 115 |
function importexportapi_update_1() { |
function importexportapi_update_1() { |
| 116 |
$ret = array(); |
$ret = array(); |
| 117 |
|
|
| 118 |
db_add_field($ret, 'db_put_map_alt', 'put_map_alt_id', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'auto_increment')); |
db_add_field($ret, 'db_put_map_alt', 'put_map_alt_id', array( |
| 119 |
db_add_field($ret, 'db_put_map_alt', 'put_id', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)); |
'type' => 'serial', |
| 120 |
db_add_field($ret, 'db_put_map_alt', 'entity', array('type' => 'varchar', 'not null' => TRUE, 'default')); |
'unsigned' => TRUE, |
| 121 |
db_add_field($ret, 'db_put_map_alt', 'field', array('type' => 'varchar', 'not null' => TRUE, 'default')); |
'not null' => TRUE, |
| 122 |
db_add_field($ret, 'db_put_map_alt', 'alt_field', array('type' => 'varchar', 'not null' => TRUE, 'default')); |
)); |
| 123 |
db_add_field($ret, 'db_put_map_alt', 'value_alt', array('type' => 'varchar', 'not null' => TRUE, 'default' => 0)); |
db_add_field($ret, 'db_put_map_alt', 'put_id', array( |
| 124 |
db_add_field($ret, 'db_put_map_alt', 'value_key', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)); |
'type' => 'int', |
| 125 |
db_add_index($ret, 'db_put_map_alt', 'put_map_alt_id', array('put_map_alt_id')); |
'unsigned' => TRUE, |
| 126 |
|
'not null' => TRUE, |
| 127 |
|
'default' => 0, |
| 128 |
|
)); |
| 129 |
|
db_add_field($ret, 'db_put_map_alt', 'entity', array( |
| 130 |
|
'type' => 'varchar', |
| 131 |
|
'not null' => TRUE, |
| 132 |
|
'default', |
| 133 |
|
)); |
| 134 |
|
db_add_field($ret, 'db_put_map_alt', 'field', array( |
| 135 |
|
'type' => 'varchar', |
| 136 |
|
'not null' => TRUE, |
| 137 |
|
'default' |
| 138 |
|
)); |
| 139 |
|
db_add_field($ret, 'db_put_map_alt', 'alt_field', array( |
| 140 |
|
'type' => 'varchar', |
| 141 |
|
'not null' => TRUE, |
| 142 |
|
'default' |
| 143 |
|
)); |
| 144 |
|
db_add_field($ret, 'db_put_map_alt', 'value_alt', array( |
| 145 |
|
'type' => 'varchar', |
| 146 |
|
'not null' => TRUE, |
| 147 |
|
'default' => 0, |
| 148 |
|
)); |
| 149 |
|
db_add_field($ret, 'db_put_map_alt', 'value_key', array( |
| 150 |
|
'type' => 'int', |
| 151 |
|
'unsigned' => TRUE, |
| 152 |
|
'not null' => TRUE, |
| 153 |
|
'default' => 0, |
| 154 |
|
)); |
| 155 |
|
db_add_index($ret, 'db_put_map_alt', 'put_map_alt_id', array( |
| 156 |
|
'put_map_alt_id' |
| 157 |
|
)); |
| 158 |
|
|
| 159 |
return $ret;; |
return $ret;; |
| 160 |
} |
} |