41 lines
961 B
PHP
41 lines
961 B
PHP
<?php
|
|
|
|
use yii\db\Schema;
|
|
use yii\db\Migration;
|
|
|
|
class m151021_055338_add__table__customer_cart extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$tableOptions = null;
|
|
if ($this->db->driverName === 'mysql') {
|
|
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
|
|
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
|
|
}
|
|
|
|
$this->createTable('{{%shopping_cart}}', [
|
|
'id_shopping_cart' => $this->primaryKey(),
|
|
'id_customer' => $this->integer(11) ,
|
|
'id_sale' => $this->integer(11) ,
|
|
], $tableOptions);
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
echo "m151021_055338_add__table__customer_cart cannot be reverted.\n";
|
|
|
|
return false;
|
|
}
|
|
|
|
/*
|
|
// Use safeUp/safeDown to run migration code within a transaction
|
|
public function safeUp()
|
|
{
|
|
}
|
|
|
|
public function safeDown()
|
|
{
|
|
}
|
|
*/
|
|
}
|