interchange / TableEditor

25 stars 4 forks source link

Check whether foreign keys exist before inserting #23

Open racke opened 10 years ago

racke commented 10 years ago

11/May/2014 15:25:05 [23434] error @0.033096> request to POST /api/State crashed: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (flowers.states, CONSTRAINT states_fk_country_iso_code FOREIGN KEY (country_iso_code) REFERENCES countries (country_iso_code) ON DELETE CASCADE ON UPDATE CASCADE) [for Statement "INSERT INTO states ( country_iso_code, name, state_iso_code) VALUES ( ?, ?, ? )" with ParamValues: 0='ZZ', 1='Nevairbe', 2='ZZZ'] at /home/racke/interchange/TableEdit/lib/TableEdit/Routes/API.pm line 269 in /home/racke/perl5/lib/perl5/Dancer/Handler.pm l. 98