From d29db98fbe4848d1b29033708b09a7f32658c153 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 29 Oct 2015 16:55:44 -0300 Subject: [PATCH] gov-user: migration to rename models types based on plugin namescope --- src/noosfero-spb/gov_user/db/migrate/20151029193551_update_namespace_types_on_database.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) create mode 100644 src/noosfero-spb/gov_user/db/migrate/20151029193551_update_namespace_types_on_database.rb diff --git a/src/noosfero-spb/gov_user/db/migrate/20151029193551_update_namespace_types_on_database.rb b/src/noosfero-spb/gov_user/db/migrate/20151029193551_update_namespace_types_on_database.rb new file mode 100644 index 0000000..6a5473e --- /dev/null +++ b/src/noosfero-spb/gov_user/db/migrate/20151029193551_update_namespace_types_on_database.rb @@ -0,0 +1,13 @@ +class UpdateNamespaceTypesOnDatabase < ActiveRecord::Migration + def up + execute("UPDATE blocks SET type = 'GovUserPlugin::InstitutionsBlock' WHERE type = 'InstitutionsBlock'") + execute("UPDATE gov_user_plugin_institutions SET type = 'GovUserPlugin::PublicInstitution' WHERE type = 'PublicInstitution'") + execute("UPDATE gov_user_plugin_institutions SET type = 'GovUserPlugin::PrivateInstitution' WHERE type = 'PrivateInstitution'") + end + + def down + execute("UPDATE blocks SET type = 'InstitutionsBlock' WHERE type = 'GovUserPlugin::InstitutionsBlock'") + execute("UPDATE gov_user_plugin_institutions SET type = 'PublicInstitution' WHERE type = 'GovUserPlugin::PublicInstitution'") + execute("UPDATE gov_user_plugin_institutions SET type = 'PrivateInstitution' WHERE type = 'GovUserPlugin::PrivateInstitution'") + end +end -- libgit2 0.21.2