Migrate spark with Foreigner key table show (Can't create table `fk`.`employees` (err - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1) +--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25) +--- Thread: Migrate spark with Foreigner key table show (Can't create table `fk`.`employees` (err (/showthread.php?tid=84750) |
Migrate spark with Foreigner key table show (Can't create table `fk`.`employees` (err - luckmoshy - 11-06-2022 Hi guys, I recently faced this issue I normally create my foreigner key table in the same migration file but now have decided to make two separate migration files unfortunately get this error in the spark command (Can't create table `fk`.`employees` (errno: 150 "Foreign key constraint is incorrectly formed") The question does CI 4 spark command not accept two different migration files? Spark command it does not accept two different files like: 1.class CreateEmployeesTable extends Migration 2class CreateDepartmentsTable extends Migration It accepts only one file PHP Code: <?php RE: Migrate spark with Foreigner key table show (Can't create table `fk`.`employees` (err - kenjis - 11-06-2022 You can't add ForeignKey to existing tables with Forge. The feature will be provided in v4.3.0. See https://github.com/codeigniter4/CodeIgniter4/issues/4814 RE: Migrate spark with Foreigner key table show (Can't create table `fk`.`employees` (err - luckmoshy - 11-07-2022 (11-06-2022, 02:55 PM)kenjis Wrote: You can't add ForeignKey to existing tables with Forge. Thnk@kenjis |