Closed osa1 closed 6 years ago
Just confirmed that it also fails the same way with lts-8.14
(which has persistent-2.6.1
and persistent-sqlite-2.6.2
).
Confirmed that the problem is in persistent-sqlite
, if I use latest nightly resolver with persistent-sqlite-2.6
it works.
resolver: nightly-2017-11-24
packages:
- .
extra-deps:
- persistent-sqlite-2.6
persistent-sqlite-2.6.0.1
also works
It turns out this is because of https://github.com/yesodweb/persistent/pull/646
Using this line fixes it
conn_pool <- createSqlitePoolFromInfo (set fkEnabled False (mkSqliteConnectionInfo "db")) 15
Thanks for reporting and diagnosing this.
I think there is still a bug: migration creates a temporary table with a foreign-key constraint which cannot be satisfied, so migration needs to be updated in view of #646. You shouldn't be forced to switch off foreign-key checking to make it work!
I'll reopen this issue, and take a look at the code over the weekend.
@osa1 there is now a new release on hackage which fixes this issue (version 2.6.3.1). Thanks again for spotting it.
Thanks!
Thanks for writing such a detailed bug report btw!
On Saturday, November 25, 2017, Ömer Sinan Ağacan notifications@github.com wrote:
Thanks!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yesodweb/persistent/issues/735#issuecomment-346930325, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNxIS4SaIjw4IGmCKWN8RU19Oy0r9jGks5s5-JwgaJpZM4Qpd3j .
Here's program that works with
persistent-2.5
andpersistent-sqlite-2.6
but doesn't work withpersistent-2.7.1
andpersistent-sqlite-2.6.3
:This is a migration program so we run it twice. On the second run we move the commented-out line to
Message
table as mentioned in the code.On older persistent migration works as expected:
On newer persistent it doesn't:
cabal and stack files: