Commit 15901b70bf84218e594037f61c619058afb01ce5
Committed by
Luciano Prestes
1 parent
8b15f709
Exists in
refactor_software_info_to_software
and in
1 other branch
software-communities: rename tables and types according to new namespaces
Showing
2 changed files
with
44 additions
and
0 deletions
Show diff stats
src/noosfero-spb/software_communities/db/migrate/20151124191107_rename_tables_with_plugin_namespace.rb
0 → 100644
... | ... | @@ -0,0 +1,13 @@ |
1 | +class RenameTablesWithPluginNamespace < ActiveRecord::Migration | |
2 | + def change | |
3 | + rename_table :programming_languages, :software_communities_plugin_programming_languages | |
4 | + rename_table :license_infos, :software_communities_plugin_license_infos | |
5 | + rename_table :software_languages, :software_communities_plugin_software_languages | |
6 | + rename_table :libraries, :software_communities_plugin_libraries | |
7 | + rename_table :database_descriptions, :software_communities_plugin_database_descriptions | |
8 | + rename_table :software_infos, :software_communities_plugin_software_infos | |
9 | + rename_table :operating_systems, :software_communities_plugin_operating_systems | |
10 | + rename_table :operating_system_names, :software_communities_plugin_operating_system_names | |
11 | + rename_table :software_databases, :software_communities_plugin_software_databases | |
12 | + end | |
13 | +end | ... | ... |
src/noosfero-spb/software_communities/db/migrate/20151124192503_update_namespace_types.rb
0 → 100644
... | ... | @@ -0,0 +1,31 @@ |
1 | +class UpdateNamespaceTypes < ActiveRecord::Migration | |
2 | + def up | |
3 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareHighlightsBlock' WHERE type = 'SoftwareHighlightsBlock'") | |
4 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SearchCatalogBlock' WHERE type = 'SearchCatalogBlock'") | |
5 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::DownloadBlock' WHERE type = 'DownloadBlock'") | |
6 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::StatisticsBlock' WHERE type = 'StatisticsBlock'") | |
7 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::RepositoryBlock' WHERE type = 'RepositoryBlock'") | |
8 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareTabDataBlock' WHERE type = 'SoftwareTabDataBlock'") | |
9 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwaresBlock' WHERE type = 'SoftwaresBlock'") | |
10 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::CategoriesAndTagsBlock' WHERE type = 'CategoriesAndTagsBlock'") | |
11 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::WikiBlock' WHERE type = 'WikiBlock'") | |
12 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareInformationBlock' WHERE type = 'SoftwareInformationBlock'") | |
13 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::CategoriesSoftwareBlock' WHERE type = 'CategoriesSoftwareBlock'") | |
14 | + execute("UPDATE tasks SET type = 'SoftwareCommunitiesPlugin::CreateSoftware' WHERE type = 'CreateSoftware'") | |
15 | + end | |
16 | + | |
17 | + def down | |
18 | + execute("UPDATE blocks SET type = 'SoftwareHighlightsBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareHighlightsBlock'") | |
19 | + execute("UPDATE blocks SET type = 'SearchCatalogBlock' WHERE type = 'SoftwareCommunitiesPlugin::SearchCatalogBlock'") | |
20 | + execute("UPDATE blocks SET type = 'DownloadBlock' WHERE type = 'SoftwareCommunitiesPlugin::DownloadBlock'") | |
21 | + execute("UPDATE blocks SET type = 'StatisticsBlock' WHERE type = 'SoftwareCommunitiesPlugin::StatisticsBlock'") | |
22 | + execute("UPDATE blocks SET type = 'RepositoryBlock' WHERE type = 'SoftwareCommunitiesPlugin::RepositoryBlock'") | |
23 | + execute("UPDATE blocks SET type = 'SoftwareTabDataBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareTabDataBlock'") | |
24 | + execute("UPDATE blocks SET type = 'SoftwaresBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwaresBlock'") | |
25 | + execute("UPDATE blocks SET type = 'CategoriesAndTagsBlock' WHERE type = 'SoftwareCommunitiesPlugin::CategoriesAndTagsBlock'") | |
26 | + execute("UPDATE blocks SET type = 'WikiBlock' WHERE type = 'SoftwareCommunitiesPlugin::WikiBlock'") | |
27 | + execute("UPDATE blocks SET type = 'SoftwareInformationBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareInformationBlock'") | |
28 | + execute("UPDATE blocks SET type = 'CategoriesSoftwareBlock' WHERE type = 'SoftwareCommunitiesPlugin::CategoriesSoftwareBlock'") | |
29 | + execute("UPDATE tasks SET type = 'CreateSoftware' WHERE type = 'SoftwareCommunitiesPlugin::CreateSoftware'") | |
30 | + end | |
31 | +end | ... | ... |