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