From 5232b45240c08c9147e68fbe3abf7011bcbacd3a Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Tue, 24 Nov 2015 16:38:25 -0300 Subject: [PATCH] software-communities: rename tables and types according to new namespaces --- src/noosfero-spb/software_communities/db/migrate/20151124191107_rename_tables_with_plugin_namespace.rb | 13 +++++++++++++ src/noosfero-spb/software_communities/db/migrate/20151124192503_update_namespace_types.rb | 31 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 0 deletions(-) create mode 100644 src/noosfero-spb/software_communities/db/migrate/20151124191107_rename_tables_with_plugin_namespace.rb create mode 100644 src/noosfero-spb/software_communities/db/migrate/20151124192503_update_namespace_types.rb diff --git a/src/noosfero-spb/software_communities/db/migrate/20151124191107_rename_tables_with_plugin_namespace.rb b/src/noosfero-spb/software_communities/db/migrate/20151124191107_rename_tables_with_plugin_namespace.rb new file mode 100644 index 0000000..b40abf4 --- /dev/null +++ b/src/noosfero-spb/software_communities/db/migrate/20151124191107_rename_tables_with_plugin_namespace.rb @@ -0,0 +1,13 @@ +class RenameTablesWithPluginNamespace < ActiveRecord::Migration + def change + rename_table :programming_languages, :software_communities_plugin_programming_languages + rename_table :license_infos, :software_communities_plugin_license_infos + rename_table :software_languages, :software_communities_plugin_software_languages + rename_table :libraries, :software_communities_plugin_libraries + rename_table :database_descriptions, :software_communities_plugin_database_descriptions + rename_table :software_infos, :software_communities_plugin_software_infos + rename_table :operating_systems, :software_communities_plugin_operating_systems + rename_table :operating_system_names, :software_communities_plugin_operating_system_names + rename_table :software_databases, :software_communities_plugin_software_databases + end +end diff --git a/src/noosfero-spb/software_communities/db/migrate/20151124192503_update_namespace_types.rb b/src/noosfero-spb/software_communities/db/migrate/20151124192503_update_namespace_types.rb new file mode 100644 index 0000000..2fbcf58 --- /dev/null +++ b/src/noosfero-spb/software_communities/db/migrate/20151124192503_update_namespace_types.rb @@ -0,0 +1,31 @@ +class UpdateNamespaceTypes < ActiveRecord::Migration + def up + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareHighlightsBlock' WHERE type = 'SoftwareHighlightsBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SearchCatalogBlock' WHERE type = 'SearchCatalogBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::DownloadBlock' WHERE type = 'DownloadBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::StatisticsBlock' WHERE type = 'StatisticsBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::RepositoryBlock' WHERE type = 'RepositoryBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareTabDataBlock' WHERE type = 'SoftwareTabDataBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwaresBlock' WHERE type = 'SoftwaresBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::CategoriesAndTagsBlock' WHERE type = 'CategoriesAndTagsBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::WikiBlock' WHERE type = 'WikiBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareInformationBlock' WHERE type = 'SoftwareInformationBlock'") + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::CategoriesSoftwareBlock' WHERE type = 'CategoriesSoftwareBlock'") + execute("UPDATE tasks SET type = 'SoftwareCommunitiesPlugin::CreateSoftware' WHERE type = 'CreateSoftware'") + end + + def down + execute("UPDATE blocks SET type = 'SoftwareHighlightsBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareHighlightsBlock'") + execute("UPDATE blocks SET type = 'SearchCatalogBlock' WHERE type = 'SoftwareCommunitiesPlugin::SearchCatalogBlock'") + execute("UPDATE blocks SET type = 'DownloadBlock' WHERE type = 'SoftwareCommunitiesPlugin::DownloadBlock'") + execute("UPDATE blocks SET type = 'StatisticsBlock' WHERE type = 'SoftwareCommunitiesPlugin::StatisticsBlock'") + execute("UPDATE blocks SET type = 'RepositoryBlock' WHERE type = 'SoftwareCommunitiesPlugin::RepositoryBlock'") + execute("UPDATE blocks SET type = 'SoftwareTabDataBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareTabDataBlock'") + execute("UPDATE blocks SET type = 'SoftwaresBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwaresBlock'") + execute("UPDATE blocks SET type = 'CategoriesAndTagsBlock' WHERE type = 'SoftwareCommunitiesPlugin::CategoriesAndTagsBlock'") + execute("UPDATE blocks SET type = 'WikiBlock' WHERE type = 'SoftwareCommunitiesPlugin::WikiBlock'") + execute("UPDATE blocks SET type = 'SoftwareInformationBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareInformationBlock'") + execute("UPDATE blocks SET type = 'CategoriesSoftwareBlock' WHERE type = 'SoftwareCommunitiesPlugin::CategoriesSoftwareBlock'") + execute("UPDATE tasks SET type = 'CreateSoftware' WHERE type = 'SoftwareCommunitiesPlugin::CreateSoftware'") + end +end -- libgit2 0.21.2