add new tables: customer_cart, sale, alter timestamp fields in tables

This commit is contained in:
2015-10-21 08:30:30 +02:00
parent 4e04425403
commit baf7c79d04
11 changed files with 374 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?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()
{
}
*/
}