Created
April 14, 2016 05:57
-
-
Save mdmunir/4836f472888e2611d245543593cf3448 to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
| class m160414_015201_contact_info 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('{{%contact_info}}', [ | |
| 'id' => $this->primaryKey(), | |
| 'name' => $this->string(64)->notNull(), | |
| 'email' => $this->string(64), | |
| 'phone' => $this->string(32), | |
| 'keterangan' => $this->string(128), | |
| ], $tableOptions); | |
| } | |
| public function down() | |
| { | |
| $this->dropTable('{{%contact_info}}'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment