Project

General

Profile

« Previous | Next » 

Revision 371

Added by Matthias almost 18 years ago

Fixed missing default values for INT fields in all system and modules tables (#329)

View differences:

trunk/wb/modules/wrapper/install.php
28 28
	// Create table
29 29
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wrapper`");
30 30
	$mod_wrapper = 'CREATE TABLE `'.TABLE_PREFIX.'mod_wrapper` ('
31
						  . ' `section_id` INT NOT NULL,'
32
						  . ' `page_id` INT NOT NULL,'
33
	                 . ' `url` TEXT NOT NULL DEFAULT \'\','
34
						  . ' `height` INT NOT NULL,'
35
	                 . ' PRIMARY KEY ( `section_id` ) )'
36
	                 . ' ';
31
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
32
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
33
		. ' `url` TEXT NOT NULL,'
34
		. ' `height` INT NOT NULL DEFAULT \'0\','
35
		. ' PRIMARY KEY ( `section_id` ) '
36
		. ' )';
37 37
	$database->query($mod_wrapper);
38 38
	
39 39
}
trunk/wb/modules/wysiwyg/install.php
28 28
	// Create table
29 29
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wysiwyg`");
30 30
	$mod_wysiwyg = 'CREATE TABLE `'.TABLE_PREFIX.'mod_wysiwyg` ( '
31
						  . ' `section_id` INT NOT NULL,'
32
						  . ' `page_id` INT NOT NULL,'
33
	                 . ' `content` TEXT NOT NULL DEFAULT \'\','
34
	                 . ' `text` TEXT NOT NULL DEFAULT \'\','
35
	                 . ' PRIMARY KEY ( `section_id` ) )'
36
	                 . ' ';
31
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
32
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
33
		. ' `content` TEXT NOT NULL ,'
34
		. ' `text` TEXT NOT NULL ,'
35
		. ' PRIMARY KEY ( `section_id` ) '
36
		. ' )';
37 37
	$database->query($mod_wysiwyg);
38 38
	
39 39
	// Insert info into the search table
trunk/wb/modules/form/install.php
33 33
	// Create tables
34 34
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_fields`");
35 35
	$mod_form = 'CREATE TABLE `'.TABLE_PREFIX.'mod_form_fields` ( `field_id` INT NOT NULL AUTO_INCREMENT,'
36
	                 . ' `section_id` INT NOT NULL ,'
37
	                 . ' `page_id` INT NOT NULL ,'
38
	                 . ' `position` INT NOT NULL ,'
39
	                 . ' `title` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
40
	                 . ' `type` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
41
	                 . ' `required` INT NOT NULL ,'
42
	                 . ' `value` TEXT NOT NULL DEFAULT \'\' ,'
43
	                 . ' `extra` TEXT NOT NULL DEFAULT \'\' ,'
44
	                 . ' PRIMARY KEY ( `field_id` ) )'
45
	                 . ' ';
36
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
37
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
38
		. ' `position` INT NOT NULL DEFAULT \'0\' ,'
39
		. ' `title` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
40
		. ' `type` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
41
		. ' `required` INT NOT NULL DEFAULT \'0\' ,'
42
		. ' `value` TEXT NOT NULL ,'
43
		. ' `extra` TEXT NOT NULL ,'
44
		. ' PRIMARY KEY ( `field_id` ) '
45
		. ' )';
46 46
	$database->query($mod_form);
47 47
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_settings`");
48 48
	$mod_form = 'CREATE TABLE `'.TABLE_PREFIX.'mod_form_settings` ('
49
						  . ' `section_id` INT NOT NULL,'
50
						  . ' `page_id` INT NOT NULL,'
51
	                 . ' `header` TEXT NOT NULL DEFAULT \'\' ,'
52
	                 . ' `field_loop` TEXT NOT NULL DEFAULT \'\' ,'
53
	                 . ' `footer` TEXT NOT NULL DEFAULT \'\' ,'
54
	                 . ' `email_to` TEXT NOT NULL DEFAULT \'\' ,'
55
	                 . ' `email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
56
	                 . ' `email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
57
	                 . ' `success_message` TEXT NOT NULL DEFAULT \'\' ,'
58
					 . ' `stored_submissions` INT NOT NULL,'
59
					 . ' `max_submissions` INT NOT NULL,'
60
					 . ' `use_captcha` INT NOT NULL,'
61
	                 . ' PRIMARY KEY ( `section_id` ) )'
62
	                 . ' ';
49
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
50
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
51
		. ' `header` TEXT NOT NULL ,'
52
		. ' `field_loop` TEXT NOT NULL ,'
53
		. ' `footer` TEXT NOT NULL ,'
54
		. ' `email_to` TEXT NOT NULL ,'
55
		. ' `email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
56
		. ' `email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
57
		. ' `success_message` TEXT NOT NULL ,'
58
		. ' `stored_submissions` INT NOT NULL DEFAULT \'0\' ,'
59
		. ' `max_submissions` INT NOT NULL DEFAULT \'0\' ,'
60
		. ' `use_captcha` INT NOT NULL DEFAULT \'0\' ,'
61
		. ' PRIMARY KEY ( `section_id` ) '
62
		. ' )';
63 63
	$database->query($mod_form);
64 64
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_submissions`");
65 65
	$mod_form = 'CREATE TABLE `'.TABLE_PREFIX.'mod_form_submissions` ( `submission_id` INT NOT NULL AUTO_INCREMENT,'
66
						  . ' `section_id` INT NOT NULL,'
67
						  . ' `page_id` INT NOT NULL,'
68
						  . ' `submitted_when` INT NOT NULL,'
69
						  . ' `submitted_by` INT NOT NULL,'
70
	                 . ' `body` TEXT NOT NULL DEFAULT \'\' ,'
71
	                 . ' PRIMARY KEY ( `submission_id` ) )'
72
	                 . ' ';
66
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
67
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
68
		. ' `submitted_when` INT NOT NULL DEFAULT \'0\' ,'
69
		. ' `submitted_by` INT NOT NULL DEFAULT \'0\','
70
		. ' `body` TEXT NOT NULL,'
71
		. ' PRIMARY KEY ( `submission_id` ) '
72
		. ' )';
73 73
	$database->query($mod_form);
74 74
		
75 75
	// Insert info into the search table
trunk/wb/modules/code/install.php
28 28
	// Create table
29 29
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_code`");
30 30
	$mod_code = 'CREATE TABLE `'.TABLE_PREFIX.'mod_code` ('
31
						  . ' `section_id` INT NOT NULL,'
32
						  . ' `page_id` INT NOT NULL,'
33
	                 . ' `content` TEXT NOT NULL DEFAULT \'\' ,'
34
	                 . ' PRIMARY KEY ( `section_id` ) )'
35
	                 . ' ';
31
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
32
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
33
		. ' `content` TEXT NOT NULL,'
34
		. ' PRIMARY KEY ( `section_id` )'
35
		. ' )';
36 36
	$database->query($mod_code);
37 37
	
38 38
	// Insert info into the search table
trunk/wb/modules/news/install.php
27 27
	
28 28
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_posts`");
29 29
	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_posts` ( '
30
					 . '`post_id` INT NOT NULL AUTO_INCREMENT,'
31
					 . '`section_id` INT NOT NULL,'
32
					 . '`page_id` INT NOT NULL,'
33
					 . '`group_id` INT NOT NULL,'
34
					 . '`active` INT NOT NULL,'
35
					 . '`position` INT NOT NULL,'
36
					 . '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
37
					 . '`link` TEXT NOT NULL DEFAULT \'\','
38
					 . '`content_short` TEXT NOT NULL DEFAULT \'\','
39
					 . '`content_long` TEXT NOT NULL DEFAULT \'\','
40
					 . '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\','
41
		   	    	 . '`posted_when` INT NOT NULL ,'
42
					 . '`posted_by` INT NOT NULL ,'
43
					 . 'PRIMARY KEY (post_id)'
44
                . ' )';
30
		. '`post_id` INT NOT NULL AUTO_INCREMENT,'
31
		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
32
		. '`page_id` INT NOT NULL DEFAULT \'0\' ,'
33
		. '`group_id` INT NOT NULL DEFAULT \'0\' ,'
34
		. '`active` INT NOT NULL DEFAULT \'0\' ,'
35
		. '`position` INT NOT NULL DEFAULT \'0\','
36
		. '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
37
		. '`link` TEXT NOT NULL ,'
38
		. '`content_short` TEXT NOT NULL ,'
39
		. '`content_long` TEXT NOT NULL ,'
40
		. '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\','
41
		. '`posted_when` INT NOT NULL DEFAULT \'0\' ,'
42
		. '`posted_by` INT NOT NULL DEFAULT \'0\','
43
		. 'PRIMARY KEY (post_id)'
44
		. ' )';
45 45
	$database->query($mod_news);
46 46
	
47 47
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_groups`");
48 48
	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_groups` ( '
49
					 . '`group_id` INT NOT NULL AUTO_INCREMENT,'
50
					 . '`section_id` INT NOT NULL,'
51
					 . '`page_id` INT NOT NULL,'
52
					 . '`active` INT NOT NULL,'
53
					 . '`position` INT NOT NULL,'
54
					 . '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
55
					 . 'PRIMARY KEY (group_id)'
56
                . ' )';
49
		. '`group_id` INT NOT NULL AUTO_INCREMENT,'
50
		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
51
		. '`page_id` INT NOT NULL DEFAULT \'0\','
52
		. '`active` INT NOT NULL DEFAULT \'0\','
53
		. '`position` INT NOT NULL DEFAULT \'0\','
54
		. '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
55
		. 'PRIMARY KEY (group_id)'
56
		. ' )';
57 57
	$database->query($mod_news);
58 58
	
59 59
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_comments`");
60 60
	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_comments` ( '
61
					 . '`comment_id` INT NOT NULL AUTO_INCREMENT,'
62
					 . '`section_id` INT NOT NULL,'
63
					 . '`page_id` INT NOT NULL,'
64
					 . '`post_id` INT NOT NULL,'
65
					 . '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
66
					 . '`comment` TEXT NOT NULL DEFAULT \'\','
67
		   	    . '`commented_when` INT NOT NULL ,'
68
					 . '`commented_by` INT NOT NULL ,'
69
					 . 'PRIMARY KEY (comment_id)'
70
                . ' )';
61
		. '`comment_id` INT NOT NULL AUTO_INCREMENT,'
62
		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
63
		. '`page_id` INT NOT NULL DEFAULT \'0\' ,'
64
		. '`post_id` INT NOT NULL DEFAULT \'0\','
65
		. '`title` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
66
		. '`comment` TEXT NOT NULL ,'
67
		. '`commented_when` INT NOT NULL DEFAULT \'0\' ,'
68
		. '`commented_by` INT NOT NULL DEFAULT \'0\' ,'
69
		. 'PRIMARY KEY (comment_id)'
70
		. ' )';
71 71
	$database->query($mod_news);
72 72
	
73 73
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_settings`");
74 74
	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_settings` ( '
75
					 . '`section_id` INT NOT NULL,'
76
					 . '`page_id` INT NOT NULL,'
77
					 . '`header` TEXT NOT NULL DEFAULT \'\','
78
					 . '`post_loop` TEXT NOT NULL DEFAULT \'\','
79
					 . '`footer` TEXT NOT NULL DEFAULT \'\','
80
					 . '`posts_per_page` INT NOT NULL,'
81
					 . '`post_header` TEXT NOT NULL DEFAULT \'\','
82
					 . '`post_footer` TEXT NOT NULL DEFAULT \'\','
83
					 . '`comments_header` TEXT NOT NULL DEFAULT \'\','
84
					 . '`comments_loop` TEXT NOT NULL DEFAULT \'\','
85
					 . '`comments_footer` TEXT NOT NULL DEFAULT \'\','
86
					 . '`comments_page` TEXT NOT NULL DEFAULT \'\','
87
					 . '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\','
88
					 . '`resize` INT NOT NULL,'
89
					 . ' `use_captcha` INT NOT NULL,'
90
					 . 'PRIMARY KEY (section_id)'
91
                . ' )';
75
		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
76
		. '`page_id` INT NOT NULL DEFAULT \'0\','
77
		. '`header` TEXT NOT NULL ,'
78
		. '`post_loop` TEXT NOT NULL ,'
79
		. '`footer` TEXT NOT NULL ,'
80
		. '`posts_per_page` INT NOT NULL DEFAULT \'0\','
81
		. '`post_header` TEXT NOT NULL ,'
82
		. '`post_footer` TEXT NOT NULL ,'
83
		. '`comments_header` TEXT NOT NULL ,'
84
		. '`comments_loop` TEXT NOT NULL ,'
85
		. '`comments_footer` TEXT NOT NULL ,'
86
		. '`comments_page` TEXT NOT NULL ,'
87
		. '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\' ,'
88
		. '`resize` INT NOT NULL DEFAULT \'0\' ,'
89
		. ' `use_captcha` INT NOT NULL DEFAULT \'0\' ,'
90
		. 'PRIMARY KEY (section_id)'
91
		. ' )';
92 92
	$database->query($mod_news);
93 93
		
94 94
	// Insert info into the search table

Also available in: Unified diff