add changes to account state
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m151013_154204_add__table__user__account_assignment 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('{{%user_account_assignment}}', [
|
||||
'id_user_account_assignment' => $this->primaryKey(),
|
||||
'id_user' => $this->integer(11) ,
|
||||
'id_account' => $this->integer(11) ,
|
||||
], $tableOptions);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m151013_154204_add__table__user__account_assignment 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,56 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m151014_053236_add__table__account_state 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('{{%account_state}}', [
|
||||
'id_account_state' => $this->primaryKey(),
|
||||
'id_account' => $this->integer(11),
|
||||
'type' => $this->smallInteger(),
|
||||
'money' => $this->integer(11),
|
||||
'banknote_5_ft' => $this->integer(11),
|
||||
'banknote_10_ft' => $this->integer(11),
|
||||
'banknote_20_ft' => $this->integer(11),
|
||||
'banknote_50_ft' => $this->integer(11),
|
||||
'banknote_100_ft' => $this->integer(11),
|
||||
'banknote_200_ft' => $this->integer(11),
|
||||
'banknote_500_ft' => $this->integer(11),
|
||||
'banknote_1000_ft' => $this->integer(11),
|
||||
'banknote_2000_ft' => $this->integer(11),
|
||||
'banknote_5000_ft' => $this->integer(11),
|
||||
'banknote_10000_ft' => $this->integer(11),
|
||||
'banknote_20000_ft' => $this->integer(11),
|
||||
'id_user' => $this->integer(11),
|
||||
'created_at' => $this->dateTime()->notNull(),
|
||||
'updated_at' => $this->dateTime()->notNull(),
|
||||
], $tableOptions);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m151014_053236_add__table__account_state 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,32 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m151016_100724_alter__table__account_state__add__columns__comment__prev_state__prev_money extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('account_state','comment', 'varchar(255)' );
|
||||
$this->addColumn('account_state','prev_state', 'int(11)' );
|
||||
$this->addColumn('account_state','prev_money', 'int(11)' );
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m151016_100724_alter__table__account_state__add__columns__comment__prev_state__prev_money 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 m151018_103040_alter__table_transfer__add_column__dircetion extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('transfer', "direction", "int(11)");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m151018_103040_alter__table_transfer__add_column__dircetion 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