Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
c00795e0
Commit
c00795e0
authored
Jan 23, 2013
by
Mukund Sivaraman
Browse files
[1756] Bump schema version to 2.2 and update dbutil
parent
388434f8
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/bin/dbutil/dbutil.py.in
View file @
c00795e0
...
...
@@ -200,10 +200,16 @@ UPGRADES = [
"CREATE INDEX nsec3_byhash_and_rdtype ON nsec3 " +
"(hash, rdtype)"
]
},
{'from': (2, 1), 'to': (2, 2),
'statements': [
"CREATE INDEX records_byrname_and_rdtype ON records (rname, rdtype)"
]
}
# To extend this, leave the above statements in place and add another
# dictionary to the list. The "from" version should be (2,
1
), the "to"
# dictionary to the list. The "from" version should be (2,
2
), the "to"
# version whatever the version the update is to, and the SQL statements are
# the statements required to perform the upgrade. This way, the upgrade
# program will be able to upgrade both a V1.0 and a V2.0 database.
...
...
src/bin/dbutil/tests/dbutil_test.sh.in
View file @
c00795e0
...
...
@@ -165,7 +165,7 @@ upgrade_ok_test() {
if
[
$?
-eq
0
]
then
# Compare schema with the reference
get_schema
$testdata
/v2_
1
.sqlite3
get_schema
$testdata
/v2_
2
.sqlite3
expected_schema
=
$db_schema
get_schema
$tempfile
actual_schema
=
$db_schema
...
...
@@ -177,7 +177,7 @@ upgrade_ok_test() {
fi
# Check the version is set correctly
check_version
$tempfile
"V2.
1
"
check_version
$tempfile
"V2.
2
"
# Check that a backup was made
check_backup
$1
$2
...
...
@@ -449,7 +449,7 @@ ${SHELL} ../run_dbutil.sh --upgrade $tempfile << .
Yes
.
passzero
$?
check_version
$tempfile
"V2.
1
"
check_version
$tempfile
"V2.
2
"
rm
-f
$tempfile
$backupfile
echo
"13.4 Interactive prompt - no"
...
...
src/bin/dbutil/tests/testdata/Makefile.am
View file @
c00795e0
...
...
@@ -11,3 +11,4 @@ EXTRA_DIST += README
EXTRA_DIST
+=
too_many_version.sqlite3
EXTRA_DIST
+=
v2_0.sqlite3
EXTRA_DIST
+=
v2_1.sqlite3
EXTRA_DIST
+=
v2_2.sqlite3
src/bin/dbutil/tests/testdata/v2_2.sqlite3
0 → 100644
View file @
c00795e0
File added
src/lib/datasrc/sqlite3_accessor.cc
View file @
c00795e0
...
...
@@ -44,7 +44,7 @@ namespace {
// program may not be taking advantage of features (possibly performance
// improvements) added to the database.
const
int
SQLITE_SCHEMA_MAJOR_VERSION
=
2
;
const
int
SQLITE_SCHEMA_MINOR_VERSION
=
1
;
const
int
SQLITE_SCHEMA_MINOR_VERSION
=
2
;
}
namespace
isc
{
...
...
@@ -338,7 +338,7 @@ public:
const
char
*
const
SCHEMA_LIST
[]
=
{
"CREATE TABLE schema_version (version INTEGER NOT NULL, "
"minor INTEGER NOT NULL DEFAULT 0)"
,
"INSERT INTO schema_version VALUES (2,
1
)"
,
"INSERT INTO schema_version VALUES (2,
2
)"
,
"CREATE TABLE zones (id INTEGER PRIMARY KEY, "
"name TEXT NOT NULL COLLATE NOCASE, "
"rdclass TEXT NOT NULL COLLATE NOCASE DEFAULT 'IN', "
...
...
src/lib/python/isc/datasrc/sqlite3_ds.py
View file @
c00795e0
...
...
@@ -25,7 +25,7 @@ RR_RDATA_INDEX = 7
# Current major and minor versions of schema
SCHEMA_MAJOR_VERSION
=
2
SCHEMA_MINOR_VERSION
=
1
SCHEMA_MINOR_VERSION
=
2
class
Sqlite3DSError
(
Exception
):
""" Define exceptions."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment