Does SQLite support referential integrity?

后端 未结 1 1436
野性不改
野性不改 2021-01-12 17:03

I have a Django web-server configured to use SQLite.

In a many-to-many relationship (with extra fields), Django forces me to use the relationship model to establish

1条回答
  •  囚心锁ツ
    2021-01-12 17:42

    SQLite does not enforce foreign key constraints by default (mostly to be backward compatible).

    To enable it, you have to execute

    PRAGMA foreign_keys = 1
    

    after you connected to the database.

    See the manual about PRAGMA foreign_keys for more details.

    0 讨论(0)
提交回复
热议问题