provide DB infrastructure for resizing annotations; this will delete any existing annotations

This commit is contained in:
Simon Kornblith 2007-01-03 04:48:18 +00:00
parent 70d06e02f2
commit be2abdf397
3 changed files with 9 additions and 2 deletions

View File

@ -472,7 +472,7 @@ Zotero.Annotation.prototype.save = function() {
// fetch path to node
var path = Zotero.Annotate.getPathForPoint(node, offset);
var query = "INSERT INTO annotations VALUES (NULL, ?, ?, ?, ?, ?, ?, ?)";
var query = "INSERT INTO annotations VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
var parameters = [
this.annotationsObj.itemID, // itemID
path.parent, // parent
@ -480,6 +480,7 @@ Zotero.Annotation.prototype.save = function() {
path.offset, // offset
this.x, // x
this.y, // y
30, 5, // cols, rows
text // text
];
}

View File

@ -697,6 +697,10 @@ Zotero.Schema = new function(){
Zotero.DB.query("CREATE INDEX itemNotes_sourceItemID ON itemNotes(sourceItemID)");
Zotero.DB.query("DROP TABLE itemNotesTemp");
}
if (i==15) {
Zotero.DB.query("DROP TABLE annotations");
}
}
_updateSchema('userdata');

View File

@ -1,4 +1,4 @@
-- 14
-- 15
-- This file creates tables containing user-specific data -- any changes
-- to existing tables made here must be mirrored in transition steps in
@ -231,6 +231,8 @@ CREATE TABLE IF NOT EXISTS annotations (
offset INT,
x INT,
y INT,
cols INT,
rows INT,
text TEXT,
FOREIGN KEY (itemID) REFERENCES itemAttachments(itemID)
);