Skip to content

Instantly share code, notes, and snippets.

@DeaVenditama
Created September 1, 2020 06:44
Show Gist options
  • Save DeaVenditama/aa1d845fe97f242e159d32f40325434f to your computer and use it in GitHub Desktop.
Save DeaVenditama/aa1d845fe97f242e159d32f40325434f to your computer and use it in GitHub Desktop.
<?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