Title: [opsview] [5347] Fixed default value for auditlog's username column
- Revision
- 5347
- Author
- tvoon
- Date
- 2010-11-10 14:45:39 +0000 (Wed, 10 Nov 2010)
Log Message
Fixed default value for auditlog's username column
Modified Paths
Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES 2010-11-10 14:25:47 UTC (rev 5346)
+++ trunk/CHANGES 2010-11-10 14:45:39 UTC (rev 5347)
@@ -7,6 +7,7 @@
Fixed servicegroup popup list for service check new page
Fixed systempreferences changes setting configuration status light
Fixed showing welcome page when first logged into Opsview for admin user
+ Fixed default value for auditlog's username column
3.9.1.5340 8th November 2010
FIXES:
Modified: trunk/opsview-core/bin/db_opsview
===================================================================
--- trunk/opsview-core/bin/db_opsview 2010-11-10 14:25:47 UTC (rev 5346)
+++ trunk/opsview-core/bin/db_opsview 2010-11-10 14:45:39 UTC (rev 5347)
@@ -987,7 +987,7 @@
CREATE TABLE auditlogs (
id int AUTO_INCREMENT,
datetime datetime NOT NULL, # Now in UTC
- username varchar(128) NOT NULL, # '' = system generated
+ username varchar(128) NOT NULL DEFAULT '', # '' = system generated
reloadid int, # If set, then this identifies the backup for this reloadid
notice TINYINT DEFAULT 0 NOT NUll, # 0 = not notice, 1 = unread notice, 2 = read notice
text text NOT NULL,
@@ -1094,7 +1094,7 @@
INSERT INTO schema_version (major_release, version) VALUES ('3.5', '4');
INSERT INTO schema_version (major_release, version) VALUES ('3.6', '1');
INSERT INTO schema_version (major_release, version) VALUES ('3.7', '37');
- INSERT INTO schema_version (major_release, version) VALUES ('3.9', '20');
+ INSERT INTO schema_version (major_release, version) VALUES ('3.9', '21');
EOF
Modified: trunk/opsview-core/installer/upgradedb_opsview.pl
===================================================================
--- trunk/opsview-core/installer/upgradedb_opsview.pl 2010-11-10 14:25:47 UTC (rev 5346)
+++ trunk/opsview-core/installer/upgradedb_opsview.pl 2010-11-10 14:45:39 UTC (rev 5347)
@@ -2887,6 +2887,12 @@
$db->updated;
}
+if ( $db->is_lower("3.9.21") ) {
+ $db->print('Fix default value for auditlogs table');
+ $dbh->do('ALTER TABLE auditlogs MODIFY COLUMN username VARCHAR(128) NOT NULL DEFAULT ""');
+ $db->updated;
+}
+
if ( $postupdate->{regenerate_hostgroups_lft_rgt} ) {
require Opsview;
require Opsview::Hostgroup;
Modified: trunk/opsview-core/t/var/opsview.test.db
===================================================================
--- trunk/opsview-core/t/var/opsview.test.db 2010-11-10 14:25:47 UTC (rev 5346)
+++ trunk/opsview-core/t/var/opsview.test.db 2010-11-10 14:45:39 UTC (rev 5347)
@@ -1927,7 +1927,7 @@
INSERT INTO `schema_version` VALUES ('3.5','4');
INSERT INTO `schema_version` VALUES ('3.6','1');
INSERT INTO `schema_version` VALUES ('3.7','37');
-INSERT INTO `schema_version` VALUES ('3.9','20');
+INSERT INTO `schema_version` VALUES ('3.9','21');
/*!40000 ALTER TABLE `schema_version` ENABLE KEYS */;
UNLOCK TABLES;
_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins