I am trying to add a field (middle name) into the field_schema of the contrib addressfield module (I initially didn't want to hack it, but was unsucessful in adding a field in from my custom module.). The module has the following hook_field_schema()
function addressfield_field_schema() { $columns = array( 'country' => array( 'description' => 'Two letter ISO country code of this address.', 'type' => 'varchar', 'length' => 2, 'not null' => FALSE, 'default' => '', ), 'administrative_area' => array( 'description' => 'The administrative area of this address. (i.e. State/Province)', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'sub_administrative_area' => array( 'description' => 'The sub administrative area of this address.', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'locality' => array( 'description' => 'The locality of this address. (i.e. City)', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'dependent_locality' => array( 'description' => 'The dependent locality of this address.', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'postal_code' => array( 'description' => 'The postal code of this address.', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'thoroughfare' => array( 'description' => 'The thoroughfare of this address. (i.e. Street address)', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'premise' => array( 'description' => 'The premise of this address. (i.e. Apartment / Suite number)', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'sub_premise' => array( 'description' => 'The sub_premise of this address.', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not null' => FALSE, ), 'organisation_name' => array( 'description' => 'Contents of a primary OrganisationName element in the xNL XML.', 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => '', ), 'name_line' => array( 'description' => 'Contents of a primary NameLine element in the xNL XML.', 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => '', ), 'first_name' => array( 'description' => 'Contents of the FirstName element of a primary PersonName element in the xNL XML.', 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => '', ), 'last_name' => array( 'description' => 'Contents of the LastName element of a primary PersonName element in the xNL XML.', 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => '', ), 'last_name' => array( 'description' => 'Contents of the LastName element of a primary PersonName element in the xNL XML.', 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => '', ), 'data' => array( 'description' => 'Additional data for this address.', 'type' => 'text', 'size' => 'big', 'not null' => FALSE, 'serialize' => TRUE, ), ); return array( 'columns' => $columns, // TODO Add indexes. ); }
I found this post online for doing a field_schema update https://drupal.org/node/150215, but I don't know what the field name or table name is, its not listed in the file. How can I do this? My ultimate goal is to make a standalone plugin file to be used by addressfield, but I needed to update the schema first.