diff --git a/app/code/community/Aoe/AsyncCache/sql/aoeasynccache_setup/mysql4-upgrade-0.0.3-1.0.0.php b/app/code/community/Aoe/AsyncCache/sql/aoeasynccache_setup/mysql4-upgrade-0.0.3-1.0.0.php index 2b2803b..cae13b1 100644 --- a/app/code/community/Aoe/AsyncCache/sql/aoeasynccache_setup/mysql4-upgrade-0.0.3-1.0.0.php +++ b/app/code/community/Aoe/AsyncCache/sql/aoeasynccache_setup/mysql4-upgrade-0.0.3-1.0.0.php @@ -5,16 +5,14 @@ $installer = $this; $installer->startSetup(); +$table = $installer->getTable('aoeasynccache/asynccache'); +$connection = $installer->getConnection(); // truncate table first -$installer->getConnection()->truncateTable($installer->getTable('aoeasynccache/asynccache')); +$connection->truncate($table); // add index -$installer->getConnection()->addIndex( - $installer->getTable('aoeasynccache/asynccache'), - $installer->getIdxName('aoeasynccache/asynccache', array('mode', 'tags', 'status')), - array('mode', 'tags', 'status'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE -); +$query = 'CREATE UNIQUE INDEX IDX_ASYNCCACHE_MODE_TAGS_STATUS ON '. $table . ' (`mode`, `tags`, `status`)'; +$connection->raw_query($query); $installer->endSetup(); \ No newline at end of file