Merge pull request #9518 from pana1990/patch

Fix code style and delete declaration of yii\db\Schema [skip ci]
This commit is contained in:
Alexander Makarov
2015-08-26 01:17:18 +03:00

View File

@@ -65,20 +65,32 @@ a migration class `m150101_185401_create_news_table` with the skeleton code:
```php ```php
<?php <?php
use yii\db\Schema;
use yii\db\Migration; use yii\db\Migration;
class m150101_185401_create_news_table extends Migration class m150101_185401_create_news_table extends Migration
{ {
public function up() public function up()
{ {
} }
public function down() public function down()
{ {
echo "m101129_185401_create_news_table cannot be reverted.\n"; echo "m101129_185401_create_news_table cannot be reverted.\n";
return false; return false;
} }
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
} }
``` ```
@@ -114,7 +126,6 @@ class m150101_185401_create_news_table extends Migration
{ {
$this->dropTable('news'); $this->dropTable('news');
} }
} }
``` ```
@@ -147,7 +158,6 @@ could be written like the following:
```php ```php
<?php <?php
use yii\db\Schema;
use yii\db\Migration; use yii\db\Migration;
class m150101_185401_create_news_table extends Migration class m150101_185401_create_news_table extends Migration
@@ -165,7 +175,6 @@ class m150101_185401_create_news_table extends Migration
{ {
$this->dropTable('news'); $this->dropTable('news');
} }
} }
``` ```
@@ -185,8 +194,8 @@ As a result, if any operation in these methods fails, all prior operations will
In the following example, besides creating the `news` table we also insert an initial row into this table. In the following example, besides creating the `news` table we also insert an initial row into this table.
```php ```php
<?php
use yii\db\Schema;
use yii\db\Migration; use yii\db\Migration;
class m150101_185401_create_news_table extends Migration class m150101_185401_create_news_table extends Migration
@@ -449,7 +458,8 @@ database. To achieve this goal, when implementing a migration class you should e
ID that the migration would use, like the following: ID that the migration would use, like the following:
```php ```php
use yii\db\Schema; <?php
use yii\db\Migration; use yii\db\Migration;
class m150101_185401_create_news_table extends Migration class m150101_185401_create_news_table extends Migration