-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprice_in_time.install
76 lines (73 loc) · 1.98 KB
/
price_in_time.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* @file
* Install, update and uninstall functions for the Price in Time module.
*/
/**
* Implements hook_schema().
*/
function price_in_time_schema() {
$schema['commerce_product_variation_slots_data'] = [
'description' => 'Table used for price slots tracking for products variations.',
'fields' => [
'id' => [
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique record ID.',
],
'product_variation_sku' => [
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'unique' => TRUE,
'description' => 'The product variation SKU key, that is unique for every product/product variation.',
],
'product_variation' => [
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'description' => 'The product variation machine name.',
],
'slot_uuid' => [
'type' => 'varchar',
'length' => 20,
'not null' => TRUE,
'unique' => TRUE,
'description' => 'The slot id related to slots.',
],
'number' => [
'type' => 'numeric',
'precision' => 19,
'scale' => 6,
'not null' => TRUE,
'description' => 'The price applyed to specific start-end time slot. Override the current price of the product.',
],
'currency_code' => [
'type' => 'varchar',
'length' => 3,
'not null' => TRUE,
'description' => 'The currency code applyed to specific start-end time slot.',
],
'created' => [
'type' => 'int',
'not null' => TRUE,
'description' => 'Timestamp when the record was created.',
],
],
'unique key' => [
'product_variation_sku',
'slot_uuid',
],
'primary key' => [
'id',
],
'indexes' => [
'product_variation' => [
'product_variation_sku',
'product_variation',
'slot_uuid',
],
],
];
return $schema;
}