chiark / gitweb /
update-bkp-index.in: The tuple (host, fs, date) is not unique.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 28 Jan 2013 10:44:29 +0000 (10:44 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 28 Jan 2013 10:44:29 +0000 (10:44 +0000)
So we must fix the schema, and include the volume name in the primary
key.  This is still early days, so I'm just going to break it.

update-bkp-index.in

index 23b64bd56a6c4b9c8b5835147360f5d7a37b0360..4aa799b90584a24c3ead1ab96442827f1a85b6a1 100644 (file)
@@ -52,7 +52,8 @@ CREATE TABLE idx (
        fs TEXT NOT NULL,
        date TEXT NOT NULL,
        vol TEXT NOT NULL,
-       PRIMARY KEY (host, fs, date));
+       PRIMARY KEY (host, fs, vol, date));
+CREATE INDEX idx_byhostfsdate ON idx (host, fs, date);
 CREATE INDEX idx_byvol ON idx (vol);
 EOF