Hello,
I'm trying to do a ALTER TABLE to add a foreign key. The code is:
execute "ALTER TABLE table1 ADD CONSTRAINT FOREIGN KEY `const_fk_table1_table2_id` (`table2_id`) REFERENCES `table2` (`id`) ON DELETE CASCADE"
Instead of creating a foreign key constraint with the name "const_fk_table1_table2_id" it will create one with the name "table2_ibfk_1".
First I've added an index with : add_index :table1, :table2_id, :name => 'fk_table1_table2_id'
Am I doing something wrong?