diff options
author | jonathan vanasco <jonathan@2xlp.com> | 2021-09-08 12:50:10 -0400 |
---|---|---|
committer | Jonathan Vanasco <jonathan@2xlp.com> | 2021-09-08 16:54:22 +0000 |
commit | 4fa4c497512e4b4e311083d64ec8536d0230fe28 (patch) | |
tree | f5e2e4d664096d8eeb603228d82c2e8765672519 /lib/sqlalchemy/dialects/sqlite | |
parent | 207ec35c2e175f5fcf68e886d5e61a0678c2d6fc (diff) | |
download | sqlalchemy-4fa4c497512e4b4e311083d64ec8536d0230fe28.tar.gz |
Fixes: #5289
Clarify Foreign Key support on SQLite must be enabled before `MetaData.create_all`
Change-Id: Ic41b86f736be21dd6fc890a915a2ffd572df73a4
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite')
-rw-r--r-- | lib/sqlalchemy/dialects/sqlite/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index dc5ebc3f0..08dfd56b1 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -266,7 +266,8 @@ Constraint checking on SQLite has three prerequisites: * The SQLite library must be compiled *without* the SQLITE_OMIT_FOREIGN_KEY or SQLITE_OMIT_TRIGGER symbols enabled. * The ``PRAGMA foreign_keys = ON`` statement must be emitted on all - connections before use. + connections before use -- including the initial call to + :meth:`sqlalchemy.schema.MetaData.create_all`. SQLAlchemy allows for the ``PRAGMA`` statement to be emitted automatically for new connections through the usage of events:: |