Created
March 24, 2017 13:03
-
-
Save calcio/aa1a284de5e2c5dd84c181d91d4c4ec7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use yii\db\Migration; | |
/** | |
* Handles the creation of table `category`. | |
*/ | |
class m170203_135455_create_categories_table extends Migration | |
{ | |
/** | |
* @inheritdoc | |
*/ | |
public function up() | |
{ | |
$this->createTable('categories', [ | |
'id' => $this->primaryKey(), | |
'name' => $this->string(80)->notNull()->unique(), | |
'status' => $this->boolean()->notNull(), | |
'created_at' => $this->integer()->notNull(), | |
'updated_at' => $this->integer()->notNull(), | |
]); | |
} | |
/** | |
* @inheritdoc | |
*/ | |
public function down() | |
{ | |
$this->dropTable('categories'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment