2014-01-20 23:06:16 +00:00
|
|
|
-- create new table to record the database version
|
2013-01-20 09:24:19 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS `schema_version` (
|
|
|
|
`id` int(11) PRIMARY KEY auto_increment,
|
|
|
|
`version` int(11) NOT NULL UNIQUE,
|
|
|
|
`when` datetime NOT NULL
|
2013-04-06 14:49:51 +00:00
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
2013-01-20 09:24:19 +00:00
|
|
|
|
2014-01-20 23:06:16 +00:00
|
|
|
-- alter learnprogress by one column
|
2013-01-20 09:24:19 +00:00
|
|
|
ALTER TABLE `learnprogress` ADD `passed` int(11) NOT NULL DEFAULT '0';
|
|
|
|
|
2014-01-20 23:06:16 +00:00
|
|
|
-- update new column passed with -1
|
2013-04-06 14:49:51 +00:00
|
|
|
UPDATE `learnprogress` SET `passed`=-1;
|
2013-01-20 09:24:19 +00:00
|
|
|
|
2014-01-20 23:06:16 +00:00
|
|
|
-- update schema version number
|
2013-01-20 09:24:19 +00:00
|
|
|
INSERT INTO `schema_version`
|
|
|
|
(`version`, `when`) VALUES
|
2013-04-06 14:49:51 +00:00
|
|
|
('1' , NOW() );
|