function mailchimp_ecommerce_schema in Mailchimp E-Commerce 7
Same name and namespace in other branches
- 8 mailchimp_ecommerce.install \mailchimp_ecommerce_schema()
Implements hook_schema().
File
- ./
mailchimp_ecommerce.install, line 22 - Mailchimp eCommerce install and update hooks.
Code
function mailchimp_ecommerce_schema() {
$schema['mailchimp_ecommerce_customer'] = [
'description' => 'Maintains a connection between carts, orders and a Mailchimp customer.',
'fields' => [
'mailchimp_customer_id' => [
'description' => 'Primary Key (unique ID).',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'mail' => [
'description' => 'The customer email.',
'type' => 'varchar',
'length' => 254,
'not null' => FALSE,
],
'orders_count' => [
'type' => 'int',
'description' => 'Total orders for this customer.',
'unsigned' => TRUE,
'default' => 0,
],
'total_spent' => [
'type' => 'numeric',
'description' => 'Total amount spent by this customer.',
'unsigned' => TRUE,
'precision' => 19,
'scale' => 6,
'default' => 0,
],
],
'primary key' => [
'mailchimp_customer_id',
],
'indexes' => [
'mail' => [
'mail',
],
],
];
return $schema;
}