Files
duplicati/Duplicati/Library/Main/Database/Local/Database schema/6. Optimize FileSetEntry-Table.sql
T
Kenneth Skovhede 62ea2d23f5 Added a sync command to the Controller and CLI.
This refactors a part of the database and adds a new "sync" command that reuses a lot of the backup logic to take a set of sources and apply them to a backend.

Unlike the backup process, the sync copies files verbatim without any encryption.
2026-06-25 15:49:00 +02:00

29 lines
864 B
SQL

BEGIN TRANSACTION;
DROP INDEX "FilesetentryIndex";
ALTER TABLE "FilesetEntry"
RENAME TO "UPGRADE_FilesetEntry";
-- ["WITHOUT ROWID" works with SQLite v3.8.2 (eq System.Data.SQLite v1.0.90.0, rel 2013-12-23) and later]
CREATE TABLE "FilesetEntry" (
"FilesetID" INTEGER NOT NULL,
"FileID" INTEGER NOT NULL,
"Lastmodified" INTEGER NOT NULL,
CONSTRAINT "FilesetEntry_PK_FilesetIdFileId" PRIMARY KEY ("FilesetID", "FileID")
) {#if sqlite_version >= 3.8.2} WITHOUT ROWID {#endif};
INSERT INTO "FilesetEntry" ("FilesetID", "FileID", "Lastmodified")
SELECT "FilesetID", "FileID", "Lastmodified"
FROM "UPGRADE_FilesetEntry";
DROP TABLE "UPGRADE_FilesetEntry";
/* Improved reverse lookup for joining Fileset and File table */
CREATE INDEX "FilesetentryFileIdIndex" on "FilesetEntry" ("FileID");
UPDATE "Version" SET "Version" = 6;
COMMIT;
VACUUM;