-
-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathabantecart_database_upgrade.sql
More file actions
executable file
·248 lines (174 loc) · 8.32 KB
/
Copy pathabantecart_database_upgrade.sql
File metadata and controls
executable file
·248 lines (174 loc) · 8.32 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
INSERT INTO `ac_settings` (`group`, `key`, `value`) VALUES ('system','core_version', "1.4.4");
alter table `ac_ant_messages`
modify `start_date` timestamp null;
alter table `ac_ant_messages`
modify `viewed_date` timestamp null;
alter table `ac_banner_descriptions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_banners`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_block_descriptions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_block_descriptions`
modify `date_modified` timestamp default current_timestamp() not null on update current_timestamp();
alter table `ac_block_templates`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_blocks`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_categories`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_collections`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_content_descriptions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_contents`
drop primary key,
MODIFY COLUMN `content_id` INT AUTO_INCREMENT PRIMARY KEY;
alter table `ac_coupons`
modify `date_start` date null;
alter table `ac_coupons`
modify `date_end` date null;
alter table `ac_coupons`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_coupons_categories`
charset = utf8mb4 COLLATE utf8mb4_unicode_ci;
alter table `ac_custom_blocks`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_custom_lists`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_customer_notifications`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_customer_transactions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_customers`
modify `telephone` varchar(32) default '' not null,
modify `date_added` timestamp default current_timestamp() null,
modify `last_login` timestamp null;
update `ac_customers` SET `date_added` = `date_modified` WHERE `date_added` = '0000-00-00 00:00:00';
alter table `ac_downloads`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_email_templates`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_extensions`
modify `date_installed` timestamp null;
alter table `ac_extensions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_global_attributes_type_descriptions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_language_definitions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_layouts`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_length_classes`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_locations`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_messages`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_online_customers`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_order_data`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_order_data_types`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_order_downloads`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_order_history`
modify `date_added` timestamp default current_timestamp() null;
ALTER TABLE `ac_orders` MODIFY date_added timestamp default current_timestamp();
update `ac_orders` SET date_added = date_modified WHERE date_added = '0000-00-00 00:00:00';
alter table `ac_page_descriptions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_pages`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_product_discounts`
modify `date_start` date null;
alter table `ac_product_discounts`
modify `date_end` date null;
alter table `ac_product_discounts`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_product_specials`
modify `date_start` date null;
alter table `ac_product_specials`
modify `date_end` date null;
alter table `ac_product_specials`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_products`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_resource_descriptions`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_resource_library`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_resource_map`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_reviews`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_settings`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_task_details`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_task_steps`
modify `last_time_run` timestamp null;
alter table `ac_task_steps`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_task_steps`
engine = InnoDB;
alter table `ac_tasks`
modify `last_time_run` timestamp null;
alter table `ac_tasks`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_tax_classes`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_tax_rates`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_user_groups`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_user_notifications`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_users`
modify `last_login` datetime null;
alter table `ac_users`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_weight_classes`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_zones_to_locations`
modify `date_added` timestamp default current_timestamp() null;
alter table `ac_stock_statuses`
modify `name` varchar(128) NOT NULL COMMENT 'translatable';
create index `ac_orders_date_idx`
on `ac_orders` (`date_added` desc, `date_modified` desc);
--
-- Table structure for table `ac_shopping_sessions`
--
DROP TABLE IF EXISTS `ac_shopping_sessions`;
create table `ac_shopping_sessions`
(
`customer_id` int null,
`order_id` int null,
`type` varchar(255) not null,
`key` varchar(255) not null,
`data` json not null,
`date_added` timestamp default CURRENT_TIMESTAMP not null,
`date_modified` timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP,
constraint `ac_shopping_sessions_customer_fk`
foreign key (`customer_id`) references `ac_customers` (`customer_id`)
on update cascade on delete cascade
);
create index `ac_shopping_sessions_int_idx`
on `ac_shopping_sessions` (`customer_id` desc, `order_id` desc);
create unique index `ac_shopping_sessions_text_idx`
on `ac_shopping_sessions` (`type`, `key`);
UPDATE `ac_product_discounts` SET date_start = NULL WHERE date_start = '0000-00-00';
UPDATE `ac_product_discounts` SET date_end = NULL WHERE date_end = '0000-00-00';
UPDATE `ac_product_specials` SET date_start = NULL WHERE date_start = '0000-00-00';
UPDATE `ac_product_specials` SET date_end = NULL WHERE date_end = '0000-00-00';
alter table `ac_category_descriptions`
modify `description` longtext NULL COMMENT 'translatable';
alter table `ac_contents`
add show_title int(1) default 1 null after content_bar;
ALTER TABLE `ac_url_aliases`
DROP INDEX `ac_url_aliases_idx2`,
MODIFY COLUMN `query` varchar(2048) NOT NULL,
ADD COLUMN `query_hash` char(32) GENERATED ALWAYS AS (MD5(`query`)) STORED AFTER `query`;
CREATE UNIQUE INDEX `ac_url_aliases_idx2`
ON `ac_url_aliases` (`query_hash`, `language_id`);