forge->addField([ 'id' => [ 'type' => 'INT', 'unsigned' => true, ], 'parent_id' => [ 'type' => 'INT', 'unsigned' => true, ], 'code' => [ 'type' => 'VARCHAR', 'constraint' => 32, ], 'apple_category' => [ 'type' => 'VARCHAR', 'constraint' => 32, ], 'google_category' => [ 'type' => 'VARCHAR', 'constraint' => 32, ], ]); $this->forge->addPrimaryKey('id'); $this->forge->addUniqueKey('code'); $this->forge->addForeignKey('parent_id', 'categories', 'id'); $this->forge->createTable('categories'); } public function down(): void { $this->forge->dropTable('categories'); } }