diff options
author | Oliver Tappe | 2008-02-10 12:45:14 +0100 |
---|---|---|
committer | Oliver Tappe | 2008-02-10 12:45:14 +0100 |
commit | 48e67ba39deb6683593826274aeac02ea2cf6eb9 (patch) | |
tree | f54f4f07cd63007aadf51a5abb47dc86c1cde49a /config-db | |
parent | * fixed incorrect expectation in test (now there are 34 attributes instead (diff) | |
download | core-48e67ba39deb6683593826274aeac02ea2cf6eb9.tar.gz core-48e67ba39deb6683593826274aeac02ea2cf6eb9.tar.xz core-48e67ba39deb6683593826274aeac02ea2cf6eb9.zip |
* added renaming functionality that upgrades exports and systems that follow
the old naming scheme (single colon) to the current one (double colon)
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1530 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db')
-rw-r--r-- | config-db/OpenSLX/DBSchema.pm | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm index 26d85465..b6211c74 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.25; +my $VERSION = 0.26; my $DbSchema = { 'version' => $VERSION, @@ -649,6 +649,29 @@ sub _schemaUpgradeDBFrom return 1; }, + 0.26 => sub { + my $metaDB = shift; + + # rename all exports and systems that contain a single colon to + # the current naming scheme with a double colon + foreach my $system ($metaDB->fetchSystemByFilter()) { + if ($system->{name} =~ m{^([^:]+):([^:]+)$}) { + if ($system->{label} eq $system->{name}) { + $system->{label} = "${1}::${2}"; + } + $system->{name} = "${1}::${2}"; + $metaDB->changeSystem([ $system->{id} ], [ $system ]); + } + } + foreach my $export ($metaDB->fetchExportByFilter()) { + if ($export->{name} =~ m{^([^:]+):([^:]+)$}) { + $export->{name} = "${1}::${2}"; + $metaDB->changeExport([ $export->{id} ], [ $export ]); + } + } + + return 1; + }, ); 1; |