Closed YellowSharkMT closed 8 years ago
So you have a column 'something_id' that does not point to 'something' ? RedBeanPHP has been designed to work like this. It uses 'predictable' columns for a reason, to make the mapping easy, yes that means it might be incompatible with some existing schemas, that's a tradeoff. However, to gain a better understanding of the situation, can you elaborate on why you have a foreign key pointing to ... well, to what? What does something_id refer to in your case?
This code is problematic for tables that happen to have columns named
something
, andsomething_id
, from OODBBean.php, line 1003:Would it be possible to chance that '_id' suffix to something with a lower chance of causing this sort of conflict? There appears to be no reason you couldn't change it to some value that'd be less likely to conflict with a legitimate column name, like "_id_for_fieldLink", or anything really.
Glad to submit a pull request if that'd be helpful; I figured I'd bring it up first though, in case there's reasoning behind this that I am not aware of. OK, thanks!