Created
September 1, 2020 06:44
-
-
Save DeaVenditama/aa1d845fe97f242e159d32f40325434f 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 namespace App\Database\Migrations; | |
use CodeIgniter\Database\Migration; | |
class MasterData extends Migration | |
{ | |
public function up() | |
{ | |
$this->forge->addField([ | |
'id' =>[ | |
'type' => 'INT', | |
'constraint' => 11, | |
'unsigned' => true, | |
'auto_increment' => true, | |
], | |
'nama' => [ | |
'type' => 'VARCHAR', | |
'constraint' => 100 | |
], | |
]); | |
$this->forge->addKey('id', true); | |
$this->forge->createTable('master_data'); | |
} | |
//-------------------------------------------------------------------- | |
public function down() | |
{ | |
$this->forge->dropTable('master_data'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment