You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of SQLite version 3.6.19, the default setting for foreign key enforcement is OFF. However, that might change in a future release of SQLite. The default setting for foreign key enforcement can be specified at compile-time using the SQLITE_DEFAULT_FOREIGN_KEYS preprocessor macro. To minimize future problems, applications should set the foreign key enforcement flag as required by the application and not depend on the default setting. https://www.sqlite.org/pragma.html#pragma_foreign_keys
But dropTable() executes PRAGMA foreign_keys = ON,
and after that foreign key constraint works.
If you add the following code before creating the table, you will see ErrorException.
$this->forge->dropTable('auth_users', true);
The text was updated successfully, but these errors were encountered:
kenjis
added
bug
Verified issues on the current code behavior or pull requests that will fix them
database
Issues or pull requests that affect the database layer
labels
May 19, 2022
PHP Version
8.0
CodeIgniter4 Version
develop
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
macOS
Which server did you use?
cli-server (PHP built-in webserver)
Database
SQLite3
What happened?
Can insert a record that has no foreign key record.
Steps to Reproduce
Navigate to http://localhost:8080/
Expected Output
Anything else?
This is the default behavior of SQLite3.
But
dropTable()
executesPRAGMA foreign_keys = ON
,and after that foreign key constraint works.
If you add the following code before creating the table, you will see ErrorException.
The text was updated successfully, but these errors were encountered: