yii2mod/yii2-cart

View on GitHub
migrations/m161109_124936_rename_cart_table.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

use yii\db\Migration;

class m161109_124936_rename_cart_table extends Migration
{
    public function up()
    {
        if (Yii::$app->db->schema->getTableSchema('cart') === null) {
            $this->renameTable('{{%Cart}}', '{{%cart}}');
        }
    }

    public function down()
    {
        if (Yii::$app->db->schema->getTableSchema('Cart') === null) {
            $this->renameTable('{{%cart}}', '{{%Cart}}');
        }
    }
}