summaryrefslogtreecommitdiffstats
path: root/config-db/OpenSLX/DBSchema.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-02-09 21:17:10 +0100
committerOliver Tappe2008-02-09 21:17:10 +0100
commit55eba91c566d566b07fccb782ca35e0a829619d5 (patch)
tree04e04c2a7bfbc644ea597415438e8899de18cafa /config-db/OpenSLX/DBSchema.pm
parent* cmdline options are now collected in a hash instead of individual variables, (diff)
downloadcore-55eba91c566d566b07fccb782ca35e0a829619d5.tar.gz
core-55eba91c566d566b07fccb782ca35e0a829619d5.tar.xz
core-55eba91c566d566b07fccb782ca35e0a829619d5.zip
* dropped attribute ramfs_screen as it is no longer needed (splashy does
not need to be given the screen-size) - updating schema version to 0.25 * little code simplification in DBSchema.pm * removed ramfs_screen from all tests * added method removeAttributeByName() to MetaDB in order to be able to remove attributes from the DB in a simple manner git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1528 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/OpenSLX/DBSchema.pm')
-rw-r--r--config-db/OpenSLX/DBSchema.pm36
1 files changed, 14 insertions, 22 deletions
diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm
index 3a0193dd..26d85465 100644
--- a/config-db/OpenSLX/DBSchema.pm
+++ b/config-db/OpenSLX/DBSchema.pm
@@ -35,7 +35,7 @@ use OpenSLX::Basics;
### fk => foreign key (integer)
################################################################################
-my $VERSION = 0.24;
+my $VERSION = 0.25;
my $DbSchema = {
'version' => $VERSION,
@@ -341,9 +341,13 @@ sub _schemaUpgradeDBFrom
my $metaDB = shift;
my $currVersion = shift;
- foreach my $version (sort { $a cmp $b } keys %DbSchemaHistory) {
+ foreach my $version (sort { $a <=> $b } keys %DbSchemaHistory) {
next if $currVersion >= $version;
- $DbSchemaHistory{$version}->($metaDB);
+
+ vlog(0, "upgrading schema version to $version");
+ if ($DbSchemaHistory{$version}->($metaDB)) {
+ $metaDB->schemaSetDBVersion($version);
+ }
}
return 1;
@@ -353,8 +357,6 @@ sub _schemaUpgradeDBFrom
0.2 => sub {
my $metaDB = shift;
- vlog(0, "upgrading schema version to 0.2");
-
# move attributes into separate tables ...
#
# ... system attributes ...
@@ -560,15 +562,11 @@ sub _schemaUpgradeDBFrom
]
);
- $metaDB->schemaSetDBVersion(0.2);
-
return 1;
},
0.21 => sub {
my $metaDB = shift;
- vlog(0, "upgrading schema version to 0.21");
-
# add new table installed_plugins
$metaDB->schemaAddTable(
'installed_plugin',
@@ -579,27 +577,19 @@ sub _schemaUpgradeDBFrom
]
);
- $metaDB->schemaSetDBVersion(0.21);
-
return 1;
},
0.22 => sub {
my $metaDB = shift;
- vlog(0, "upgrading schema version to 0.22");
-
# dummy schema change, just to trigger the attribute synchronization
# into the default system
- $metaDB->schemaSetDBVersion(0.22);
-
return 1;
},
0.23 => sub {
my $metaDB = shift;
- vlog(0, "upgrading schema version to 0.23");
-
# add new column system.descripion
$metaDB->schemaAddColumns(
'system',
@@ -620,15 +610,11 @@ sub _schemaUpgradeDBFrom
]
);
- $metaDB->schemaSetDBVersion(0.23);
-
return 1;
},
0.24 => sub {
my $metaDB = shift;
- vlog(0, "upgrading schema version to 0.24");
-
# split theme::name into theme::splash, theme::displaymanager and
# theme::desktop
foreach my $system ($metaDB->fetchSystemByFilter()) {
@@ -653,7 +639,13 @@ sub _schemaUpgradeDBFrom
}
}
- $metaDB->schemaSetDBVersion(0.24);
+ return 1;
+ },
+ 0.25 => sub {
+ my $metaDB = shift;
+
+ # drop attribute ramfs_screen
+ $metaDB->removeAttributeByName('ramfs_screen');
return 1;
},