for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace nystudio107\retour\migrations;
use Craft;
use craft\db\Migration;
/**
* m181216_043222_rebuild_indexes migration.
*/
class m181216_043222_rebuild_indexes extends Migration
{
* @inheritdoc
public function safeUp()
$this->dropIndexes();
$this->createIndexes();
}
public function safeDown()
echo "m181216_043222_rebuild_indexes cannot be reverted.\n";
return false;
* @return void
protected function createIndexes()
$this->createIndex(
$this->db->getIndexName(
'{{%retour_static_redirects}}',
'redirectSrcUrlParsed',
false
),
);
'{{%retour_redirects}}',
protected function dropIndexes()
$this->dropIndex(
true
'{{%retour_static_redirects}}'
'{{%retour_redirects}}'