Skip to content

Foreign key constraints are not active by default.#451

Closed
phongnt270 wants to merge 2 commits into
sj26:masterfrom
phongnt270:master
Closed

Foreign key constraints are not active by default.#451
phongnt270 wants to merge 2 commits into
sj26:masterfrom
phongnt270:master

Conversation

@phongnt270

Copy link
Copy Markdown
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

sj26 commented Mar 25, 2021

Copy link
Copy Markdown
Owner

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

Bertg commented Apr 9, 2021

Copy link
Copy Markdown

@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

cuong-nd commented Apr 27, 2021

Copy link
Copy Markdown

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

@sj26

sj26 commented Apr 27, 2021

Copy link
Copy Markdown
Owner

v0.8.0.beta3 is pushed!

@sj26

sj26 commented Jul 20, 2021

Copy link
Copy Markdown
Owner

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

gem install mailcatcher

@rmacklin

Copy link
Copy Markdown

@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.

5 participants