table('contact_us_form_submissions'); if ($table->hasColumn('subject')) { $table->renameColumn('subject', 'contact_subject'); } if ($table->hasColumn('name')) { $table->renameColumn('name', 'first_name'); } $table->addColumn('last_name', 'string', [ 'limit' => 255, 'default' => null, 'null' => true, ]); $table->update(); } /** * down Method. * * More information on this method is available here: * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method * @return void */ public function down(): void { $table = $this->table('contact_us_form_submissions'); if ($table->hasColumn('contact_subject')) { $table->renameColumn('contact_subject', 'subject'); } if ($table->hasColumn('fist_name')) { $table->renameColumn('fist_name', 'name'); } $table->removeColumn('last_name'); $table->update(); } }