diff --git a/Duplicati/Server/Database/Database schema/4. Add autoincrement to backup id.sql b/Duplicati/Server/Database/Database schema/4. Add autoincrement to backup id.sql new file mode 100644 index 000000000..068a32f9a --- /dev/null +++ b/Duplicati/Server/Database/Database schema/4. Add autoincrement to backup id.sql @@ -0,0 +1,15 @@ +ALTER TABLE "backup" RENAME TO "_backup_old"; + +CREATE TABLE "Backup" ( + "ID" INTEGER PRIMARY KEY AUTOINCREMENT, + "Name" TEXT NOT NULL, + "Tags" TEXT NOT NULL, + "TargetURL" TEXT NOT NULL, + "DBPath" TEXT NOT NULL +); + +INSERT INTO "backup" + SELECT * + FROM "_backup_old"; + +DROP TABLE "_backup_old"; diff --git a/Duplicati/Server/Database/Database schema/Schema.sql b/Duplicati/Server/Database/Database schema/Schema.sql index 9c620da6e..957844cbd 100644 --- a/Duplicati/Server/Database/Database schema/Schema.sql +++ b/Duplicati/Server/Database/Database schema/Schema.sql @@ -7,7 +7,7 @@ * and the DBPath is the path to the local database */ CREATE TABLE "Backup" ( - "ID" INTEGER PRIMARY KEY, + "ID" INTEGER PRIMARY KEY AUTOINCREMENT, "Name" TEXT NOT NULL, "Tags" TEXT NOT NULL, "TargetURL" TEXT NOT NULL, @@ -150,5 +150,5 @@ CREATE TABLE "TempFile" ( "Expires" INTEGER NOT NULL ); -INSERT INTO "Version" ("Version") VALUES (3); +INSERT INTO "Version" ("Version") VALUES (4); diff --git a/Duplicati/Server/Duplicati.Server.csproj b/Duplicati/Server/Duplicati.Server.csproj index c7af6fda2..f926f2b0a 100644 --- a/Duplicati/Server/Duplicati.Server.csproj +++ b/Duplicati/Server/Duplicati.Server.csproj @@ -124,6 +124,7 @@ + @@ -295,4 +296,4 @@ --> - \ No newline at end of file +