- Status: open --> closed
Script to upgrade your database model from 0.53 to 0.98.
-------------------
-- Delete automatic timestamp update (now done programatically)
ALTER TABLE `articles` CHANGE `SubmitDate` `SubmitDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- Added ParentID and AuthorID columns
ALTER TABLE `articles` ADD `ParentID` INT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `FileID` ,
ADD `AuthorID` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `ParentID` ;
-- Delete Category column (not used anymore)
ALTER TABLE `articles`
DROP `Category`;
-- Rename Keywords column to Keyw
ALTER TABLE `articles` CHANGE `Keywords` `Keyw` VARCHAR( 80 ) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
-- Add RatingTotal y RatedTotal columns
ALTER TABLE `articles` ADD `RatingTotal` VARCHAR( 5 ) NOT NULL DEFAULT '0' AFTER `Views` ,
ADD `RatedTotal` VARCHAR( 5 ) NOT NULL DEFAULT '0' AFTER `RatingTotal` ;
-- Drop not used tables.
DROP TABLE `categories`, `comments`, `links`, `questions`, `rating`, `ratinglist`;
-- Update author with authorID. This is dependant of each install. Some samples included:
UPDATE articles SET AuthorID = 2 where Author = 'imartinez' or Author like '%igo%';
UPDATE articles SET AuthorID = 3 where Author = 'egimenez' or Author = 'dudu' or Author like '%Eduardo%';
UPDATE articles SET AuthorID = 4 where Author = 'irodriguezf' or Author like '%ignacio%';
UPDATE articles SET AuthorID = 5 where Author = 'alamelas' or Author like '%lamelas%' or Author like '%andr%';
---------------------------