Changeset 539 for trunk/admin/UpdateTrace.php
- Timestamp:
- May 15, 2013, 12:44:32 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/UpdateTrace.php
r537 r539 2542 2542 } 2543 2543 2544 function UpdateTo539($Manager) 2545 { 2546 $Manager->Execute("CREATE TABLE IF NOT EXISTS `UserTrace` ( 2547 `Id` int(11) NOT NULL AUTO_INCREMENT, 2548 `User` int(11) NOT NULL, 2549 `LastLogin` datetime NOT NULL, 2550 `LastLogout` datetime NOT NULL, 2551 `LastIP` varchar(16) NOT NULL, 2552 `UserAgent` varchar(255) NOT NULL, 2553 PRIMARY KEY (`Id`), 2554 KEY `User` (`User`) 2555 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 2556 $Manager->Execute("ALTER TABLE `UserTrace` 2557 ADD CONSTRAINT `UserTrace_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`ID`);"); 2558 $Manager->Execute("INSERT INTO `UserTrace` (". 2559 "SELECT NULL AS `Id` , `User`.`Id` AS `User` , `User`.`LastLogin` AS `LastLogin` , `User`.`LastLogout` AS `LastLogout` , `User`.`LastIP` AS `LastIP` , '' AS `UserAgent` ". 2560 "FROM `User` WHERE 1 ) "); 2561 $Manager->Execute("ALTER TABLE `User` DROP `LastIP`, DROP `LastLogin`, DROP `LastLogout`;"); 2562 } 2563 2544 2564 $Updates = array( 2545 2565 498 => array('Revision' => 506, 'Function' => 'UpdateTo506'), … … 2547 2567 510 => array('Revision' => 524, 'Function' => 'UpdateTo524'), 2548 2568 524 => array('Revision' => 537, 'Function' => 'UpdateTo537'), 2569 537 => array('Revision' => 539, 'Function' => 'UpdateTo539'), 2549 2570 ); 2550 2571
Note:
See TracChangeset
for help on using the changeset viewer.