add product

This commit is contained in:
2015-09-24 22:14:09 +02:00
parent fcc18d79f6
commit a2b835225a
15 changed files with 229 additions and 80 deletions

View File

@@ -0,0 +1,32 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
use common\models\Product;
class m150924_162425_alter__table__product_fix_columns extends Migration
{
public function up()
{
$this->renameColumn('product','id_product_type','id_product_category');
$this->addColumn('product','stock', 'int(11)' );
}
public function down()
{
echo "m150924_162425_alter__table__product_fix_columns cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@@ -0,0 +1,30 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m150924_170806_alter__table__product__add__column__name extends Migration
{
public function up()
{
$this->addColumn('product','name', 'varchar(128)' );
}
public function down()
{
echo "m150924_170806_alter__table__product__add__column__name cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}