Skip to content

Instantly share code, notes, and snippets.

@DeaVenditama
Created September 1, 2020 06:48
Show Gist options
  • Save DeaVenditama/d793cdb61502a218e657fafb14af1d2f to your computer and use it in GitHub Desktop.
Save DeaVenditama/d793cdb61502a218e657fafb14af1d2f to your computer and use it in GitHub Desktop.
<?php namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class KodeWilayah extends Migration
{
public function up()
{
$this->forge->addField([
'id' =>[
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'kode_wilayah' => [
'type' => 'VARCHAR',
'constraint' => 7
],
'nama_wilayah'=>[
'type' => 'VARCHAR',
'constraint' => 100
]
]);
$this->forge->addKey('id', true);
$this->forge->createTable('kode_wilayah');
}
//--------------------------------------------------------------------
public function down()
{
$this->forge->dropTable('kode_wilayah');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment