CodeIgniter Forums
DBForge to support foreign keys - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: DBForge to support foreign keys (/showthread.php?tid=66385)



DBForge to support foreign keys - AmitMY - 10-18-2016

Currently, I am writing a migration to a database that has foreign keys.
I am using DBForge for all of my creation, deletion, and editing.
I managed to do everything but create/delete foreign keys.

I would like dbforge to include an option:
"add_constraint" or "add_foreign_key" or whatever, that adds a foreign key constraint, and is named with both fields names usiing underscore
Example:
`add_constraint("posts", "user_id", "users", "user_id")` -> creates posts_user_id_users_user_id

And `remove_constraint` with the same format.

Is this possible to add in 3.1.1?

(I cannot use db class as I use both mysql and postgres, and they are not fully compatible all the time)

Thanks


RE: DBForge to support foreign keys - Narf - 10-19-2016

A handful of people have already tried to implement different versions of this ... it's not as easy as it looks like on first glance.

100% not happening in 3.1.1, and I don't see it happening in a 3.1.x either way - micro-version releases aren't supposed to include new features (we do allow some minor ones from time to time, but this one isn't such).