public static function dropForeignKeys() { if (!self::$counter) { $resource = Mage::getModel('core/resource'); $connection = $resource->getConnection('core_write'); $FKscope = array('aw_zblocks_content' => array('FK_zblocks')); foreach ($FKscope as $table => $fks) { foreach ($fks as $fk) { try { $connection->exec(new Zend_Db_Expr("ALTER TABLE `{$table}` DROP FOREIGN KEY `{$fk}`")); $connection->exec(new Zend_Db_Expr("ALTER TABLE `{$table}` DROP KEY `{$fk}`")); } catch (Exception $e) { } } } self::$counter = 1; } }