annotate SQL/mysql/2013061000.sql @ 8:bf99236cc5cd default tip

try to recover from upgrade fail
author Charlie Root
date Sat, 29 Dec 2018 07:07:34 -0500
parents 4681f974d28b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
1 ALTER TABLE `cache` ADD `expires` datetime DEFAULT NULL;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
2 ALTER TABLE `cache_shared` ADD `expires` datetime DEFAULT NULL;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
3 ALTER TABLE `cache_index` ADD `expires` datetime DEFAULT NULL;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
4 ALTER TABLE `cache_thread` ADD `expires` datetime DEFAULT NULL;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
5 ALTER TABLE `cache_messages` ADD `expires` datetime DEFAULT NULL;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
6
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
7 -- initialize expires column with created/changed date + 7days
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
8 UPDATE `cache` SET `expires` = `created` + interval 604800 second;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
9 UPDATE `cache_shared` SET `expires` = `created` + interval 604800 second;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
10 UPDATE `cache_index` SET `expires` = `changed` + interval 604800 second;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
11 UPDATE `cache_thread` SET `expires` = `changed` + interval 604800 second;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
12 UPDATE `cache_messages` SET `expires` = `changed` + interval 604800 second;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
13
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
14 ALTER TABLE `cache` DROP INDEX `created_index`;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
15 ALTER TABLE `cache_shared` DROP INDEX `created_index`;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
16 ALTER TABLE `cache_index` DROP `changed`;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
17 ALTER TABLE `cache_thread` DROP `changed`;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
18 ALTER TABLE `cache_messages` DROP `changed`;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
19
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
20 ALTER TABLE `cache` ADD INDEX `expires_index` (`expires`);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
21 ALTER TABLE `cache_shared` ADD INDEX `expires_index` (`expires`);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
22 ALTER TABLE `cache_index` ADD INDEX `expires_index` (`expires`);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
23 ALTER TABLE `cache_thread` ADD INDEX `expires_index` (`expires`);
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
24 ALTER TABLE `cache_messages` ADD INDEX `expires_index` (`expires`);