Command
ci4:migration
Output
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddBlog extends Migration
{
public function up()
{
//
}
public function down()
{
//
}
}
-
Command
ci4:migration:up
Output
public function up() { $this->forge->addField([ 'id' => [ 'type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true, ], 'name' => [ 'type' => 'VARCHAR', 'constraint' => 255, ], 'created_at' => [ 'type' => 'DATETIME', 'null' => true, ], 'updated_at' => [ 'type' => 'DATETIME', 'null' => true, ], 'deleted_at' => [ 'type' => 'DATETIME', 'null' => true, ], ]); $this->forge->addKey('id', true); $this->forge->createTable('tableName'); }
-
Command
ci4:migration:down
Output
public function down() { $this->forge->dropTable('tableName'); }
-
-
Command
ci4:migration:bigint
Output
'columnName' => [ 'type' => 'BIGINT', 'constraint' => '20', 'null' => true, ],
-
Command
ci4:migration:char
Output
'columnName' => [ 'type' => 'CHAR', 'constraint' => '10', 'null' => true, ],
-
Command
ci4:migration:datetime
Output
'columnName' => [ 'type' => 'DATETIME', 'null' => true, ],
-
Command
ci4:migration:int
Output
'columnName' => [ 'type' => 'INT', 'constraint' => '11', 'null' => true, ],
-
Command
ci4:migration:varchar
Output
'columnName' => [ 'type' => 'VARCHAR', 'constraint' => '255', 'null' => true, ],
-
-
Command :
ci4:migration:id
Output :
'id' => [ 'type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true, ],
-
Command :
ci4:migration:timestamp
Output :
'created_at' => [ 'type' => 'DATETIME', 'null' => true, ], 'updated_at' => [ 'type' => 'DATETIME', 'null' => true, ], 'deleted_at' => [ 'type' => 'DATETIME', 'null' => true, ],