IntranetFactory / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

Problems when the constraint don't have the same name of the index #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When the constraint don't have the same name of the index MigratorDotNet 
ConstraintExists method fails. This happens because the MySql command "SHOW 
KEYS FROM <table_name>" don't really bring the keys but the indexes. To 
find a constraint in a safe way we should query the information_schema 
database, key_column table. 

I modified this method to do this and I am attaching my 
MySqlTransformationProvicer.cs file with the modification.

I left the original code commented.

Original issue reported on code.google.com by cass...@gmail.com on 14 Apr 2009 at 2:10

Attachments:

GoogleCodeExporter commented 9 years ago
I have another modification for this issue because the method RemoveForeignKey 
is using 
the "SHOW KEYS FROM" command too.

Note: THIS ISSUE ONLY OCCURS IF YOU ARE USING MYSQL 5.xx or up. I DIDN'T TEST 
WITH 
OTHER VERSIONS

Original comment by cass...@gmail.com on 15 Sep 2009 at 5:30

Attachments: