mirror of
https://github.com/CAcertOrg/cats.git
synced 2024-11-03 12:44:03 +00:00
Merge pull request #1 from INOPIAE/bug-1139
bug 1139: Create script for database update
This commit is contained in:
commit
e4b15e52d6
1 changed files with 17 additions and 0 deletions
17
database/update1.sql
Normal file
17
database/update1.sql
Normal file
|
@ -0,0 +1,17 @@
|
|||
--- create new table to record the database version
|
||||
CREATE TABLE IF NOT EXISTS `schema_version` (
|
||||
`id` int(11) PRIMARY KEY auto_increment,
|
||||
`version` int(11) NOT NULL UNIQUE,
|
||||
`when` datetime NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
|
||||
|
||||
--- alter learnprogress by one column
|
||||
ALTER TABLE `learnprogress` ADD `passed` int(11) NOT NULL DEFAULT '0';
|
||||
|
||||
--- update new column passed with -1
|
||||
UPDATE `learnprogress` SET `passed`=-1
|
||||
|
||||
--- update schema version number
|
||||
INSERT INTO `schema_version`
|
||||
(`version`, `when`) VALUES
|
||||
('1' , NOW() );
|
Loading…
Reference in a new issue