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,