Don't coerce text values in itemData to numbers (like, say, stripping zeroes from ISBN's--thanks Simon)
(Apparently 'columnName NONE' in SQLite is functionally equivalent to 'columnName ILUVTIDDLYWINKS' in setting column affinity--as in, they both use the default of NUMERIC--which frankly I feel the docs could've been slightly more clear on, since they scatter the word NONE in capital letters all about the page with the other affinity keywords...)
This commit is contained in:
parent
4b756d700b
commit
1693fa85d4
2 changed files with 4 additions and 4 deletions
|
@ -401,7 +401,7 @@ Scholar.Schema = new function(){
|
||||||
//
|
//
|
||||||
// Change this value to match the schema version
|
// Change this value to match the schema version
|
||||||
//
|
//
|
||||||
var toVersion = 45;
|
var toVersion = 46;
|
||||||
|
|
||||||
if (toVersion != _getSchemaSQLVersion()){
|
if (toVersion != _getSchemaSQLVersion()){
|
||||||
throw('Schema version does not match version in _migrateSchema()');
|
throw('Schema version does not match version in _migrateSchema()');
|
||||||
|
@ -425,7 +425,7 @@ Scholar.Schema = new function(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i==45){
|
if (i==46){
|
||||||
// Clear storage directory
|
// Clear storage directory
|
||||||
var file = Scholar.getStorageDirectory();
|
var file = Scholar.getStorageDirectory();
|
||||||
if (file.exists()){
|
if (file.exists()){
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
-- 45
|
-- 46
|
||||||
|
|
||||||
DROP TABLE IF EXISTS version;
|
DROP TABLE IF EXISTS version;
|
||||||
CREATE TABLE version (
|
CREATE TABLE version (
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
CREATE TABLE itemData (
|
CREATE TABLE itemData (
|
||||||
itemID INT,
|
itemID INT,
|
||||||
fieldID INT,
|
fieldID INT,
|
||||||
value NONE,
|
value,
|
||||||
PRIMARY KEY (itemID, fieldID),
|
PRIMARY KEY (itemID, fieldID),
|
||||||
FOREIGN KEY (itemID) REFERENCES items(itemID),
|
FOREIGN KEY (itemID) REFERENCES items(itemID),
|
||||||
FOREIGN KEY (fieldID) REFERENCES fields(fieldID)
|
FOREIGN KEY (fieldID) REFERENCES fields(fieldID)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue