From c1e794dc4f519614ba9c34aa53e181a33b9504c3 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 21 Jul 2021 15:24:50 +0200 Subject: [PATCH] fix updating tblDocumentFiles --- install/update-5.1.0/update-sqlite3.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install/update-5.1.0/update-sqlite3.sql b/install/update-5.1.0/update-sqlite3.sql index ed9b14600..89e75a366 100644 --- a/install/update-5.1.0/update-sqlite3.sql +++ b/install/update-5.1.0/update-sqlite3.sql @@ -51,7 +51,9 @@ ALTER TABLE `new_tblDocumentContent` RENAME TO `tblDocumentContent`; CREATE TABLE `new_tblDocumentFiles` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT, `document` INTEGER NOT NULL default 0 REFERENCES `tblDocuments` (`id`), + `version` INTEGER unsigned NOT NULL default '0', `userID` INTEGER NOT NULL default 0 REFERENCES `tblUsers` (`id`), + `public` INTEGER NOT NULL default '0', `comment` text, `name` varchar(150) default NULL, `date` INTEGER default NULL, @@ -61,16 +63,12 @@ CREATE TABLE `new_tblDocumentFiles` ( `mimeType` varchar(100) NOT NULL default '' ) ; -INSERT INTO `new_tblDocumentFiles` SELECT * FROM `tblDocumentFiles`; +INSERT INTO `new_tblDocumentFiles` SELECT `id`, `document`, 0, `userID`, 0, `comment`, `name`, `date`, `dir`, `orgFileName`, `fileType`, `mimeType` FROM `tblDocumentFiles`; DROP TABLE `tblDocumentFiles`; ALTER TABLE `new_tblDocumentFiles` RENAME TO `tblDocumentFiles`; -ALTER TABLE `tblDocumentFiles` ADD COLUMN `version` INTEGER unsigned NOT NULL DEFAULT '0'; - -ALTER TABLE `tblDocumentFiles` ADD COLUMN `public` INTEGER unsigned NOT NULL DEFAULT '0'; - CREATE TABLE `new_tblUsers` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT, `login` varchar(50) default NULL,