diff options
Diffstat (limited to 'config-db/OpenSLX/DBSchema.pm')
-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; |