add product sale changes
This commit is contained in:
72
console/migrations/m150930_140224_add__table__transfer.php
Normal file
72
console/migrations/m150930_140224_add__table__transfer.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m150930_140224_add__table__transfer extends Migration
|
||||
{
|
||||
/*id_transfer (int)
|
||||
id_account
|
||||
id_discount
|
||||
id_currency
|
||||
id_object
|
||||
status
|
||||
type
|
||||
item_price
|
||||
count
|
||||
money
|
||||
money_currency
|
||||
rate
|
||||
id_user
|
||||
comment
|
||||
created_at
|
||||
updated_at
|
||||
|
||||
*/
|
||||
|
||||
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('{{%transfer}}', [
|
||||
'id_transfer' => $this->primaryKey(),
|
||||
'id_discount' => $this->integer(11) ,
|
||||
'id_currency' => $this->integer(11) ,
|
||||
'id_discount' => $this->integer(11) ,
|
||||
'id_object' => $this->integer(11) ,
|
||||
'status' => $this->smallInteger(),
|
||||
'type' => $this->smallInteger(),
|
||||
'item_price' => $this->integer(11),
|
||||
'count' => $this->integer(11),
|
||||
'money' => $this->integer(11),
|
||||
'money_currency' => $this->integer(11),
|
||||
'rate' => $this->integer(11),
|
||||
'id_user' => $this->integer(11),
|
||||
'comment' => $this->string(255),
|
||||
'created_at' => $this->timestamp()->notNull(),
|
||||
'updated_at' => $this->timestamp()->notNull(),
|
||||
], $tableOptions);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m150930_140224_add__table__transfer cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
43
console/migrations/m150930_140728_add__table__currency.php
Normal file
43
console/migrations/m150930_140728_add__table__currency.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m150930_140728_add__table__currency 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('{{%currency}}', [
|
||||
'id_currency' => $this->primaryKey(),
|
||||
'currency' => $this->string(10)->notNull(),
|
||||
'name' => $this->string(32)->notNull(),
|
||||
'rate' => $this->integer(11) ,
|
||||
'created_at' => $this->timestamp()->notNull(),
|
||||
'updated_at' => $this->timestamp()->notNull(),
|
||||
], $tableOptions);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m150930_140728_add__table__currency 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