yesodweb/persistent

MySQL backend generates foreign keys over length limit

Open

#1,000 opened on Dec 29, 2019

 (0 comments) (0 reactions) (0 assignees)Haskell (302 forks)auto 404
MySQLSQLbugfixgood first issue

Repository metrics

Stars
 (484 stars)
PR merge metrics
 (PR metrics pending)

Description

Currently, persistent-mysql suggests foreign key constraint names that are over MySQL's length limit of 64 characters, which MySQL will throw an error for.

persistent-mysql should generate truncated names that don't go over the length limit. It could use the same logic as is introduced in #996 for truncating Postgres keys, or logic that better matches MySQL's naming conventions.

This issue is discussed in greater detail in #996, which adds tests for it. This issue is mostly to track the issue being resolved for MySQL, since #996 will be closed after it resolves it for Postgres.

Contributor guide