Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign key constraints are not active by default. #451

Closed
wants to merge 2 commits into from

Conversation

phongnt270
Copy link
Contributor

see #450
From Official Doc :

  1. Enabling Foreign Key Support
    Assuming the library is compiled with foreign key constraints enabled, it must still be enabled by the application at runtime, using the PRAGMA foreign_keys command. For example:

    sqlite> PRAGMA foreign_keys = ON;

Foreign key constraints are disabled by default (for backwards compatibility), so must be enabled separately for each database connection.

@sj26
Copy link
Owner

sj26 commented Mar 25, 2021

Ooh, nice find!

I think we can turn this on when creating the database because it's an in-memory database and we only ever have one connection.

It looks like this PR is coming from your master branch which has a merge commit as well so I'll cherry-pick the original commit and adjust directly to master.

Thanks!

@sj26 sj26 closed this in c887904 Mar 25, 2021
@Bertg
Copy link

Bertg commented Apr 9, 2021

@sj26 Can we have a beta-3 release?

I think the lack of this PR in the beta is causing a serious bug.

Steps to reproduce:

  • Send a single email to Mailcatcher
  • Open said email
  • Clear the emails
  • Send a single email to Mailcatcher
  • Open said email
  • The HTML body is that of the previous email

Expected result:

See the HTML body of the new email

@cuong-nd
Copy link

cuong-nd commented Apr 27, 2021

@sj26 Is there any plan for release for fixing this bug, really appreciate

@sj26
Copy link
Owner

sj26 commented Apr 27, 2021

v0.8.0.beta3 is pushed!

@sj26
Copy link
Owner

sj26 commented Jul 20, 2021

This is shipped in the latest version, v0.8.0.

gem install mailcatcher

@rmacklin
Copy link

@sj26 The version constraint for sqlite3 in mailcatcher v0.8.0 is too loose due to the new requirement of SQLite3::Database responding to the foreign_keys= method, as necessitated by c887904#diff-ba6f65d5c04d1ccc77ea172c1d1769c73d099580585d07dff7496e4401298e35R39

I've opened an issue for this in #476 and a corresponding PR in #477. If it looks good to you, let me know what you think about shipping it in a new v0.8.1 release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants