Commit 1c24b885 authored by Tobias Munk's avatar Tobias Munk

added migration to convert table to utf8; fixed table name with prefix

parent 5e396169
<?php
use yii\db\Migration;
class m161118_101348_alter_charset_to_utf8 extends Migration
{
public function up()
{
Yii::$app->db->createCommand("ALTER TABLE {{%hrzg_widget_content}} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci ;")
->execute();
Yii::$app->db->createCommand("ALTER TABLE {{%hrzg_widget_template}} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci ;")
->execute();
}
public function down()
{
echo "m160721_101347_alter_charset_to_utf8 cannot be reverted.\n";
return false;
}
}
......@@ -34,7 +34,7 @@ abstract class Widget extends \yii\db\ActiveRecord
*/
public static function tableName()
{
return 'app_hrzg_widget_content';
return '{{%hrzg_widget_content}}';
}
/**
......
......@@ -21,7 +21,7 @@ abstract class WidgetTemplate extends \yii\db\ActiveRecord
*/
public static function tableName()
{
return 'app_hrzg_widget_template';
return '{{%hrzg_widget_template}}';
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment