From eb4db1e78bacbc533b13546ed50d9bb56845353e Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 22 Oct 2013 19:09:54 +0200 Subject: [PATCH] Migrate Ajaxplorer props to Pydio (in share DB entries) --- root/etc/cron.daily/pydio-indexer | 4 ++-- root/etc/e-smith/db/accounts/migrate/Ajaxplorer2Pydio | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 root/etc/e-smith/db/accounts/migrate/Ajaxplorer2Pydio diff --git a/root/etc/cron.daily/pydio-indexer b/root/etc/cron.daily/pydio-indexer index b6dc6da..5e4c8cb 100644 --- a/root/etc/cron.daily/pydio-indexer +++ b/root/etc/cron.daily/pydio-indexer @@ -21,8 +21,8 @@ foreach (0..32){ $id .= $chars[rand @chars]; } foreach my $share ($a->get_all_by_prop(type => 'share')){ - $pydio = $share->prop('Ajaxplorer') || 'disabled'; - $indexer = $share->prop('AjaxplorerIndexer') || 'enabled'; + $pydio = $share->prop('Pydio') || 'disabled'; + $indexer = $share->prop('PydioIndexer') || 'enabled'; next if ($pydio ne 'enabled' || $indexer ne 'enabled'); my $name = $share->key; # Check if the lock file is present and if it's too old (last index crashed ?) diff --git a/root/etc/e-smith/db/accounts/migrate/Ajaxplorer2Pydio b/root/etc/e-smith/db/accounts/migrate/Ajaxplorer2Pydio new file mode 100644 index 0000000..810a265 --- /dev/null +++ b/root/etc/e-smith/db/accounts/migrate/Ajaxplorer2Pydio @@ -0,0 +1,15 @@ +{ +# Rename Ajaxplorer props to Pydio +foreach my $share ($DB->get_all_by_prop(type => 'share')){ + my $ajaxplorer = $DB->get_prop_and_delete($share->key, 'Ajaxplorer'); + next unless defined ($ajaxplorer); + $share->merge_props( + Pydio => $ajaxplorer + ); + my $indexer = $DB->get_prop_and_delete($share->key, 'AjaxplorerIndexer'); + next unless defined ($indexer); + $share->merge_props( + PydioIndexer => $indexer + ); +} +}