How to turn on 'PRAGMA foreign_keys = ON' in sqlalchemy migration script or configuration file for sqlite?

前端 未结 2 659
被撕碎了的回忆
被撕碎了的回忆 2021-01-14 23:49

In a suitable sqlite version, we can enforce foreign key constraint by \'PRAGMA foreign_keys = ON\'. However user can not log in a database every time when making a connecti

2条回答
  •  旧时难觅i
    2021-01-15 00:28

    SQLite has no logins.

    To enable foreign keys in a script, just add the PRAGMA foreign_keys = ON command to that script.

提交回复
热议问题