mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 22:28:47 -04:00
removed a big warning on foreign keys
This commit is contained in:
parent
c366b4d888
commit
b71c5a6c7d
1 changed files with 5 additions and 10 deletions
|
@ -1228,16 +1228,13 @@ named) placeholders to avoid confusion.
|
||||||
|
|
||||||
=head2 Foreign Keys
|
=head2 Foreign Keys
|
||||||
|
|
||||||
B<BE PREPARED! WOLVES APPROACH!!>
|
|
||||||
|
|
||||||
SQLite has started supporting foreign key constraints since 3.6.19
|
SQLite has started supporting foreign key constraints since 3.6.19
|
||||||
(released on Oct 14, 2009; bundled in DBD::SQLite 1.26_05).
|
(released on Oct 14, 2009; bundled in DBD::SQLite 1.26_05).
|
||||||
To be exact, SQLite has long been able to parse a schema with foreign
|
To be exact, SQLite has long been able to parse a schema with foreign
|
||||||
keys, but the constraints has not been enforced. Now you can issue
|
keys, but the constraints has not been enforced. Now you can issue
|
||||||
a pragma actually to enable this feature and enforce the constraints.
|
a C<foreign_keys> pragma to enable this feature and enforce the
|
||||||
|
constraints, preferably as soon as you connect to a database and
|
||||||
To do this, issue the following pragma (see below), preferably as
|
you're not in a transaction:
|
||||||
soon as you connect to a database and you're not in a transaction:
|
|
||||||
|
|
||||||
$dbh->do("PRAGMA foreign_keys = ON");
|
$dbh->do("PRAGMA foreign_keys = ON");
|
||||||
|
|
||||||
|
@ -1251,11 +1248,9 @@ SQLite team, and by us, to secure backward compatibility, as
|
||||||
this feature may break your applications, and actually broke
|
this feature may break your applications, and actually broke
|
||||||
some for us. If you have used a schema with foreign key constraints
|
some for us. If you have used a schema with foreign key constraints
|
||||||
but haven't cared them much and supposed they're always ignored for
|
but haven't cared them much and supposed they're always ignored for
|
||||||
SQLite, be prepared, and B<please do extensive testing to ensure
|
SQLite, be prepared, and please do extensive testing to ensure
|
||||||
that your applications will continue to work when the foreign keys
|
that your applications will continue to work when the foreign keys
|
||||||
support is enabled by default>. It is very likely that the SQLite
|
support is enabled by default.
|
||||||
team will turn it default-on in the future, and we plan to do it
|
|
||||||
NO LATER THAN they do so.
|
|
||||||
|
|
||||||
See L<http://www.sqlite.org/foreignkeys.html> for details.
|
See L<http://www.sqlite.org/foreignkeys.html> for details.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue