Skip to content

Commit

Permalink
🐛 use more precise foreign key constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse authored Jan 1, 2024
1 parent 29ceb9f commit 8fe0b1b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mysql_to_sqlite3/transporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,10 @@ def _build_create_table_sql(self, table_name: str) -> str:
FROM information_schema.TABLE_CONSTRAINTS AS i
{JOIN} information_schema.KEY_COLUMN_USAGE AS k
ON i.CONSTRAINT_NAME = k.CONSTRAINT_NAME
AND i.TABLE_NAME = k.TABLE_NAME
{JOIN} information_schema.REFERENTIAL_CONSTRAINTS AS c
ON c.CONSTRAINT_NAME = i.CONSTRAINT_NAME
AND c.TABLE_NAME = i.TABLE_NAME
WHERE i.TABLE_SCHEMA = %s
AND i.TABLE_NAME = %s
AND i.CONSTRAINT_TYPE = %s
Expand Down

0 comments on commit 8fe0b1b

Please sign in to comment.