addons-server/migrations/161-clear-recs.sql

14 строки
540 B
MySQL
Исходник Обычный вид История

TRUNCATE addon_recommendations;
2011-03-10 03:27:24 +03:00
ALTER TABLE addons_collections
DROP FOREIGN KEY addons_collections_ibfk_1,
DROP FOREIGN KEY addons_collections_ibfk_2;
ALTER TABLE addons_collections
ADD CONSTRAINT `addons_collections_ibfk_1` FOREIGN KEY (`addon_id`) REFERENCES `addons` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `addons_collections_ibfk_2` FOREIGN KEY (`collection_id`) REFERENCES `collections` (`id`) ON DELETE CASCADE;
UPDATE collections SET recommended_collection_id=NULL;
DELETE FROM collections WHERE collection_type=3;