Revision 1755
Added by Dietmar about 12 years ago
upgrade-script.php | ||
---|---|---|
632 | 632 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT ''"; |
633 | 633 |
echo "Modify field viewing_users to pages table"; |
634 | 634 |
echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />"); |
635 |
|
|
636 |
/********************************************************** |
|
637 |
* - Remove/add PRIMARY KEY from/to "section_id" from table "mod_wysiwygs" |
|
638 |
*/ |
|
639 |
$sTable = TABLE_PREFIX.'mod_wysiwyg'; |
|
640 |
$field_name = 'wysiwyg_id'; |
|
641 |
if(!$database->field_exists($sTable,$field_name)) { |
|
642 |
echo "Remove PRIMARY KEY from table mod_wysiwygs"; |
|
643 |
$sql = 'ALTER TABLE `'.DB_NAME.'`.`'.$sTable.'` DROP PRIMARY KEY'; |
|
644 |
echo ($database->query($sql) ? " $OK<br />" : " $FAIL!<br />"); |
|
645 |
|
|
646 |
echo "add new PRIMARY KEY to table mod_wysiwygs"; |
|
647 |
$sql = 'ALTER TABLE `'.$sTable.'` ADD `wysiwyg_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST'; |
|
648 |
echo ($database->query($sql) ? " $OK<br />" : " $FAIL!<br />"); |
|
649 |
} |
|
635 | 650 |
} |
636 | 651 |
|
637 | 652 |
/********************************************************** |
Also available in: Unified diff
! update upgrade-script, see Revsion 1735