mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Add some tests of statements in foreignkeys.html.
FossilOrigin-Name: 8382867956caf20f62c46c15b456c1c16d0824fd
This commit is contained in:
@ -958,6 +958,20 @@ proc copy_file {from to} {
|
||||
}
|
||||
}
|
||||
|
||||
# Drop all tables in database [db]
|
||||
proc drop_all_tables {{db db}} {
|
||||
set pk [$db one "PRAGMA foreign_keys"]
|
||||
$db eval "PRAGMA foreign_keys = OFF"
|
||||
foreach {t type} [$db eval {
|
||||
SELECT name, type FROM sqlite_master
|
||||
WHERE type IN('table', 'view') AND name NOT like 'sqlite_%'
|
||||
}] {
|
||||
$db eval "DROP $type $t"
|
||||
}
|
||||
$db eval " PRAGMA foreign_keys = $pk "
|
||||
}
|
||||
|
||||
|
||||
# If the library is compiled with the SQLITE_DEFAULT_AUTOVACUUM macro set
|
||||
# to non-zero, then set the global variable $AUTOVACUUM to 1.
|
||||
set AUTOVACUUM $sqlite_options(default_autovacuum)
|
||||
|
Reference in New Issue
Block a user