Even more fixes for migration 854 - it had lots of remaining tables depending on it

This commit is contained in:
Mathieu Pillard 2016-01-19 15:54:11 +01:00
Родитель 96ff4fd236
Коммит 4785e9bede
1 изменённых файлов: 51 добавлений и 1 удалений

Просмотреть файл

@ -1,7 +1,57 @@
DROP TABLE IF EXISTS `addon_recommendations`;
-- collection_type 1: COLLECTION_SYNCHRONIZED
-- collection_type 3: COLLECTION_RECOMMENDED
DELETE addons_collections FROM addons_collections
INNER JOIN collections
ON addons_collections.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE collection_promos FROM collection_promos
INNER JOIN collections
ON collection_promos.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE collection_subscriptions FROM collection_subscriptions
INNER JOIN collections
ON collection_subscriptions.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE FROM collections WHERE collection_type IN (1, 3); -- COLLECTION_SYNCHRONIZED or COLLECTION_RECOMMENDED
DELETE collections_users FROM collections_users
INNER JOIN collections
ON collections_users.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE collections_votes FROM collections_votes
INNER JOIN collections
ON collections_votes.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE featured_collections FROM featured_collections
INNER JOIN collections
ON featured_collections.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE stats_addons_collections_counts FROM stats_addons_collections_counts
INNER JOIN collections
ON stats_addons_collections_counts.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE stats_collections FROM stats_collections
INNER JOIN collections
ON stats_collections.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE stats_collections_counts FROM stats_collections_counts
INNER JOIN collections
ON stats_collections_counts.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE stats_collections_share_counts_totals FROM stats_collections_share_counts_totals
INNER JOIN collections
ON stats_collections_share_counts_totals.collection_id=collections.id
WHERE collections.collection_type IN (1, 3);
DELETE FROM collections WHERE collection_type IN (1, 3);
DELETE FROM waffle_flag WHERE name = 'disco-pane-show-recs';