Clarify Foreign Key support on SQLite must be enabled before `MetaData.create_all`

Change-Id: Ic41b86f736be21dd6fc890a915a2ffd572df73a4
This commit is contained in:
jonathan vanasco
2021-09-08 12:50:10 -04:00
committed by Jonathan Vanasco
parent 207ec35c2e
commit 4fa4c49751
+2 -1
View File
@@ -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::