Add custom name for ForeignKeys. GitHub issue #6366 |
When create foreign keys there is set pattern in Forge class how the key name will be generated. This ends up making problem for tables and fields with long names, below
Code: [mysqli_sql_exception] Code: Specified key was too long; max key length is 767 bytes Add options array at end of this function which excepts constraint name CodeIgniter4/system/Database/Forge.php Line 404 in 9204889 Skip default key name and used the constraint name passed in options array to addForeignKey method CodeIgniter4/system/Database/Forge.php Line 1057 in 9204889
Best Regards,
ST |
Welcome Guest, Not a member yet? Register Sign In |