Newer
Older
framework / _support / Database / SupportMigrations / 001_Some_migration.php
@Jim Parry Jim Parry on 1 Mar 2019 426 bytes Release 4.0.0-beta.1
<?php namespace App\Database\Migrations;

class Migration_some_migration extends \CodeIgniter\Database\Migration
{
	public function up()
	{
		$this->forge->addField([
			'key' => [
				'type'       => 'VARCHAR',
				'constraint' => 255,
			],
		]);
		$this->forge->createTable('foo', true);

		$this->db->table('foo')->insert([
			'key' => 'foobar',
		]);
	}

	public function down()
	{
		$this->forge->dropTable('foo');
	}
}