arch-8.x-1.x-dev/modules/order/arch_order.install
modules/order/arch_order.install
<?php
/**
* @file
* Update/install hooks.
*/
/**
* Implements hook_install().
*/
function arch_order_install() {
_arch_order_install_english_order_mails();
}
/**
* Implements hook_schema().
*/
function arch_order_schema() {
$schema['arch_order_address'] = [
'description' => 'Stores addresses for each order.',
'fields' => [
'order_id' => [
'description' => 'The {arch_order}.oid this record affects.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
],
'address_type' => [
'description' => 'The address type of the order.',
'type' => 'varchar',
'length' => 15,
'not null' => TRUE,
],
'country_code' => [
'description' => 'The two-letter country code.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
],
'administrative_area' => [
'description' => 'The top-level administrative subdivision of the country.',
'type' => 'varchar',
'length' => 255,
],
'locality' => [
'description' => 'The locality (i.e. city).',
'type' => 'varchar',
'length' => 255,
],
'dependent_locality' => [
'description' => 'The dependent locality (i.e. neighbourhood).',
'type' => 'varchar',
'length' => 255,
],
'postal_code' => [
'description' => 'The postal code.',
'type' => 'varchar',
'length' => 255,
],
'sorting_code' => [
'description' => 'The sorting code.',
'type' => 'varchar',
'length' => 255,
],
'address_line1' => [
'description' => 'The first line of the address block.',
'type' => 'varchar',
'length' => 255,
],
'address_line2' => [
'description' => 'The second line of the address block.',
'type' => 'varchar',
'length' => 255,
],
'organization' => [
'description' => 'Organization',
'type' => 'varchar',
'length' => 255,
],
'given_name' => [
'description' => 'Given name',
'type' => 'varchar',
'length' => 255,
],
'additional_name' => [
'description' => 'Additinal name',
'type' => 'varchar',
'length' => 255,
],
'family_name' => [
'description' => 'Family name',
'type' => 'varchar',
'length' => 255,
],
'tax_id' => [
'description' => 'Tax number.',
'type' => 'varchar',
'length' => 255,
],
'phone' => [
'description' => 'Phone number.',
'type' => 'varchar',
'length' => 32,
],
],
'primary key' => ['order_id', 'address_type'],
'foreign keys' => [
'order_address' => [
'table' => 'arch_order',
'columns' => ['order_id' => 'oid'],
],
],
];
return $schema;
}
