You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a model with a non-standard primary key e.g. Car, PK=registration
Create a standard model e.g. Person
Invoke the generator to create a 1-1 relationship:
$ emerails_generate relationship --belongs-to person car
Expected behavior
The generator can correctly create a foreign key column in the cars table.
Actual behavior
Error:
☠ Error (ALTER TABLE `cars` ADD `person_id` int(11) NULL DEFAULT NULL AFTER `id`, ADD INDEX (`person_id`);
ALTER TABLE `cars` ADD FOREIGN KEY (`person_id`) REFERENCES `people`(`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;): Unknown column 'id' in 'cars'
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Car
, PK=registration
Person
Expected behavior
The generator can correctly create a foreign key column in the
cars
table.Actual behavior
Error:
The text was updated successfully, but these errors were encountered: