Closes #237, add accessDate field to all item types with URL field

This commit is contained in:
Dan Stillman 2006-08-30 16:02:21 +00:00
parent 90036a0ea7
commit 200ca86989
3 changed files with 143 additions and 134 deletions

View file

@ -281,7 +281,7 @@ var Scholar_ItemTypeManager = new function(){
var fields = Scholar.DB.query("SELECT * FROM fields ORDER BY fieldID");
var itemTypeFields = Scholar.DB.query("SELECT * FROM itemTypeFields ORDER BY itemTypeID, orderIndex");
var prefix = " ";
var prefix = " ";
var sql = '';
for (var i in types){
@ -302,8 +302,8 @@ var Scholar_ItemTypeManager = new function(){
for (var i in itemTypeFields){
sql += prefix + "INSERT INTO itemTypeFields VALUES ("
+ itemTypeFields[i]['itemTypeID'] + "," + itemTypeFields[i]['fieldID'] + ","
+ (itemTypeFields[i]['hide'] ? itemTypeFields[i]['hide'] : 'NULL') + ","
+ itemTypeFields[i]['itemTypeID'] + ", " + itemTypeFields[i]['fieldID'] + ", "
+ (itemTypeFields[i]['hide'] ? itemTypeFields[i]['hide'] : 'NULL') + ", "
+ itemTypeFields[i]['orderIndex'] + ");\n";
}

View file

@ -401,7 +401,7 @@ Scholar.Schema = new function(){
//
// Change this value to match the schema version
//
var toVersion = 44;
var toVersion = 45;
if (toVersion != _getSchemaSQLVersion()){
throw('Schema version does not match version in _migrateSchema()');
@ -425,7 +425,7 @@ Scholar.Schema = new function(){
}
}
if (i==44){
if (i==45){
// Clear storage directory
var file = Scholar.getStorageDirectory();
if (file.exists()){

View file

@ -1,4 +1,4 @@
-- 43
-- 45
DROP TABLE IF EXISTS version;
CREATE TABLE version (
@ -278,6 +278,10 @@
);
INSERT INTO "fieldFormats" VALUES(1, '.*', 0);
INSERT INTO "fieldFormats" VALUES(2, '[0-9]*', 1);
INSERT INTO "fieldFormats" VALUES(3, '[0-9]{4}', 1);
INSERT INTO itemTypes VALUES (1,'note');
INSERT INTO itemTypes VALUES (2,'book');
INSERT INTO itemTypes VALUES (3,'bookSection');
@ -292,11 +296,7 @@
INSERT INTO itemTypes VALUES (12,'artwork');
INSERT INTO itemTypes VALUES (13,'website');
INSERT INTO itemTypes VALUES (14,'attachment');
INSERT INTO "fieldFormats" VALUES(1, '.*', 0);
INSERT INTO "fieldFormats" VALUES(2, '[0-9]*', 1);
INSERT INTO "fieldFormats" VALUES(3, '[0-9]{4}', 1);
INSERT INTO fields VALUES (1,'url',NULL);
INSERT INTO fields VALUES (2,'rights',NULL);
INSERT INTO fields VALUES (3,'series',NULL);
@ -305,7 +305,6 @@
INSERT INTO fields VALUES (6,'edition',NULL);
INSERT INTO fields VALUES (7,'place',NULL);
INSERT INTO fields VALUES (8,'publisher',NULL);
INSERT INTO fields VALUES (10,'pages',NULL);
INSERT INTO fields VALUES (11,'ISBN',NULL);
INSERT INTO fields VALUES (12,'publicationTitle',NULL);
@ -319,7 +318,6 @@
INSERT INTO fields VALUES (20,'medium',NULL);
INSERT INTO fields VALUES (21,'distributor',NULL);
INSERT INTO fields VALUES (22,'extra',NULL);
INSERT INTO fields VALUES (24,'type',NULL);
INSERT INTO fields VALUES (25,'journalAbbreviation',NULL);
INSERT INTO fields VALUES (26,'DOI',NULL);
@ -327,127 +325,138 @@
INSERT INTO fields VALUES (28,'seriesTitle',NULL);
INSERT INTO fields VALUES (29,'seriesText',NULL);
INSERT INTO fields VALUES (30,'seriesNumber',NULL);
INSERT INTO "itemTypeFields" VALUES(2, 1, NULL, 14);
INSERT INTO "itemTypeFields" VALUES(2, 2, NULL, 13);
INSERT INTO "itemTypeFields" VALUES(2, 3, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(2, 4, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(2, 5, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(2, 6, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(2, 7, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(2, 8, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(2, 10, NULL, 9);
INSERT INTO "itemTypeFields" VALUES(2, 11, NULL, 10);
INSERT INTO "itemTypeFields" VALUES(4, 1, NULL, 15);
INSERT INTO "itemTypeFields" VALUES(4, 2, NULL, 14);
INSERT INTO "itemTypeFields" VALUES(4, 12, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(4, 4, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(4, 5, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(4, 10, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(4, 13, NULL, 11);
INSERT INTO "itemTypeFields" VALUES(3, 1, NULL, 15);
INSERT INTO "itemTypeFields" VALUES(3, 2, NULL, 14);
INSERT INTO "itemTypeFields" VALUES(3, 12, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(3, 3, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(3, 4, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(3, 5, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(3, 6, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(3, 7, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(3, 8, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(3, 10, NULL, 10);
INSERT INTO "itemTypeFields" VALUES(3, 11, NULL, 11);
INSERT INTO "itemTypeFields" VALUES(5, 1, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(5, 2, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(5, 12, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(5, 14, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(5, 10, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(5, 13, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(6, 1, NULL, 10);
INSERT INTO "itemTypeFields" VALUES(6, 2, NULL, 9);
INSERT INTO "itemTypeFields" VALUES(6, 12, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(6, 6, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(6, 14, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(6, 15, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(6, 10, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(6, 13, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(7, 1, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(7, 2, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(7, 8, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(7, 16, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(7, 10, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(7, 17, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(8, 2, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(8, 24, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(8, 14, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(8, 19, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(9, 1, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(9, 2, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(9, 24, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(9, 7, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(9, 14, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(9, 19, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(10, 2, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(10, 14, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(10, 20, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(10, 19, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(11, 1, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(11, 2, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(11, 21, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(12, 1, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(12, 2, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(12, 24, NULL, 1);
INSERT INTO "itemTypeFields" VALUES(12, 14, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(13, 1, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(13, 2, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(12, 18, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(2, 18, NULL, 11);
INSERT INTO "itemTypeFields" VALUES(3, 18, NULL, 12);
INSERT INTO "itemTypeFields" VALUES(11, 18, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(12, 17, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(12, 22, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(2, 17, NULL, 12);
INSERT INTO "itemTypeFields" VALUES(2, 22, NULL, 15);
INSERT INTO "itemTypeFields" VALUES(3, 17, NULL, 13);
INSERT INTO "itemTypeFields" VALUES(3, 22, NULL, 16);
INSERT INTO "itemTypeFields" VALUES(11, 17, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(11, 22, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(10, 17, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(10, 18, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(10, 22, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(4, 17, NULL, 13);
INSERT INTO "itemTypeFields" VALUES(4, 18, NULL, 12);
INSERT INTO "itemTypeFields" VALUES(4, 22, NULL, 16);
INSERT INTO "itemTypeFields" VALUES(8, 17, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(8, 18, NULL, 4);
INSERT INTO "itemTypeFields" VALUES(8, 22, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(5, 17, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(5, 18, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(5, 22, NULL, 9);
INSERT INTO "itemTypeFields" VALUES(9, 17, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(9, 18, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(9, 22, NULL, 9);
INSERT INTO "itemTypeFields" VALUES(6, 17, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(6, 18, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(6, 22, NULL, 11);
INSERT INTO "itemTypeFields" VALUES(7, 18, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(7, 22, NULL, 9);
INSERT INTO "itemTypeFields" VALUES(13, 22, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(4, 25, NULL, 9);
INSERT INTO "itemTypeFields" VALUES(4, 26, NULL, 10);
INSERT INTO "itemTypeFields" VALUES(13, 27, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(13, 14, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(4, 14, NULL, 5);
INSERT INTO "itemTypeFields" VALUES(2, 14, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(3, 14, NULL, 9);
INSERT INTO "itemTypeFields" VALUES(11, 14, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(7, 14, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(2, 30, NULL, 2);
INSERT INTO "itemTypeFields" VALUES(3, 30, NULL, 3);
INSERT INTO "itemTypeFields" VALUES(4, 3, NULL, 6);
INSERT INTO "itemTypeFields" VALUES(4, 29, NULL, 8);
INSERT INTO "itemTypeFields" VALUES(4, 28, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(8, 1, NULL, 7);
INSERT INTO "itemTypeFields" VALUES(10, 1, NULL, 7);
INSERT INTO itemTypeFields VALUES (2, 3, NULL, 1);
INSERT INTO itemTypeFields VALUES (2, 30, NULL, 2);
INSERT INTO itemTypeFields VALUES (2, 4, NULL, 3);
INSERT INTO itemTypeFields VALUES (2, 5, NULL, 4);
INSERT INTO itemTypeFields VALUES (2, 6, NULL, 5);
INSERT INTO itemTypeFields VALUES (2, 7, NULL, 6);
INSERT INTO itemTypeFields VALUES (2, 8, NULL, 7);
INSERT INTO itemTypeFields VALUES (2, 14, NULL, 8);
INSERT INTO itemTypeFields VALUES (2, 10, NULL, 9);
INSERT INTO itemTypeFields VALUES (2, 11, NULL, 10);
INSERT INTO itemTypeFields VALUES (2, 18, NULL, 11);
INSERT INTO itemTypeFields VALUES (2, 17, NULL, 12);
INSERT INTO itemTypeFields VALUES (2, 2, NULL, 13);
INSERT INTO itemTypeFields VALUES (2, 1, NULL, 14);
INSERT INTO itemTypeFields VALUES (2, 27, NULL, 15);
INSERT INTO itemTypeFields VALUES (2, 22, NULL, 16);
INSERT INTO itemTypeFields VALUES (3, 12, NULL, 1);
INSERT INTO itemTypeFields VALUES (3, 3, NULL, 2);
INSERT INTO itemTypeFields VALUES (3, 30, NULL, 3);
INSERT INTO itemTypeFields VALUES (3, 4, NULL, 4);
INSERT INTO itemTypeFields VALUES (3, 5, NULL, 5);
INSERT INTO itemTypeFields VALUES (3, 6, NULL, 6);
INSERT INTO itemTypeFields VALUES (3, 7, NULL, 7);
INSERT INTO itemTypeFields VALUES (3, 8, NULL, 8);
INSERT INTO itemTypeFields VALUES (3, 14, NULL, 9);
INSERT INTO itemTypeFields VALUES (3, 10, NULL, 10);
INSERT INTO itemTypeFields VALUES (3, 11, NULL, 11);
INSERT INTO itemTypeFields VALUES (3, 18, NULL, 12);
INSERT INTO itemTypeFields VALUES (3, 17, NULL, 13);
INSERT INTO itemTypeFields VALUES (3, 2, NULL, 14);
INSERT INTO itemTypeFields VALUES (3, 1, NULL, 15);
INSERT INTO itemTypeFields VALUES (3, 27, NULL, 16);
INSERT INTO itemTypeFields VALUES (3, 22, NULL, 17);
INSERT INTO itemTypeFields VALUES (4, 12, NULL, 1);
INSERT INTO itemTypeFields VALUES (4, 4, NULL, 2);
INSERT INTO itemTypeFields VALUES (4, 5, NULL, 3);
INSERT INTO itemTypeFields VALUES (4, 10, NULL, 4);
INSERT INTO itemTypeFields VALUES (4, 14, NULL, 5);
INSERT INTO itemTypeFields VALUES (4, 3, NULL, 6);
INSERT INTO itemTypeFields VALUES (4, 28, NULL, 7);
INSERT INTO itemTypeFields VALUES (4, 29, NULL, 8);
INSERT INTO itemTypeFields VALUES (4, 25, NULL, 9);
INSERT INTO itemTypeFields VALUES (4, 26, NULL, 10);
INSERT INTO itemTypeFields VALUES (4, 13, NULL, 11);
INSERT INTO itemTypeFields VALUES (4, 18, NULL, 12);
INSERT INTO itemTypeFields VALUES (4, 17, NULL, 13);
INSERT INTO itemTypeFields VALUES (4, 2, NULL, 14);
INSERT INTO itemTypeFields VALUES (4, 1, NULL, 15);
INSERT INTO itemTypeFields VALUES (4, 27, NULL, 16);
INSERT INTO itemTypeFields VALUES (4, 22, NULL, 17);
INSERT INTO itemTypeFields VALUES (5, 12, NULL, 1);
INSERT INTO itemTypeFields VALUES (5, 14, NULL, 2);
INSERT INTO itemTypeFields VALUES (5, 10, NULL, 3);
INSERT INTO itemTypeFields VALUES (5, 13, NULL, 4);
INSERT INTO itemTypeFields VALUES (5, 18, NULL, 5);
INSERT INTO itemTypeFields VALUES (5, 17, NULL, 6);
INSERT INTO itemTypeFields VALUES (5, 2, NULL, 7);
INSERT INTO itemTypeFields VALUES (5, 1, NULL, 8);
INSERT INTO itemTypeFields VALUES (5, 27, NULL, 9);
INSERT INTO itemTypeFields VALUES (5, 22, NULL, 10);
INSERT INTO itemTypeFields VALUES (6, 12, NULL, 1);
INSERT INTO itemTypeFields VALUES (6, 6, NULL, 2);
INSERT INTO itemTypeFields VALUES (6, 14, NULL, 3);
INSERT INTO itemTypeFields VALUES (6, 15, NULL, 4);
INSERT INTO itemTypeFields VALUES (6, 10, NULL, 5);
INSERT INTO itemTypeFields VALUES (6, 13, NULL, 6);
INSERT INTO itemTypeFields VALUES (6, 18, NULL, 7);
INSERT INTO itemTypeFields VALUES (6, 17, NULL, 8);
INSERT INTO itemTypeFields VALUES (6, 2, NULL, 9);
INSERT INTO itemTypeFields VALUES (6, 1, NULL, 10);
INSERT INTO itemTypeFields VALUES (6, 27, NULL, 11);
INSERT INTO itemTypeFields VALUES (6, 22, NULL, 12);
INSERT INTO itemTypeFields VALUES (7, 8, NULL, 1);
INSERT INTO itemTypeFields VALUES (7, 16, NULL, 2);
INSERT INTO itemTypeFields VALUES (7, 14, NULL, 3);
INSERT INTO itemTypeFields VALUES (7, 10, NULL, 4);
INSERT INTO itemTypeFields VALUES (7, 18, NULL, 5);
INSERT INTO itemTypeFields VALUES (7, 17, NULL, 6);
INSERT INTO itemTypeFields VALUES (7, 2, NULL, 7);
INSERT INTO itemTypeFields VALUES (7, 1, NULL, 8);
INSERT INTO itemTypeFields VALUES (7, 27, NULL, 9);
INSERT INTO itemTypeFields VALUES (7, 22, NULL, 10);
INSERT INTO itemTypeFields VALUES (8, 24, NULL, 1);
INSERT INTO itemTypeFields VALUES (8, 14, NULL, 2);
INSERT INTO itemTypeFields VALUES (8, 19, NULL, 3);
INSERT INTO itemTypeFields VALUES (8, 18, NULL, 4);
INSERT INTO itemTypeFields VALUES (8, 17, NULL, 5);
INSERT INTO itemTypeFields VALUES (8, 2, NULL, 6);
INSERT INTO itemTypeFields VALUES (8, 1, NULL, 7);
INSERT INTO itemTypeFields VALUES (8, 27, NULL, 8);
INSERT INTO itemTypeFields VALUES (8, 22, NULL, 9);
INSERT INTO itemTypeFields VALUES (9, 24, NULL, 1);
INSERT INTO itemTypeFields VALUES (9, 7, NULL, 2);
INSERT INTO itemTypeFields VALUES (9, 14, NULL, 3);
INSERT INTO itemTypeFields VALUES (9, 19, NULL, 4);
INSERT INTO itemTypeFields VALUES (9, 18, NULL, 5);
INSERT INTO itemTypeFields VALUES (9, 17, NULL, 6);
INSERT INTO itemTypeFields VALUES (9, 2, NULL, 7);
INSERT INTO itemTypeFields VALUES (9, 1, NULL, 8);
INSERT INTO itemTypeFields VALUES (9, 27, NULL, 9);
INSERT INTO itemTypeFields VALUES (9, 22, NULL, 10);
INSERT INTO itemTypeFields VALUES (10, 14, NULL, 1);
INSERT INTO itemTypeFields VALUES (10, 20, NULL, 2);
INSERT INTO itemTypeFields VALUES (10, 19, NULL, 3);
INSERT INTO itemTypeFields VALUES (10, 18, NULL, 4);
INSERT INTO itemTypeFields VALUES (10, 17, NULL, 5);
INSERT INTO itemTypeFields VALUES (10, 2, NULL, 6);
INSERT INTO itemTypeFields VALUES (10, 1, NULL, 7);
INSERT INTO itemTypeFields VALUES (10, 27, NULL, 8);
INSERT INTO itemTypeFields VALUES (10, 22, NULL, 9);
INSERT INTO itemTypeFields VALUES (11, 21, NULL, 1);
INSERT INTO itemTypeFields VALUES (11, 14, NULL, 2);
INSERT INTO itemTypeFields VALUES (11, 18, NULL, 3);
INSERT INTO itemTypeFields VALUES (11, 17, NULL, 4);
INSERT INTO itemTypeFields VALUES (11, 2, NULL, 5);
INSERT INTO itemTypeFields VALUES (11, 1, NULL, 6);
INSERT INTO itemTypeFields VALUES (11, 27, NULL, 7);
INSERT INTO itemTypeFields VALUES (11, 22, NULL, 8);
INSERT INTO itemTypeFields VALUES (12, 24, NULL, 1);
INSERT INTO itemTypeFields VALUES (12, 14, NULL, 2);
INSERT INTO itemTypeFields VALUES (12, 18, NULL, 3);
INSERT INTO itemTypeFields VALUES (12, 17, NULL, 4);
INSERT INTO itemTypeFields VALUES (12, 2, NULL, 5);
INSERT INTO itemTypeFields VALUES (12, 1, NULL, 6);
INSERT INTO itemTypeFields VALUES (12, 27, NULL, 7);
INSERT INTO itemTypeFields VALUES (12, 22, NULL, 8);
INSERT INTO itemTypeFields VALUES (13, 14, NULL, 2);
INSERT INTO itemTypeFields VALUES (13, 1, NULL, 3);
INSERT INTO itemTypeFields VALUES (13, 27, NULL, 4);
INSERT INTO itemTypeFields VALUES (13, 2, NULL, 5);
INSERT INTO itemTypeFields VALUES (13, 22, NULL, 6);
INSERT INTO "fileTypes" VALUES(1, 'webpage');
INSERT INTO "fileTypes" VALUES(2, 'image');