add product
This commit is contained in:
@@ -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()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -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()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user