Commit ce6803aa0cbd35e60637ef5a8a20fb5dc141de3e

Authored by nbm
1 parent f01261ab

Use boolean types for boolean values, since we have the type available.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3302 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 29 additions and 29 deletions
sql/pgsql/install/tables.sql
@@ -160,8 +160,8 @@ CREATE TABLE document_fields ( @@ -160,8 +160,8 @@ CREATE TABLE document_fields (
160 id INT4 NOT NULL DEFAULT '0', 160 id INT4 NOT NULL DEFAULT '0',
161 name char(255) NOT NULL DEFAULT '', 161 name char(255) NOT NULL DEFAULT '',
162 data_type char(100) NOT NULL DEFAULT '', 162 data_type char(100) NOT NULL DEFAULT '',
163 - is_generic INT2 DEFAULT NULL,  
164 - has_lookup INT2 DEFAULT NULL 163 + is_generic boolean DEFAULT NULL,
  164 + has_lookup boolean DEFAULT NULL
165 ); 165 );
166 166
167 -- -------------------------------------------------------- 167 -- --------------------------------------------------------
@@ -199,7 +199,7 @@ CREATE TABLE document_subscriptions ( @@ -199,7 +199,7 @@ CREATE TABLE document_subscriptions (
199 id INT4 NOT NULL DEFAULT '0', 199 id INT4 NOT NULL DEFAULT '0',
200 user_id INT4 NOT NULL DEFAULT '0', 200 user_id INT4 NOT NULL DEFAULT '0',
201 document_id INT4 NOT NULL DEFAULT '0', 201 document_id INT4 NOT NULL DEFAULT '0',
202 - is_alerted INT2 DEFAULT NULL 202 + is_alerted boolean DEFAULT NULL
203 ); 203 );
204 204
205 -- -------------------------------------------------------- 205 -- --------------------------------------------------------
@@ -252,7 +252,7 @@ CREATE TABLE document_type_fields_link ( @@ -252,7 +252,7 @@ CREATE TABLE document_type_fields_link (
252 id INT4 NOT NULL DEFAULT '0', 252 id INT4 NOT NULL DEFAULT '0',
253 document_type_id INT4 NOT NULL DEFAULT '0', 253 document_type_id INT4 NOT NULL DEFAULT '0',
254 field_id INT4 NOT NULL DEFAULT '0', 254 field_id INT4 NOT NULL DEFAULT '0',
255 - is_mandatory INT2 NOT NULL DEFAULT '0' 255 + is_mandatory boolean NOT NULL DEFAULT '0'
256 ); 256 );
257 257
258 -- -------------------------------------------------------- 258 -- --------------------------------------------------------
@@ -286,7 +286,7 @@ CREATE TABLE documents ( @@ -286,7 +286,7 @@ CREATE TABLE documents (
286 folder_id INT4 NOT NULL DEFAULT '0', 286 folder_id INT4 NOT NULL DEFAULT '0',
287 major_version INT4 NOT NULL DEFAULT '0', 287 major_version INT4 NOT NULL DEFAULT '0',
288 minor_version INT4 NOT NULL DEFAULT '0', 288 minor_version INT4 NOT NULL DEFAULT '0',
289 - is_checked_out INT2 NOT NULL DEFAULT '0', 289 + is_checked_out boolean NOT NULL DEFAULT '0',
290 parent_folder_ids text, 290 parent_folder_ids text,
291 full_path text, 291 full_path text,
292 checked_out_user_id INT4 DEFAULT NULL, 292 checked_out_user_id INT4 DEFAULT NULL,
@@ -316,7 +316,7 @@ CREATE TABLE folder_subscriptions ( @@ -316,7 +316,7 @@ CREATE TABLE folder_subscriptions (
316 id INT4 NOT NULL DEFAULT '0', 316 id INT4 NOT NULL DEFAULT '0',
317 user_id INT4 NOT NULL DEFAULT '0', 317 user_id INT4 NOT NULL DEFAULT '0',
318 folder_id INT4 NOT NULL DEFAULT '0', 318 folder_id INT4 NOT NULL DEFAULT '0',
319 - is_alerted INT2 DEFAULT NULL 319 + is_alerted boolean DEFAULT NULL
320 ); 320 );
321 321
322 -- -------------------------------------------------------- 322 -- --------------------------------------------------------
@@ -332,7 +332,7 @@ CREATE TABLE folders ( @@ -332,7 +332,7 @@ CREATE TABLE folders (
332 parent_id INT4 DEFAULT NULL, 332 parent_id INT4 DEFAULT NULL,
333 creator_id INT4 DEFAULT NULL, 333 creator_id INT4 DEFAULT NULL,
334 unit_id INT4 DEFAULT NULL, 334 unit_id INT4 DEFAULT NULL,
335 - is_public INT2 NOT NULL DEFAULT '0', 335 + is_public boolean NOT NULL DEFAULT '0',
336 parent_folder_ids text, 336 parent_folder_ids text,
337 full_path text, 337 full_path text,
338 inherit_parent_folder_permission INT4 DEFAULT NULL, 338 inherit_parent_folder_permission INT4 DEFAULT NULL,
@@ -351,9 +351,9 @@ CREATE TABLE folders_users_roles_link ( @@ -351,9 +351,9 @@ CREATE TABLE folders_users_roles_link (
351 user_id INT4 NOT NULL DEFAULT '0', 351 user_id INT4 NOT NULL DEFAULT '0',
352 document_id INT4 NOT NULL DEFAULT '0', 352 document_id INT4 NOT NULL DEFAULT '0',
353 datetime TIMESTAMP DEFAULT NULL, 353 datetime TIMESTAMP DEFAULT NULL,
354 - done INT2 DEFAULT NULL,  
355 - active INT2 DEFAULT NULL,  
356 - dependant_documents_created INT2 DEFAULT NULL 354 + done boolean DEFAULT NULL,
  355 + active boolean DEFAULT NULL,
  356 + dependant_documents_created boolean DEFAULT NULL
357 ); 357 );
358 358
359 -- -------------------------------------------------------- 359 -- --------------------------------------------------------
@@ -381,8 +381,8 @@ CREATE TABLE groups_folders_link ( @@ -381,8 +381,8 @@ CREATE TABLE groups_folders_link (
381 id INT4 NOT NULL DEFAULT '0', 381 id INT4 NOT NULL DEFAULT '0',
382 group_id INT4 NOT NULL DEFAULT '0', 382 group_id INT4 NOT NULL DEFAULT '0',
383 folder_id INT4 NOT NULL DEFAULT '0', 383 folder_id INT4 NOT NULL DEFAULT '0',
384 - can_read INT2 NOT NULL DEFAULT '0',  
385 - can_write INT2 NOT NULL DEFAULT '0' 384 + can_read boolean NOT NULL DEFAULT '0',
  385 + can_write boolean NOT NULL DEFAULT '0'
386 ); 386 );
387 387
388 -- -------------------------------------------------------- 388 -- --------------------------------------------------------
@@ -394,8 +394,8 @@ CREATE TABLE groups_folders_link ( @@ -394,8 +394,8 @@ CREATE TABLE groups_folders_link (
394 CREATE TABLE groups_lookup ( 394 CREATE TABLE groups_lookup (
395 id INT4 NOT NULL DEFAULT '0', 395 id INT4 NOT NULL DEFAULT '0',
396 name char(100) NOT NULL DEFAULT '', 396 name char(100) NOT NULL DEFAULT '',
397 - is_sys_admin INT2 NOT NULL DEFAULT '0',  
398 - is_unit_admin INT2 NOT NULL DEFAULT '0' 397 + is_sys_admin boolean NOT NULL DEFAULT '0',
  398 + is_unit_admin boolean NOT NULL DEFAULT '0'
399 ); 399 );
400 400
401 -- -------------------------------------------------------- 401 -- --------------------------------------------------------
@@ -474,7 +474,7 @@ CREATE TABLE news ( @@ -474,7 +474,7 @@ CREATE TABLE news (
474 image text, 474 image text,
475 image_size INT4 DEFAULT NULL, 475 image_size INT4 DEFAULT NULL,
476 image_mime_type_id INT4 DEFAULT NULL, 476 image_mime_type_id INT4 DEFAULT NULL,
477 - active INT2 DEFAULT NULL 477 + active boolean DEFAULT NULL
478 ); 478 );
479 479
480 -- -------------------------------------------------------- 480 -- --------------------------------------------------------
@@ -497,9 +497,9 @@ CREATE TABLE organisations_lookup ( @@ -497,9 +497,9 @@ CREATE TABLE organisations_lookup (
497 CREATE TABLE roles ( 497 CREATE TABLE roles (
498 id INT4 NOT NULL DEFAULT '0', 498 id INT4 NOT NULL DEFAULT '0',
499 name char(255) NOT NULL DEFAULT '', 499 name char(255) NOT NULL DEFAULT '',
500 - active INT2 NOT NULL DEFAULT '0',  
501 - can_read INT2 NOT NULL DEFAULT '0',  
502 - can_write INT2 NOT NULL DEFAULT '0' 500 + active boolean NOT NULL DEFAULT '0',
  501 + can_read boolean NOT NULL DEFAULT '0',
  502 + can_write boolean NOT NULL DEFAULT '0'
503 ); 503 );
504 504
505 -- -------------------------------------------------------- 505 -- --------------------------------------------------------
@@ -597,8 +597,8 @@ CREATE TABLE users ( @@ -597,8 +597,8 @@ CREATE TABLE users (
597 quota_current INT4 NOT NULL DEFAULT '0', 597 quota_current INT4 NOT NULL DEFAULT '0',
598 email char(255) DEFAULT NULL, 598 email char(255) DEFAULT NULL,
599 mobile char(255) DEFAULT NULL, 599 mobile char(255) DEFAULT NULL,
600 - email_notification INT2 NOT NULL DEFAULT '0',  
601 - sms_notification INT2 NOT NULL DEFAULT '0', 600 + email_notification boolean NOT NULL DEFAULT '0',
  601 + sms_notification boolean NOT NULL DEFAULT '0',
602 ldap_dn char(255) DEFAULT NULL, 602 ldap_dn char(255) DEFAULT NULL,
603 max_sessions INT4 DEFAULT NULL, 603 max_sessions INT4 DEFAULT NULL,
604 language_id INT4 DEFAULT NULL 604 language_id INT4 DEFAULT NULL
@@ -725,7 +725,7 @@ INSERT INTO data_types VALUES (5, 'FLOAT'); @@ -725,7 +725,7 @@ INSERT INTO data_types VALUES (5, 'FLOAT');
725 -- Dumping data for table `document_fields` 725 -- Dumping data for table `document_fields`
726 -- 726 --
727 727
728 -INSERT INTO document_fields VALUES (1, 'Category', 'STRING', 1, NULL); 728 +INSERT INTO document_fields VALUES (1, 'Category', 'STRING', TRUE, NULL);
729 729
730 -- 730 --
731 -- Dumping data for table `document_fields_link` 731 -- Dumping data for table `document_fields_link`
@@ -802,8 +802,8 @@ INSERT INTO folder_doctypes_link VALUES (1, 2, 1); @@ -802,8 +802,8 @@ INSERT INTO folder_doctypes_link VALUES (1, 2, 1);
802 -- Dumping data for table `folders` 802 -- Dumping data for table `folders`
803 -- 803 --
804 804
805 -INSERT INTO folders VALUES (1, 'Root Folder', 'Root Document Folder', 0, 1, 0, 0, NULL, NULL, NULL, 1);  
806 -INSERT INTO folders VALUES (2, 'Default Unit', 'Default Unit Root Folder', 1, 1, 1, 0, '1', 'Root Folder', NULL, 1); 805 +INSERT INTO folders VALUES (1, 'Root Folder', 'Root Document Folder', 0, 1, 0, FALSE, NULL, NULL, NULL, 1);
  806 +INSERT INTO folders VALUES (2, 'Default Unit', 'Default Unit Root Folder', 1, 1, 1, FALSE, '1', 'Root Folder', NULL, 1);
807 807
808 -- 808 --
809 -- Dumping data for table `folders_users_roles_link` 809 -- Dumping data for table `folders_users_roles_link`
@@ -824,9 +824,9 @@ INSERT INTO folders VALUES (2, 'Default Unit', 'Default Unit Root Folder', 1, 1, @@ -824,9 +824,9 @@ INSERT INTO folders VALUES (2, 'Default Unit', 'Default Unit Root Folder', 1, 1,
824 -- Dumping data for table `groups_lookup` 824 -- Dumping data for table `groups_lookup`
825 -- 825 --
826 826
827 -INSERT INTO groups_lookup VALUES (1, 'System Administrators', 1, 0);  
828 -INSERT INTO groups_lookup VALUES (2, 'Unit Administrators', 0, 1);  
829 -INSERT INTO groups_lookup VALUES (3, 'Anonymous', 0, 0); 827 +INSERT INTO groups_lookup VALUES (1, 'System Administrators', TRUE, FALSE);
  828 +INSERT INTO groups_lookup VALUES (2, 'Unit Administrators', FALSE, TRUE);
  829 +INSERT INTO groups_lookup VALUES (3, 'Anonymous', FALSE, FALSE);
830 830
831 -- 831 --
832 -- Dumping data for table `groups_units_link` 832 -- Dumping data for table `groups_units_link`
@@ -1157,9 +1157,9 @@ INSERT INTO units_organisations_link VALUES (1, 1, 1); @@ -1157,9 +1157,9 @@ INSERT INTO units_organisations_link VALUES (1, 1, 1);
1157 -- Dumping data for table `users` 1157 -- Dumping data for table `users`
1158 -- 1158 --
1159 1159
1160 -INSERT INTO users VALUES (1, 'admin', 'Administrator', '21232f297a57a5a743894a0e4a801fc3', 0, 0, '', '', 1, 1, '', 1, 1);  
1161 -INSERT INTO users VALUES (2, 'unitAdmin', 'Unit Administrator', '21232f297a57a5a743894a0e4a801fc3', 0, 0, '', '', 1, 1, '', 1, 1);  
1162 -INSERT INTO users VALUES (3, 'guest', 'Anonymous', '084e0343a0486ff05530df6c705c8bb4', 0, 0, '', '', 0, 0, '', 19, 1); 1160 +INSERT INTO users VALUES (1, 'admin', 'Administrator', '21232f297a57a5a743894a0e4a801fc3', 0, 0, '', '', TRUE, TRUE, '', 1, 1);
  1161 +INSERT INTO users VALUES (2, 'unitAdmin', 'Unit Administrator', '21232f297a57a5a743894a0e4a801fc3', 0, 0, '', '', TRUE, TRUE, '', 1, 1);
  1162 +INSERT INTO users VALUES (3, 'guest', 'Anonymous', '084e0343a0486ff05530df6c705c8bb4', 0, 0, '', '', FALSE, FALSE, '', 19, 1);
1163 1163
1164 -- 1164 --
1165 -- Dumping data for table `users_groups_link` 1165 -- Dumping data for table `users_groups_link`