Commit bf5e5ee622395bb1fd8100371c10190b7c28b905

Authored by kevin_fourie
1 parent 0a4329bf

Merged in from DEV trunk...

KTS-2442
"Some database tables use unsigned int, but relations are mostly to signed int fields. This means foreign key constraints cannot be added easily."

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2442
"Some database tables use unsigned int, but relations are mostly to signed int fields. This means foreign key constraints cannot be added easily."
Updated. Mime type defaults to 9 (binary file) until it is set officially.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@7316 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/documentcontentversion.inc.php
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 * License Version 1.1.2 ("License"); You may not use this file except in 6 * License Version 1.1.2 ("License"); You may not use this file except in
7 * compliance with the License. You may obtain a copy of the License at 7 * compliance with the License. You may obtain a copy of the License at
8 * http://www.knowledgetree.com/KPL 8 * http://www.knowledgetree.com/KPL
9 - * 9 + *
10 * Software distributed under the License is distributed on an "AS IS" 10 * Software distributed under the License is distributed on an "AS IS"
11 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 11 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
12 * See the License for the specific language governing rights and 12 * See the License for the specific language governing rights and
@@ -17,9 +17,9 @@ @@ -17,9 +17,9 @@
17 * (ii) the KnowledgeTree copyright notice 17 * (ii) the KnowledgeTree copyright notice
18 * in the same form as they appear in the distribution. See the License for 18 * in the same form as they appear in the distribution. See the License for
19 * requirements. 19 * requirements.
20 - * 20 + *
21 * The Original Code is: KnowledgeTree Open Source 21 * The Original Code is: KnowledgeTree Open Source
22 - * 22 + *
23 * The Initial Developer of the Original Code is The Jam Warehouse Software 23 * The Initial Developer of the Original Code is The Jam Warehouse Software
24 * (Pty) Ltd, trading as KnowledgeTree. 24 * (Pty) Ltd, trading as KnowledgeTree.
25 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright 25 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
@@ -103,7 +103,7 @@ class KTDocumentContentVersion extends KTEntity { @@ -103,7 +103,7 @@ class KTDocumentContentVersion extends KTEntity {
103 $this->iSize = 0; 103 $this->iSize = 0;
104 } 104 }
105 if (empty($this->iMimeTypeId)) { 105 if (empty($this->iMimeTypeId)) {
106 - $this->iMimeTypeId = 0; 106 + $this->iMimeTypeId = 9;
107 } 107 }
108 if (is_null($this->iMajorVersion)) { 108 if (is_null($this->iMajorVersion)) {
109 $this->iMajorVersion = 0; 109 $this->iMajorVersion = 0;
sql/mysql/upgrade/3.5.0/relation_friendly.sql
@@ -3,3 +3,8 @@ alter table `folders` change `owner_id` `owner_id` int NULL; @@ -3,3 +3,8 @@ alter table `folders` change `owner_id` `owner_id` int NULL;
3 alter table `index_files` change `document_id` `document_id` int NOT NULL; 3 alter table `index_files` change `document_id` `document_id` int NOT NULL;
4 alter table `index_files` change `user_id` `user_id` int NOT NULL; 4 alter table `index_files` change `user_id` `user_id` int NOT NULL;
5 alter table `type_workflow_map` change `workflow_id` `workflow_id` int NULL; 5 alter table `type_workflow_map` change `workflow_id` `workflow_id` int NULL;
  6 +alter table document_content_version change mime_id mime_id int null default 9;
  7 +alter table documents change owner_id owner_id int null;
  8 +alter table documents change parent_id parent_id int null;
  9 +update documents set owner_id=null where owner_id=0;
  10 +update folders set parent_id=null where parent_id=0;