Revision 370
Added by Matthias almost 18 years ago
save.php | ||
---|---|---|
360 | 360 |
|
361 | 361 |
// Pages table |
362 | 362 |
$pages = 'CREATE TABLE `'.TABLE_PREFIX.'pages` ( `page_id` INT NOT NULL auto_increment,' |
363 |
. ' `parent` INT NOT NULL ,' |
|
364 |
. ' `root_parent` INT NOT NULL ,' |
|
365 |
. ' `level` INT NOT NULL ,' |
|
366 |
. ' `link` TEXT NOT NULL DEFAULT \'\' ,'
|
|
363 |
. ' `parent` INT NOT NULL DEFAULT \'0\','
|
|
364 |
. ' `root_parent` INT NOT NULL DEFAULT \'0\','
|
|
365 |
. ' `level` INT NOT NULL DEFAULT \'0\','
|
|
366 |
. ' `link` TEXT NOT NULL,' |
|
367 | 367 |
. ' `target` VARCHAR( 7 ) NOT NULL DEFAULT \'\' ,' |
368 | 368 |
. ' `page_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
369 | 369 |
. ' `menu_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
370 |
. ' `description` TEXT NOT NULL DEFAULT \'\' ,'
|
|
371 |
. ' `keywords` TEXT NOT NULL DEFAULT \'\' ,'
|
|
372 |
. ' `page_trail` TEXT NOT NULL DEFAULT \'\' ,'
|
|
370 |
. ' `description` TEXT NOT NULL ,' |
|
371 |
. ' `keywords` TEXT NOT NULL ,' |
|
372 |
. ' `page_trail` TEXT NOT NULL ,' |
|
373 | 373 |
. ' `template` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
374 | 374 |
. ' `visibility` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
375 |
. ' `position` INT NOT NULL ,' |
|
376 |
. ' `menu` INT NOT NULL ,' |
|
375 |
. ' `position` INT NOT NULL DEFAULT \'0\','
|
|
376 |
. ' `menu` INT NOT NULL DEFAULT \'0\','
|
|
377 | 377 |
. ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,' |
378 |
. ' `searching` INT NOT NULL ,' |
|
379 |
. ' `admin_groups` TEXT NOT NULL DEFAULT \'\' ,'
|
|
380 |
. ' `admin_users` TEXT NOT NULL DEFAULT \'\' ,'
|
|
381 |
. ' `viewing_groups` TEXT NOT NULL DEFAULT \'\' ,'
|
|
382 |
. ' `viewing_users` TEXT NOT NULL DEFAULT \'\' ,'
|
|
383 |
. ' `modified_when` INT NOT NULL ,' |
|
384 |
. ' `modified_by` INT NOT NULL ,' |
|
385 |
. ' PRIMARY KEY ( `page_id` ) )'
|
|
386 |
. ' '; |
|
378 |
. ' `searching` INT NOT NULL DEFAULT \'0\','
|
|
379 |
. ' `admin_groups` TEXT NOT NULL ,' |
|
380 |
. ' `admin_users` TEXT NOT NULL ,' |
|
381 |
. ' `viewing_groups` TEXT NOT NULL ,' |
|
382 |
. ' `viewing_users` TEXT NOT NULL ,' |
|
383 |
. ' `modified_when` INT NOT NULL DEFAULT \'0\','
|
|
384 |
. ' `modified_by` INT NOT NULL DEFAULT \'0\','
|
|
385 |
. ' PRIMARY KEY ( `page_id` ) ' |
|
386 |
. ' )';
|
|
387 | 387 |
$database->query($pages); |
388 | 388 |
|
389 | 389 |
// Sections table |
390 | 390 |
$pages = 'CREATE TABLE `'.TABLE_PREFIX.'sections` ( `section_id` INT NOT NULL auto_increment,' |
391 |
. ' `page_id` INT NOT NULL ,' |
|
392 |
. ' `position` INT NOT NULL ,' |
|
391 |
. ' `page_id` INT NOT NULL DEFAULT \'0\','
|
|
392 |
. ' `position` INT NOT NULL DEFAULT \'0\','
|
|
393 | 393 |
. ' `module` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
394 | 394 |
. ' `block` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
395 |
. ' PRIMARY KEY ( `section_id` ) )'
|
|
396 |
. ' '; |
|
395 |
. ' PRIMARY KEY ( `section_id` ) ' |
|
396 |
. ' )';
|
|
397 | 397 |
$database->query($pages); |
398 | 398 |
|
399 | 399 |
require(WB_PATH.'/admin/interface/version.php'); |
400 | 400 |
|
401 | 401 |
// Settings table |
402 |
$settings="CREATE TABLE `".TABLE_PREFIX."settings` ( `setting_id` INT NOT NULL auto_increment," |
|
403 |
. " `name` VARCHAR( 255 ) NOT NULL DEFAULT '' ," |
|
404 |
. " `value` TEXT NOT NULL DEFAULT '' ," |
|
405 |
. " PRIMARY KEY ( `setting_id` ) )"; |
|
402 |
$settings='CREATE TABLE `'.TABLE_PREFIX.'settings` ( `setting_id` INT NOT NULL auto_increment,' |
|
403 |
. ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
|
404 |
. ' `value` TEXT NOT NULL ,' |
|
405 |
. ' PRIMARY KEY ( `setting_id` ) ' |
|
406 |
. ' )'; |
|
406 | 407 |
$database->query($settings); |
407 | 408 |
|
408 | 409 |
$settings_rows= "INSERT INTO `".TABLE_PREFIX."settings` " |
... | ... | |
451 | 452 |
|
452 | 453 |
// Users table |
453 | 454 |
$users = 'CREATE TABLE `'.TABLE_PREFIX.'users` ( `user_id` INT NOT NULL auto_increment,' |
454 |
. ' `group_id` INT NOT NULL ,' |
|
455 |
. ' `active` INT NOT NULL ,' |
|
455 |
. ' `group_id` INT NOT NULL DEFAULT \'0\','
|
|
456 |
. ' `active` INT NOT NULL DEFAULT \'0\','
|
|
456 | 457 |
. ' `username` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
457 | 458 |
. ' `password` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
458 | 459 |
. ' `remember_key` VARCHAR( 255 ) NOT NULL DEFAULT \'\',' |
459 |
. ' `last_reset` INT NOT NULL DEFAULT 0,'
|
|
460 |
. ' `last_reset` INT NOT NULL DEFAULT \'0\','
|
|
460 | 461 |
. ' `display_name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
461 |
. ' `email` TEXT NOT NULL DEFAULT \'\' ,'
|
|
462 |
. ' `timezone` INT NOT NULL DEFAULT 0,'
|
|
462 |
. ' `email` TEXT NOT NULL ,' |
|
463 |
. ' `timezone` INT NOT NULL DEFAULT \'0\','
|
|
463 | 464 |
. ' `date_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
464 | 465 |
. ' `time_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
465 | 466 |
. ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,' |
466 |
. ' `home_folder` TEXT NOT NULL DEFAULT \'\' ,'
|
|
467 |
. ' `login_when` INT NOT NULL DEFAULT 0,'
|
|
467 |
. ' `home_folder` TEXT NOT NULL ,' |
|
468 |
. ' `login_when` INT NOT NULL DEFAULT \'0\','
|
|
468 | 469 |
. ' `login_ip` VARCHAR( 15 ) NOT NULL DEFAULT \'\' ,' |
469 |
. ' PRIMARY KEY ( `user_id` ) )'
|
|
470 |
. ' '; |
|
470 |
. ' PRIMARY KEY ( `user_id` ) ' |
|
471 |
. ' )';
|
|
471 | 472 |
$database->query($users); |
472 | 473 |
|
473 | 474 |
// Groups table |
474 | 475 |
$groups = 'CREATE TABLE `'.TABLE_PREFIX.'groups` ( `group_id` INT NOT NULL auto_increment,' |
475 | 476 |
. ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
476 |
. ' `system_permissions` TEXT NOT NULL DEFAULT \'\' ,'
|
|
477 |
. ' `module_permissions` TEXT NOT NULL DEFAULT \'\' ,'
|
|
478 |
. ' `template_permissions` TEXT NOT NULL DEFAULT \'\' ,'
|
|
479 |
. ' PRIMARY KEY ( `group_id` ) )'
|
|
480 |
. ' '; |
|
477 |
. ' `system_permissions` TEXT NOT NULL ,' |
|
478 |
. ' `module_permissions` TEXT NOT NULL ,' |
|
479 |
. ' `template_permissions` TEXT NOT NULL ,' |
|
480 |
. ' PRIMARY KEY ( `group_id` ) ' |
|
481 |
. ' )';
|
|
481 | 482 |
$database->query($groups); |
482 | 483 |
|
483 | 484 |
// Search settings table |
484 | 485 |
$search = 'CREATE TABLE `'.TABLE_PREFIX.'search` ( `search_id` INT NOT NULL auto_increment,' |
485 | 486 |
. ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
486 |
. ' `value` TEXT NOT NULL DEFAULT \'\' ,'
|
|
487 |
. ' `extra` TEXT NOT NULL DEFAULT \'\' ,'
|
|
488 |
. ' PRIMARY KEY ( `search_id` ) )'
|
|
489 |
. ' '; |
|
487 |
. ' `value` TEXT NOT NULL ,' |
|
488 |
. ' `extra` TEXT NOT NULL ,' |
|
489 |
. ' PRIMARY KEY ( `search_id` ) ' |
|
490 |
. ' )';
|
|
490 | 491 |
$database->query($search); |
491 | 492 |
|
492 | 493 |
// Addons table |
... | ... | |
495 | 496 |
.'`type` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
496 | 497 |
.'`directory` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
497 | 498 |
.'`name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
498 |
.'`description` TEXT NOT NULL DEFAULT \'\' ,'
|
|
499 |
.'`description` TEXT NOT NULL ,' |
|
499 | 500 |
.'`function` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
500 | 501 |
.'`version` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
501 | 502 |
.'`platform` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
502 | 503 |
.'`author` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
503 | 504 |
.'`license` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,' |
504 |
.' PRIMARY KEY ( `addon_id` ) ) '; |
|
505 |
.' PRIMARY KEY ( `addon_id` ) ' |
|
506 |
.' )'; |
|
505 | 507 |
$database->query($addons); |
506 | 508 |
|
507 | 509 |
// Insert default data |
Also available in: Unified diff
Fixed installer does not insert admin user, added missing default values for INT fields to save.php (#328)