Created
June 26, 2021 18:59
-
-
Save minons1/f3d51a71a55b661c87abdecd4947ea3f 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
Class CreateBlogTable extends Migration | |
{ | |
public function up() | |
{ | |
$this->forge->addField([ | |
'blog_id' => [ | |
'type' => 'INT', | |
'constraint' => 5, | |
'unsigned' => true, | |
'auto_increment' => true, | |
], | |
'blog_title' => [ | |
'type' => 'VARCHAR', | |
'constraint' => '100', | |
], | |
'blog_description' => [ | |
'type' => 'TEXT', | |
'null' => true, | |
], | |
'created_at' => [ | |
'type' => 'DATETIME', | |
'null' => true, | |
], | |
'updated_at' => [ | |
'type' => 'DATETIME', | |
'null' => true, | |
], | |
]); | |
$this->forge->addKey('blog_id', true); | |
$this->forge->createTable('blog', true); | |
} | |
public function down() | |
{ | |
$this->forge->dropTable('blog'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment