From 6e9a7bd1c58b80d6cfcf622a6387deb861ca35d7 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Thu, 1 Jul 2021 16:43:26 -0400 Subject: [PATCH] Remove all migrations up to 20171030131403 (Gaprindashvili) 20171030131403 will become the new collapsed initial migration --- ...30923182042_collapsed_initial_migration.rb | 3714 ----------------- ...044_remove_miq_license_models_and_table.rb | 14 - ..._expand_dialog_field_default_value_size.rb | 29 - ..._registration_http_proxy_password_field.rb | 19 - ...31121211455_change_options_in_miq_alert.rb | 18 - ...20131125153220_import_provision_dialogs.rb | 31 - ...lection_path_in_configurations_settings.rb | 30 - ...1213173452_change_index_on_miq_queue_v2.rb | 26 - ...eplication_on_upgrade_from_version_four.rb | 136 - .../20140106184152_remove_miq_queue_md5.rb | 9 - ..._add_openstack_fields_to_cloud_networks.rb | 7 - ...9_add_openstack_fields_to_cloud_subnets.rb | 7 - ..._split_widget_set_name_to_three_columns.rb | 37 - ...48_add_update_repo_name_to_miq_database.rb | 27 - ...7203449_add_system_to_miq_ae_namespaces.rb | 5 - ...140210175651_create_import_file_uploads.rb | 5 - ...41513_add_priority_to_miq_ae_namespaces.rb | 5 - ...e_firewall_rules_for_neutron_networking.rb | 32 - ...and_user_columns_to_miq_widget_contents.rb | 29 - .../20140228153536_create_cloud_tenants.rb | 14 - ...for_registration_http_proxy_credentials.rb | 48 - ...add_cloud_tenant_ref_to_security_groups.rb | 13 - ..._add_cloud_tenant_ref_to_cloud_networks.rb | 13 - ...40306154541_add_cloud_tenant_ref_to_vms.rb | 13 - ...47_add_cloud_tenant_ref_to_floating_ips.rb | 13 - ..._change_utc_time_profile_type_to_global.rb | 14 - ...collection_depot_settings_to_file_depot.rb | 76 - ...0132430_subclass_file_depot_by_protocol.rb | 34 - ...2_add_hidden_column_to_product_features.rb | 5 - ...0958_create_miq_groups_users_join_table.rb | 38 - ...192753_add_enabled_to_miq_ae_namespaces.rb | 5 - ...120_migrate_automate_to_customer_domain.rb | 65 - ...6_add_validator_to_service_dialog_field.rb | 6 - ...5842_add_reconfigurable_to_dialog_field.rb | 5 - ...159_rename_miq_group_id_column_in_users.rb | 13 - ...30_add_user_current_group_to_miq_groups.rb | 22 - ...520202225_add_file_depot_id_to_log_file.rb | 9 - ...140522201901_add_local_file_to_log_file.rb | 9 - ...hange_options_in_miq_alert_for_email_to.rb | 19 - ..._cloud_volume_and_cloud_volume_snapshot.rb | 47 - ...ntainers_and_cloud_object_store_objects.rb | 24 - .../20140613041358_add_backing_id_to_disks.rb | 15 - ...0620201430_create_cloud_resource_quotas.rb | 20 - ...27175339_add_support_case_to_file_depot.rb | 5 - ..._for_pxe_server_customization_directory.rb | 9 - .../20140821203124_add_vm_raw_power_state.rb | 9 - ...919_add_virtualization_type_to_hardware.rb | 5 - ...140903195524_add_supports_hvm_to_flavor.rb | 6 - ...date_default_registration_channel_names.rb | 12 - ...201058_add_block_storage_only_to_flavor.rb | 5 - ...211826_add_root_device_type_to_hardware.rb | 5 - ...0140917145331_add_vm_publicly_available.rb | 9 - ..._add_template_multi_tenant_relationship.rb | 12 - ...40918140859_add_cloud_tenant_sti_column.rb | 17 - ...ovider_region_to_ext_management_systems.rb | 22 - .../20140922163020_remove_vdi_models.rb | 175 - ...refresh_status_to_ext_management_system.rb | 6 - ...5170920_remove_vdi_tab_from_miq_dialogs.rb | 17 - ...41020195642_create_orchestration_stacks.rb | 70 - ...1103820_remove_miq_search_vdi_instances.rb | 9 - ...0141026111520_remove_black_box_from_vms.rb | 15 - db/migrate/20141029000000_create_providers.rb | 17 - ...029005602_create_configuration_managers.rb | 47 - .../20141029005620_create_computer_systems.rb | 22 - ...1029165319_create_provisioning_managers.rb | 47 - ...2419_add_dynamic_field_to_dialog_fields.rb | 9 - db/migrate/20141121200053_create_endpoints.rb | 13 - ...153_migrate_ems_attributes_to_endpoints.rb | 43 - ...121200523_remove_endpoint_data_from_ems.rb | 13 - ..._init_to_real_columns_for_dialog_fields.rb | 32 - ...010_add_ems_ref_to_cloudformation_stack.rb | 15 - ...7_drop_miq_region_from_database_backups.rb | 11 - ...43_remove_miq_worker_rows_without_model.rb | 12 - .../20150109142457_namespace_ems_classes.rb | 31 - db/migrate/20150111161446_create_nodes.rb | 17 - ...150111161504_create_kubernetes_services.rb | 24 - .../20150128161824_create_container_groups.rb | 21 - ...50128195918_add_manager_error_reporting.rb | 8 - .../20150131104420_remove_miq_proxy_models.rb | 71 - ...0150202212058_fix_indexes_on_ems_events.rb | 19 - ...0202215346_create_container_definitions.rb | 17 - .../20150202215414_create_containers.rb | 17 - ...202215435_create_container_port_configs.rb | 15 - ...ganization_display_name_out_of_reserves.rb | 27 - ...5_create_configured_system_last_checkin.rb | 6 - ...4102026_create_host_hypervisor_hostname.rb | 5 - ...o_memcache_server_opts_in_configuration.rb | 31 - .../20150224192447_add_provider_id_to_ems.rb | 5 - ...16_migrate_configuration_manager_to_ems.rb | 72 - ...816_migrate_provisioning_manager_to_ems.rb | 70 - ...ration_manager_and_provisioning_manager.rb | 33 - ...20150225160000_add_service_systemd_deps.rb | 5 - ...configured_system_organization_location.rb | 44 - ...30_add_draft_to_orchestration_templates.rb | 17 - ...e_rename_ems_ref_to_md5_and_drop_unique.rb | 13 - ...12081342_add_read_only_to_dialog_fields.rb | 5 - ...20150313110200_add_type_to_ems_clusters.rb | 5 - ...e_miq_database_default_update_repo_name.rb | 29 - ...19115040_create_replication_controllers.rb | 18 - ...003436_add_configured_system_attributes.rb | 10 - .../20150323004436_add_locations_parent.rb | 10 - ...172109_add_availability_zone_id_to_host.rb | 6 - ...etirement_requester_to_vms_and_services.rb | 6 - .../20150324143511_add_organization_title.rb | 6 - ...0150324164033_create_configuration_tags.rb | 31 - ...1_add_container_group_node_relationship.rb | 5 - ...ate_container_groups_container_services.rb | 8 - ...0326154800_add_application_install_time.rb | 5 - ...14408_add_file_depot_id_to_miq_schedule.rb | 39 - ..._field_drop_down_list_with_dynamic_flag.rb | 25 - ...tack_related_columns_to_system_services.rb | 7 - ...2115247_add_container_port_config_names.rb | 5 - ...ntainer_node_cross_provider_association.rb | 11 - .../20150402182026_container_metrics.rb | 7 - ...move_port_config_from_container_service.rb | 55 - ...41646_remove_service_id_from_ems_events.rb | 11 - ...5_add_kerberos_to_ext_management_system.rb | 32 - ...d_host_service_group_to_system_services.rb | 6 - ...7_add_host_service_group_to_filesystems.rb | 6 - ...150409145739_create_host_service_groups.rb | 13 - ...0150414094834_create_container_projects.rb | 18 - .../20150414183946_rename_container_id.rb | 5 - ...414201314_update_foreman_raw_attributes.rb | 19 - ...204018_create_container_node_identities.rb | 14 - .../20150415131224_create_container_routes.rb | 21 - .../20150417125852_add_container_events.rb | 9 - ...417162811_update_foreman_derived_values.rb | 11 - ...9_add_retirement_to_orchestration_stack.rb | 10 - ...dd_auto_refresh_fields_to_dialog_fields.rb | 6 - ...50422162729_add_replicator_relationship.rb | 5 - ...150426135513_add_image_id_to_containers.rb | 9 - ...429214648_add_direct_configuration_tags.rb | 22 - ...50501193927_default_provider_verify_ssl.rb | 15 - ..._container_group_ip_to_container_groups.rb | 9 - ...111_add_cloud_subnet_required_to_flavor.rb | 5 - ...nd_cloud_tenant_to_orchestration_stacks.rb | 6 - ...102612_create_container_node_conditions.rb | 17 - ...on_controllers_to_container_replicators.rb | 9 - ...0150519123317_create_container_env_vars.rb | 14 - .../20150521104843_create_container_images.rb | 15 - ...32514_create_container_image_registries.rb | 14 - ...150521204814_add_container_relationship.rb | 5 - ...50522161336_add_container_entities_type.rb | 34 - ...dd_container_node_versions_and_os_image.rb | 8 - ...8113122_add_image_relation_to_container.rb | 13 - ...node_conditions_to_container_conditions.rb | 23 - ...10155632_add_image_to_guest_application.rb | 5 - ...2646_add_container_project_relationship.rb | 12 - ...nge_custom_attribute_value_type_to_text.rb | 9 - ..._interpolated_value_to_custom_attribute.rb | 6 - ...1_fix_serialized_reports_for_rails_four.rb | 162 - db/migrate/20150630025128_create_tenant.rb | 23 - .../20150630100251_namespace_ems_amazon.rb | 31 - .../20150701142710_associate_tenant_vm.rb | 8 - ...50701191241_add_shared_to_cloud_network.rb | 5 - .../20150708120923_create_tenant_resources.rb | 8 - ...081302_create_network_ports_and_routers.rb | 52 - ...sing_fields_and_indexes_to_floating_ips.rb | 14 - ...ng_fields_and_indexes_to_cloud_networks.rb | 12 - ...0150710110244_add_sti_to_cloud_networks.rb | 5 - ...ing_fields_and_indexes_to_cloud_subnets.rb | 13 - ...20150710110708_add_sti_to_cloud_subnets.rb | 5 - ...g_fields_and_indexes_to_security_groups.rb | 8 - .../20150714042229_add_routes_to_services.rb | 6 - .../20150714053019_namespace_ems_redhat.rb | 26 - ...143821_remove_ui_tasks_and_ui_task_sets.rb | 40 - .../20150716021334_fix_redhat_namespace.rb | 30 - .../20150719123908_add_container_state.rb | 17 - .../20150724030353_namespace_ems_foreman.rb | 20 - ...move_container_group_id_from_containers.rb | 5 - ...0150730135121_add_container_group_phase.rb | 7 - .../20150731025210_namespace_ems_openstack.rb | 47 - ...0150804194147_create_blacklisted_events.rb | 12 - ...miq_event_table_to_miq_event_definition.rb | 43 - ..._rename_columns_starting_with_miq_event.rb | 7 - ...e_filtered_events_to_blacklisted_events.rb | 68 - ..._rename_ems_event_table_to_event_stream.rb | 42 - .../20150807165254_namespace_ems_container.rb | 24 - .../20150810015500_add_tenant_hierarchy.rb | 6 - ...3115025_create_container_resource_quota.rb | 20 - ...150814210507_rename_tenant_company_name.rb | 5 - .../20150815051916_namespace_ems_microsoft.rb | 16 - ...0150815052719_fix_foreman_provider_type.rb | 11 - .../20150817213409_clear_tenant_seed.rb | 9 - ...20150818181426_add_divisible_to_tenants.rb | 5 - ...pdate_tenant_divisible_on_existing_rows.rb | 9 - .../20150818184658_create_tenant_quota.rb | 13 - .../20150819121823_drop_tenant_resources.rb | 12 - .../20150819125202_add_tenant_description.rb | 5 - ...50819144149_add_container_entity_events.rb | 6 - ...150819154348_drop_tenant_appliance_name.rb | 9 - ...0820110215_create_container_limit_range.rb | 23 - .../20150822102141_fix_more_foreman_types.rb | 12 - ...e_ems_openstack_availability_zones_null.rb | 18 - ...0824120000_add_tenant_override_settings.rb | 8 - ...4130000_update_tenant_override_settings.rb | 12 - ...150825120000_add_service_catalog_tenant.rb | 9 - ...0000_add_tenant_id_to_miq_ae_namespaces.rb | 8 - .../20150831123700_rename_tenant_owner_id.rb | 8 - ..._add_container_node_max_container_group.rb | 5 - db/migrate/20150903162623_assign_tenant.rb | 46 - ...51_add_scan_columns_to_container_images.rb | 6 - ...20150904181202_miq_groups_add_ldap_role.rb | 17 - .../20150906123643_create_security_context.rb | 11 - ..._container_definition_security_contexts.rb | 9 - db/migrate/20150906234626_add_service_type.rb | 5 - db/migrate/20150906234635_add_node_port.rb | 5 - ...150907095639_add_container_image_digest.rb | 22 - ...20150907120454_create_container_volumes.rb | 36 - ...0150907163347_confirm_all_class_renames.rb | 135 - .../20150907234623_add_container_command.rb | 5 - .../20150909023532_namespace_ems_azure.rb | 17 - ...3517_add_full_name_to_custom_attributes.rb | 5 - ...20150911152048_add_disk_info_to_flavors.rb | 6 - ..._correct_user_created_role_feature_sets.rb | 38 - .../20150914203523_add_warn_value_to.rb | 5 - ...0915000737_add_tenant_id_to_miq_request.rb | 7 - ...0915001329_assign_tenant_to_miq_request.rb | 62 - ..._vmware_ro_datastores_to_hosts_storages.rb | 37 - ...523_enhance_flavors_for_cloud_disk_info.rb | 8 - ...150930083543_add_status_to_floating_ips.rb | 5 - ...change_cloud_tenant_description_to_text.rb | 9 - ...d_resource_group_to_orchestration_stack.rb | 5 - .../20151001193521_rename_hardware_columns.rb | 8 - ...ge_device_id_to_bigint_in_network_ports.rb | 9 - ...3_create_chargeback_rate_detail_measure.rb | 12 - ...d_measure_ref_to_chargeback_rate_detail.rb | 5 - ...reate_chargeback_rate_detail_currencies.rb | 13 - ...007_create_container_component_statuses.rb | 16 - ...urrencies_ref_to_chargeback_rate_detail.rb | 5 - ...18090641_create_persistent_volume_claim.rb | 17 - .../20151019184531_create_resource_groups.rb | 15 - .../20151019194111_tenant_cfg_not_nil.rb | 9 - ...ting_fields_to_metric_and_metric_rollup.rb | 10 - ...4_set_correct_sti_type_on_cloud_network.rb | 38 - ...31_set_correct_sti_type_on_cloud_subnet.rb | 26 - ...persistent_volumes_to_container_volumes.rb | 39 - ...1021143818_add_replicator_entity_events.rb | 6 - ...1021151216_add_resource_group_id_to_vms.rb | 9 - ...20151021174044_add_tenant_default_group.rb | 8 - ...51021174140_assign_tenant_default_group.rb | 44 - ...move_license_required_from_server_roles.rb | 9 - ...0151026170631_set_miq_groups_group_type.rb | 17 - db/migrate/20151026220722_assign_vm_group.rb | 30 - .../20151030201919_fix_miq_group_sequences.rb | 15 - .../20151104115400_create_chargeback_tiers.rb | 11 - ...1104120951_transfer_rate_value_to_tiers.rb | 21 - ...33_add_project_to_ext_management_system.rb | 5 - ...9_add_service_account_to_authentication.rb | 5 - .../20151111165020_rename_miq_search_db.rb | 18 - ...202643_update_default_update_repo_names.rb | 28 - ...ti_type_on_openstack_infra_miq_template.rb | 25 - ...0151125155213_create_middleware_servers.rb | 17 - ...rect_sti_type_on_openstack_cloud_volume.rb | 25 - ...fix_host_storage_replication_on_upgrade.rb | 17 - ...209141840_create_middleware_deployments.rb | 13 - ...ner_image_registry_to_container_service.rb | 5 - .../20151216095054_create_container_builds.rb | 49 - .../20151221134925_remove_sat5_repo_config.rb | 32 - ...51222103510_add_verify_ssl_to_endpoints.rb | 5 - ...igrate_provider_attributes_to_endpoints.rb | 44 - ...5242_remove_endpoint_data_from_provider.rb | 9 - ...discover_row_from_miq_event_definitions.rb | 14 - ...05170524_remove_miq_worker_command_line.rb | 9 - ...rkers_miq_servers_proportional_set_size.rb | 6 - ...4053_add_claim_ref_to_container_volumes.rb | 7 - ...0_add_network_router_id_to_cloud_subnet.rb | 5 - ...ete_network_router_id_from_floating_ips.rb | 11 - ...ete_cloud_network_id_from_network_ports.rb | 11 - ...chargeback_rate_detail_currency_not_nil.rb | 20 - ...licated_rows_from_newly_excluded_tables.rb | 25 - ...0_add_created_on_for_container_entities.rb | 44 - .../20160120151045_add_url_to_endpoints.rb | 5 - ..._migrate_url_from_provider_to_endpoints.rb | 46 - ...add_disk_and_memory_minimum_to_hardware.rb | 6 - ...0622_migrate_old_configuration_settings.rb | 120 - ...127210623_create_settings_changes_table.rb | 16 - ...vert_configurations_to_settings_changes.rb | 92 - .../20160127210625_remove_configurations.rb | 16 - ...60127210705_create_configuration_script.rb | 14 - .../20160202200713_create_generic_object.rb | 17 - ...dd_orderable_to_orchestration_templates.rb | 17 - ...deletion_time_for_container_archivables.rb | 10 - .../20160209124055_create_service_orders.rb | 14 - ...130938_add_service_order_to_miq_request.rb | 5 - .../20160211113430_create_cloud_databases.rb | 39 - db/migrate/20160214115800_inline_ems_id.rb | 47 - .../20160219190002_add_type_to_ems_folders.rb | 5 - ...220123313_add_open_scap_result_entities.rb | 16 - ..._parent_ems_id_to_ext_management_system.rb | 7 - ...416_add_stat_containergroup_create_rate.rb | 6 - ...0160224224115_remove_filters_from_users.rb | 5 - ...ce_id_and_resource_type_from_miq_groups.rb | 6 - ...rk_manager_from_openstack_cloud_manager.rb | 88 - ...60226164206_remove_guid_from_miq_groups.rb | 5 - ...rate_column_from_chargeback_rate_detail.rb | 5 - ...d_survey_specs_to_configuration_scripts.rb | 5 - ...22_remove_is_datacenter_from_ems_folder.rb | 24 - ...ory_root_group_id_to_configured_systems.rb | 5 - ...60303115326_add_websocket_to_miq_server.rb | 5 - ...816_fix_event_class_for_evm_alert_event.rb | 45 - ...3819_add_security_protocol_to_endpoints.rb | 5 - ...security_protocol_atribute_to_endpoints.rb | 39 - ...93935_remove_security_protocol_from_ems.rb | 9 - ...4_add_cloud_subnets_network_ports_table.rb | 11 - ...ubnet_id_to_network_ports_cloud_subnets.rb | 35 - ...emove_cloud_subnet_id_from_network_port.rb | 10 - .../20160309144534_create_system_consoles.rb | 19 - ...60309223941_add_process_to_miq_requests.rb | 16 - .../20160310170333_add_service_ancestry.rb | 38 - .../20160311155237_create_entitlements.rb | 10 - .../20160311222150_create_git_repositories.rb | 12 - ...152_add_commit_sha_to_miq_ae_namespaces.rb | 11 - .../20160317041206_add_maintenance_to_host.rb | 10 - ...7160230_move_user_roles_to_entitlements.rb | 16 - ...add_old_projectid_to_container_projects.rb | 5 - ...15_remove_miq_user_role_from_miq_groups.rb | 28 - .../20160318133352_add_deprecated_to_vms.rb | 5 - ...322141934_create_join_table_host_switch.rb | 8 - ...ld_ems_id_to_containers_and_definitions.rb | 6 - ...322195653_move_switch_host_to_jointable.rb | 23 - ...160322205357_remove_host_id_from_switch.rb | 31 - ...pe_and_ems_id_on_openstack_cloud_subnet.rb | 46 - ...twork_manager_from_amazon_cloud_manager.rb | 70 - ..._type_and_ems_id_on_amazon_cloud_subnet.rb | 36 - ...0160324131349_add_hidden_to_ems_folders.rb | 17 - ...0324174132_create_container_deployments.rb | 18 - ...74218_create_container_deployment_nodes.rb | 15 - ...ve_miq_server_product_update_join_table.rb | 37 - ...tual_instance_ref_to_configured_systems.rb | 5 - ...add_switch_uuid_and_is_shared_to_switch.rb | 6 - ...38_add_registered_on_to_container_image.rb | 5 - ...age_registration_rate_to_metric_rollups.rb | 5 - ...d_subscription_to_ext_management_system.rb | 9 - ...hange_container_group_metric_field_name.rb | 6 - .../20160405143543_create_git_references.rb | 14 - ...onfigurations_from_replication_excludes.rb | 25 - ...etwork_manager_from_azure_cloud_manager.rb | 69 - ...i_type_and_ems_id_on_azure_cloud_subnet.rb | 36 - ...anager_association_to_configured_system.rb | 5 - ...95810_add_id_primary_key_to_join_tables.rb | 68 - .../20160408154738_drop_url_from_providers.rb | 5 - ..._group_relation_to_configuration_script.rb | 5 - ...51_add_api_version_adn_path_to_endpoint.rb | 6 - ...orrect_sti_type_on_cloud_resource_quota.rb | 18 - ...20160413202128_sti_configuration_script.rb | 17 - ...capacity_to_hash_from_persistent_volume.rb | 43 - ...708_create_container_label_tag_mappings.rb | 12 - ...rename_configuration_manager_to_manager.rb | 7 - .../20160415121724_create_cloud_services.rb | 20 - ...0160417105237_add_read_only_to_policies.rb | 6 - ...160418141210_add_read_only_to_miq_alert.rb | 29 - ...109_add_middleware_server_event_streams.rb | 8 - ...thentication_options_to_authentications.rb | 33 - .../20160424124613_create_network_groups.rb | 17 - ...add_network_group_id_to_security_groups.rb | 7 - ...0_add_network_group_id_to_cloud_subnets.rb | 7 - ..._add_network_group_id_to_network_router.rb | 7 - ...parent_cloud_subnet_id_to_cloud_subnets.rb | 7 - ...rgeback_to_chargeback_vm_on_miq_reports.rb | 27 - ...eleted_tables_from_replication_settings.rb | 19 - ...161235_correct_sti_type_on_cloud_tenant.rb | 15 - ...1456_update_default_yum_repo_name_for56.rb | 27 - ...425161822_create_middleware_datasources.rb | 14 - ...60428215808_add_filters_to_entitlements.rb | 16 - ...0428215825_move_filters_to_entitlements.rb | 36 - ...28215838_remove_filters_from_miq_groups.rb | 8 - ..._and_ems_ref_to_orchestration_templates.rb | 8 - ...740_remove_ruby_rep_tables_and_triggers.rb | 40 - ...10_remove_database_synchronization_role.rb | 26 - ...41857_change_exclude_table_settings_key.rb | 18 - ...24506_add_lives_on_to_middleware_server.rb | 5 - .../20160621023902_create_host_aggregate.rb | 13 - ...160621025312_create_host_aggregate_host.rb | 10 - ...twork_manager_from_google_cloud_manager.rb | 69 - ...ix_lives_on_index_on_middleware_servers.rb | 6 - ...counterpart_index_on_configured_systems.rb | 6 - ...0628124806_add_visible_to_dialog_fields.rb | 5 - ...60628140841_fix_service_order_placed_at.rb | 9 - ...0628165030_create_middleware_messagings.rb | 16 - ...0701134322_add_ems_ref_to_host_storages.rb | 5 - ...205641_add_properties_to_generic_object.rb | 5 - ...46_add_status_to_middleware_deployments.rb | 5 - ...4_add_blueprint_id_to_service_templates.rb | 5 - .../20160708140611_create_blueprints.rb | 15 - ...2331_remove_replication_worker_settings.rb | 11 - ...t_replication_columns_from_miq_database.rb | 6 - .../20160712043931_create_storage_profiles.rb | 12 - ...eate_join_table_storage_profile_storage.rb | 10 - ...60712144219_create_arbitration_defaults.rb | 15 - ...emplate_and_vms_filters_from_miq_search.rb | 17 - ...1244_upgrade_host_storage_from_reserved.rb | 23 - ...ration_defaults_to_arbitration_profiles.rb | 15 - ...714210238_add_storage_profile_id_to_vms.rb | 5 - ...4210434_add_storage_profile_id_to_disks.rb | 5 - ...60715155054_create_arbitration_settings.rb | 11 - ...60719080735_add_parent_to_cloud_tenants.rb | 5 - .../20160719151049_add_bootable_to_disks.rb | 5 - ...0160720085321_create_container_template.rb | 27 - ...20160720151217_create_arbitration_rules.rb | 14 - ...0160721173414_create_middleware_domains.rb | 16 - ...5175531_create_middleware_server_groups.rb | 16 - ...d_server_group_id_to_middleware_servers.rb | 5 - ..._middleware_deployments_and_datasources.rb | 6 - ...dd_properties_to_middleware_deployments.rb | 5 - ...e_system_add_source_to_miq_ae_namespace.rb | 35 - ...1170547_add_type_to_arbitration_profile.rb | 6 - ...add_generic_subtype_to_service_template.rb | 6 - ...set_generic_subtype_on_service_template.rb | 15 - .../20160805084714_create_load_balancers.rb | 16 - ...05104342_create_load_balancer_listeners.rb | 23 - ...160805123339_create_load_balancer_pools.rb | 18 - ...4120_create_load_balancer_health_checks.rb | 24 - ...419_create_load_balancer_listener_pools.rb | 14 - ...41502_create_load_balancer_pool_members.rb | 18 - ...eate_load_balancer_health_check_members.rb | 12 - ...metrics_status_to_ext_management_system.rb | 7 - ...add_vm_id_to_load_balancer_pool_members.rb | 6 - ...rk_port_id_from_load_balancer_listeners.rb | 14 - ...n_to_load_balancer_health_check_members.rb | 6 - ...ancer_id_to_load_balancer_health_checks.rb | 6 - ...8_add_sti_types_to_load_balancer_models.rb | 9 - ..._create_load_balancer_pool_member_pools.rb | 13 - ...dd_ems_id_to_load_balancer_pool_members.rb | 6 - ...alancer_m_to_n_tables_indexes_to_unique.rb | 21 - .../20160811081235_add_source_to_tenants.rb | 5 - ...60811180711_create_cloud_volume_backups.rb | 21 - ...0160817104523_create_notification_types.rb | 12 - .../20160817120209_create_notifications.rb | 12 - ...17121951_create_notification_recipients.rb | 9 - ...40_add_flavor_multi_tenant_relationship.rb | 10 - ...070810_fix_null_verify_ssl_on_endpoints.rb | 21 - ...5949_remove_name_from_arbitration_rules.rb | 9 - ...0160825152940_fix_port_zero_on_enpoints.rb | 16 - .../20160825203056_add_state_to_hardware.rb | 6 - ...fication_tables_to_replication_excludes.rb | 29 - ...34746_remove_atomic_container_providers.rb | 53 - ...1_add_retirement_cols_to_load_balancers.rb | 10 - ...loud_subnets_network_ports_unique_index.rb | 15 - ...d_port_ranges_to_load_balancer_listener.rb | 8 - ...o_port_ranges_in_load_balancer_listener.rb | 36 - ...42_drop_ports_in_load_balancer_listener.rb | 6 - ...dd_value_serialized_to_custom_attribute.rb | 19 - ...912160750_change_retires_on_to_datetime.rb | 15 - ...60912183918_add_source_to_network_ports.rb | 5 - ...ove_repo_data_from_database_to_settings.rb | 43 - ...ove_update_repo_name_from_miq_databases.rb | 5 - ...1_add_openshift_data_to_container_image.rb | 16 - ...disconnection_fields_to_container_image.rb | 6 - ...pping_enabled_to_ext_management_systems.rb | 5 - db/migrate/20160915160517_create_shares.rb | 16 - ...160915173610_create_service_connections.rb | 12 - ...20160915173740_add_blueprint_to_dialogs.rb | 5 - ...0_add_timestamps_to_arbitration_profile.rb | 5 - ...19115131_add_details_to_system_consoles.rb | 7 - ...op_level_namespace_to_miq_ae_namespaces.rb | 5 - ...0921072726_add_options_to_notifications.rb | 5 - ...22090347_remove_field_region_from_users.rb | 9 - ...rules_arbitration_profile_id_to_big_int.rb | 9 - ...e_notifications_foreign_key_constraints.rb | 6 - ...tion_recipients_foreign_key_constraints.rb | 6 - ...ange_cloud_volume_backup_size_to_bigint.rb | 9 - ...m_and_swap_free_and_used_to_miq_servers.rb | 8 - .../20160922235000_create_ancestry_indexes.rb | 8 - ...move_replication_excludes_from_settings.rb | 13 - .../20161010184005_create_physical_servers.rb | 12 - ...24173542_add_cpu_memory_hot_plug_to_vms.rb | 9 - ...rename_ems_events_purging_settings_keys.rb | 28 - ...22_add_missing_fields_to_alert_statuses.rb | 9 - ...1113091851_add_miq_alert_status_actions.rb | 12 - ...552_add_generating_ems_to_event_streams.rb | 5 - ...rver_group_id_to_middleware_deployments.rb | 5 - ...161213140739_remove_remote_api_settings.rb | 13 - ...20170109101053_create_chargeable_fields.rb | 11 - ...rgeable_field_to_chargeback_rate_detail.rb | 5 - ...011_extract_field_data_from_rate_detail.rb | 39 - ...70109190411_make_job_belong_to_miq_task.rb | 5 - ...226_create_configuration_script_sources.rb | 11 - ...70110090935_add_ems_to_miq_alert_status.rb | 5 - ..._script_source_to_configuration_scripts.rb | 6 - ...15140217_update_ems_in_miq_alert_status.rb | 16 - ...0702_add_manager_ref_to_authentications.rb | 5 - ...9_add_certificate_authority_to_endpoint.rb | 5 - ...figuration_template_to_resource_actions.rb | 6 - ...uthentication_configuration_script_base.rb | 9 - ...e_of_message_on_miq_tasks_table_to_text.rb | 9 - ...4842_add_started_on_column_to_miq_tasks.rb | 6 - ...sk_for_each_job_and_transfer_attributes.rb | 55 - ...125141153_add_message_to_alert_statuses.rb | 5 - ..._update_description_in_miq_alert_status.rb | 19 - ..._manager_sti_type_to_automation_manager.rb | 85 - ..._manager_settings_to_automation_manager.rb | 45 - ...tributes_to_configuration_script_source.rb | 11 - ...52_add_options_column_to_authentication.rb | 5 - ...et_service_display_and_retired_to_false.rb | 14 - ...sti_type_to_configuration_script_source.rb | 5 - ...0170207215322_fix_vpor_time_profile_ids.rb | 44 - ...n_manager_inventory_root_group_sti_type.rb | 21 - ...ancements_for_ansible_service_provision.rb | 9 - ...join_authentication_orchestration_stack.rb | 9 - ...dd_name_to_cloud_object_store_container.rb | 5 - ...ealth_state_property_to_physical_server.rb | 5 - ...dd_type_to_cloud_object_store_container.rb | 6 - ...ower_job_sti_type_to_automation_manager.rb | 21 - ..._times_to_orchestration_stack_resources.rb | 6 - ...power_state_property_to_physical_server.rb | 5 - ...4936_add_properties_to_physical_servers.rb | 11 - ...emove_central_admin_region_auth_records.rb | 9 - ...17_remove_openshift_enterprise_provider.rb | 42 - db/migrate/20170222192610_create_firmwares.rb | 14 - ...20170222214902_add_initiator_to_service.rb | 16 - ...1_add_name_to_cloud_object_store_object.rb | 5 - ...1_add_type_to_cloud_object_store_object.rb | 6 - ...3180033_add_physical_server_id_to_hosts.rb | 5 - ...03192951_remove_field_archive_form_jobs.rb | 5 - ...70303213837_remove_field_code_from_jobs.rb | 5 - ...33_migrate_configuration_script_to_base.rb | 20 - .../20170309111313_add_resolved_to_alerts.rb | 5 - .../20170309125642_add_alert_ems_ref.rb | 6 - ..._add_raw_power_state_to_physical_server.rb | 5 - ...70313160354_remove_ancestry_from_alerts.rb | 6 - db/migrate/20170313170754_add_mas_assignee.rb | 5 - .../20170315082311_update_o_virt_api_path.rb | 32 - ...6_update_persistent_volumes_parent_type.rb | 15 - ...0316200500_remove_agent_state_from_jobs.rb | 5 - ...0317134007_remove_agent_class_from_jobs.rb | 5 - ...agent_id_to_miq_server_id_in_jobs_table.rb | 17 - ..._remove_oid_integer_args_from_miq_queue.rb | 8 - ...d_status_to_configuration_script_source.rb | 5 - ..._add_vendor_property_to_physical_server.rb | 5 - ...6_fix_expression_in_tenant_quota_report.rb | 24 - ...e_event_streams_index_availability_zone.rb | 5 - ...5_add_loc_led_state_to_physical_servers.rb | 5 - ...405192333_delete_miq_replication_worker.rb | 9 - ...20170409083720_add_enabled_field_to_ems.rb | 13 - ..._add_iops_and_encrypted_to_cloud_volume.rb | 6 - ...4_copy_server_id_from_jobs_to_miq_tasks.rb | 21 - ...7185038_remove_process_column_from_jobs.rb | 5 - .../20170418141731_drop_arbitration_tables.rb | 40 - ...137_remove_deleted_migration_timestamps.rb | 9 - .../20170420124055_update_policy_seed.rb | 13 - ...0_add_embedded_methods_to_miq_ae_method.rb | 13 - .../20170425154145_add_sti_to_middlewares.rb | 83 - .../20170425185231_create_asset_details.rb | 16 - ...52006_remove_invalid_hawkular_endpoints.rb | 83 - ...70509224500_remove_agent_name_from_jobs.rb | 5 - ...0170509230548_remove_agent_id_from_jobs.rb | 5 - ...ing_to_start_state_to_queuedin_miq_task.rb | 23 - ...emove_container_group_failed_sync_event.rb | 19 - ...170512233333_drop_miq_server_rhn_mirror.rb | 48 - db/migrate/20170516230854_cockpit_ws.rb | 5 - ..._add_physical_server_id_to_event_parser.rb | 5 - ...9003257_remove_cim_ontap_storage_tables.rb | 662 --- .../20170519153350_add_showback_models.rb | 64 - ...20170519173044_remove_cim_ontap_records.rb | 136 - ...173850_add_guest_device_id_to_firmwares.rb | 6 - ...2055_add_limits_resources_to_containers.rb | 8 - ...d_manufacturer_and_fru_to_guest_devices.rb | 8 - ..._disconnection_fields_to_container_node.rb | 6 - ..._add_encrypted_to_cloud_volume_snapshot.rb | 5 - ...170613144708_add_sti_to_container_image.rb | 6 - ...14_add_options_to_ext_management_system.rb | 53 - ...9170148_remove_mirrored_logger_settings.rb | 10 - .../20170621204151_drop_miq_queue_for_user.rb | 11 - ...70622181340_change_showback_column_name.rb | 6 - ...0622210452_create_miq_queues_work_label.rb | 5 - ...0627135623_update_container_image_types.rb | 12 - ...094235_add_hash_expression_to_miq_alert.rb | 30 - ...deleted_on_indexes_to_containers_tables.rb | 10 - ...536_use_deleted_on_in_containers_tables.rb | 58 - ...dd_object_labels_to_container_templates.rb | 5 - ...706220336_add_sti_to_container_template.rb | 5 - ...7150520_update_container_template_types.rb | 11 - ...5809_add_stored_data_to_showback_charge.rb | 5 - ..._add_columns_unit_time_to_showback_rate.rb | 12 - ...149_remove_ems_ref_from_container_image.rb | 5 - ...132935_convert_custom_button_to_classes.rb | 144 - ...rename_applies_to_visibility_expression.rb | 5 - ...enablement_expression_and_disabled_text.rb | 6 - ..._create_dialog_field_associations_table.rb | 8 - ...084208_add_resource_to_open_scap_result.rb | 6 - ...nify_container_definition_and_container.rb | 186 - ...15_create_middleware_diagnostic_reports.rb | 12 - ...28223124_add_expression_to_entitlements.rb | 5 - ...170804184133_create_automate_workspaces.rb | 11 - .../20170809191203_metrics_sequences.rb | 29 - ...1_update_type_of_orchestration_template.rb | 45 - ..._container_quota_items_columns_to_float.rb | 64 - ...20132_migrate_database_role_in_settings.rb | 16 - ..._project_id_to_persistent_volume_claims.rb | 5 - ...05210626_create_configuration_templates.rb | 12 - ...908130834_add_serial_number_to_hardware.rb | 5 - db/migrate/20170914082040_showback_tiers.rb | 63 - .../20170918190738_issue_showback_tiers.rb | 13 - .../20170919211256_add_parent_id_to_lans.rb | 5 - db/migrate/20170919211745_create_subnets.rb | 11 - ...920212535_add_event_id_to_event_streams.rb | 5 - ...g_field_description_from_string_to_text.rb | 9 - ..._to_manager_id_in_customization_scripts.rb | 5 - ...pattern_fields_to_customization_scripts.rb | 7 - ...170922212510_add_severity_to_miq_alerts.rb | 5 - ..._and_limits_to_persistent_volume_claims.rb | 6 - .../20170925155201_create_scan_result.rb | 10 - ...14802_drop_container_component_statuses.rb | 16 - ...ld_associations_to_use_new_relationship.rb | 76 - ...te_middleware_server_to_wildfly_and_eap.rb | 34 - ...dd_userid_groupid_tenantid_to_miq_queue.rb | 7 - ..._add_middleware_domain_to_event_streams.rb | 6 - ...46_remove_configuration_templates_table.rb | 12 - ...80000_move_openstack_refresher_settings.rb | 13 - ...dd_sub_metric_to_chargeback_rate_detail.rb | 5 - ...20171016192352_add_user_to_event_stream.rb | 7 - .../20171018081206_showback_fix_and_rename.rb | 27 - .../20171023170841_ensure_cloud_managers.rb | 27 - ...1024144122_add_options_to_miq_ae_method.rb | 5 - ...025122732_move_ems_refresh_args_to_data.rb | 36 - ...6103833_add_cores_allocated_rate_detail.rb | 44 - ...deleted_on_to_container_quota_and_items.rb | 35 - ...026142653_create_container_quota_scopes.rb | 10 - db/migrate/20171026152944_drop_blueprints.rb | 24 - .../20171026190133_add_mtu_to_switches.rb | 5 - ...03_fix_hawkular_endpoints_with_port_nil.rb | 25 - .../broker_notify_properties.tmpl.yml | 38 - .../capacity.tmpl.yml | 17 - .../event_handling.tmpl.yml | 758 ---- .../storage.tmpl.yml | 18 - .../vmdb.tmpl.yml | 601 --- ...nd_dialog_field_default_value_size_spec.rb | 59 - ...stration_http_proxy_password_field_spec.rb | 36 - ...211455_change_options_in_miq_alert_spec.rb | 27 - ...125153220_import_provision_dialogs_spec.rb | 33 - ...on_path_in_configurations_settings_spec.rb | 115 - ...ation_on_upgrade_from_version_four_spec.rb | 35 - ...t_widget_set_name_to_three_columns_spec.rb | 82 - ...d_update_repo_name_to_miq_database_spec.rb | 45 - ...ewall_rules_for_neutron_networking_spec.rb | 53 - ...ser_columns_to_miq_widget_contents_spec.rb | 23 - ...egistration_http_proxy_credentials_spec.rb | 56 - ...ge_utc_time_profile_type_to_global_spec.rb | 16 - ...ction_depot_settings_to_file_depot_spec.rb | 41 - ...30_subclass_file_depot_by_protocol_spec.rb | 29 - ...create_miq_groups_users_join_table_spec.rb | 31 - ...igrate_automate_to_customer_domain_spec.rb | 150 - ...d_user_current_group_to_miq_groups_spec.rb | 61 - ..._options_in_miq_alert_for_email_to_spec.rb | 37 - ...pxe_server_customization_directory_spec.rb | 17 - ...default_registration_channel_names_spec.rb | 29 - ...140859_add_cloud_tenant_sti_column_spec.rb | 16 - ...r_region_to_ext_management_systems_spec.rb | 44 - ...20_remove_vdi_tab_from_miq_dialogs_spec.rb | 27 - ...20_remove_miq_search_vdi_instances_spec.rb | 18 - ...igrate_ems_attributes_to_endpoints_spec.rb | 85 - ..._to_real_columns_for_dialog_fields_spec.rb | 63 - ...move_miq_worker_rows_without_model_spec.rb | 22 - ...150109142457_namespace_ems_classes_spec.rb | 28 - ...ation_display_name_out_of_reserves_spec.rb | 45 - ...cache_server_opts_in_configuration_spec.rb | 49 - ...grate_configuration_manager_to_ems_spec.rb | 77 - ...igrate_provisioning_manager_to_ems_spec.rb | 77 - ...d_draft_to_orchestration_templates_spec.rb | 15 - ..._database_default_update_repo_name_spec.rb | 36 - ..._add_file_depot_id_to_miq_schedule_spec.rb | 29 - ...d_drop_down_list_with_dynamic_flag_spec.rb | 33 - ...port_config_from_container_service_spec.rb | 37 - ..._kerberos_to_ext_management_system_spec.rb | 53 - ...193927_default_provider_verify_ssl_spec.rb | 17 - ...161336_add_container_entities_type_spec.rb | 35 - ...conditions_to_container_conditions_spec.rb | 35 - ..._serialized_reports_for_rails_four_spec.rb | 139 - ...0150630100251_namespace_ems_amazon_spec.rb | 15 - ...0150714053019_namespace_ems_redhat_spec.rb | 15 - ...1_remove_ui_tasks_and_ui_task_sets_spec.rb | 28 - ...0150716021334_fix_redhat_namespace_spec.rb | 15 - ...150724030353_namespace_ems_foreman_spec.rb | 15 - ...0731025210_namespace_ems_openstack_spec.rb | 15 - ...vent_table_to_miq_event_definition_spec.rb | 63 - ...tered_events_to_blacklisted_events_spec.rb | 62 - ...me_ems_event_table_to_event_stream_spec.rb | 43 - ...0807165254_namespace_ems_container_spec.rb | 15 - ...0815051916_namespace_ems_microsoft_spec.rb | 15 - ...15052719_fix_foreman_provider_type_spec.rb | 15 - .../20150817213409_clear_tenant_seed_spec.rb | 11 - ..._tenant_divisible_on_existing_rows_spec.rb | 33 - ...50822102141_fix_more_foreman_types_spec.rb | 15 - ..._openstack_availability_zones_null_spec.rb | 15 - ...00_update_tenant_override_settings_spec.rb | 26 - .../20150903162623_assign_tenant_spec.rb | 57 - ...904181202_miq_groups_add_ldap_role_spec.rb | 21 - ...7095639_add_container_image_digest_spec.rb | 53 - ...07163347_confirm_all_class_renames_spec.rb | 15 - ...20150909023532_namespace_ems_azure_spec.rb | 15 - ...ect_user_created_role_feature_sets_spec.rb | 124 - ...01329_assign_tenant_to_miq_request_spec.rb | 67 - ...re_ro_datastores_to_hosts_storages_spec.rb | 11 - .../20151019194111_tenant_cfg_not_nil_spec.rb | 28 - ..._correct_sti_type_on_cloud_network_spec.rb | 39 - ...t_correct_sti_type_on_cloud_subnet_spec.rb | 39 - ...stent_volumes_to_container_volumes_spec.rb | 27 - ...174140_assign_tenant_default_group_spec.rb | 48 - ...26170631_set_miq_groups_group_type_spec.rb | 41 - .../20151026220722_assign_vm_group_spec.rb | 31 - ...1030201919_fix_miq_group_sequences_spec.rb | 28 - ...20951_transfer_rate_value_to_tiers_spec.rb | 16 - ...0151111165020_rename_miq_search_db_spec.rb | 21 - ...3_update_default_update_repo_names_spec.rb | 35 - ...pe_on_openstack_infra_miq_template_spec.rb | 87 - ...sti_type_on_openstack_cloud_volume_spec.rb | 97 - ...ost_storage_replication_on_upgrade_spec.rb | 22 - ...1221134925_remove_sat5_repo_config_spec.rb | 52 - ...e_provider_attributes_to_endpoints_spec.rb | 75 - ...ver_row_from_miq_event_definitions_spec.rb | 24 - ...eback_rate_detail_currency_not_nil_spec.rb | 28 - ...ed_rows_from_newly_excluded_tables_spec.rb | 75 - ..._created_on_for_container_entities_spec.rb | 43 - ...ate_url_from_provider_to_endpoints_spec.rb | 75 - ...migrate_old_configuration_settings_spec.rb | 95 - ...configurations_to_settings_changes_spec.rb | 213 - ...derable_to_orchestration_templates_spec.rb | 15 - .../20160214115800_inline_ems_id_spec.rb | 30 - ...nager_from_openstack_cloud_manager_spec.rb | 178 - ...move_is_datacenter_from_ems_folder_spec.rb | 31 - ...ix_event_class_for_evm_alert_event_spec.rb | 153 - ...ity_protocol_atribute_to_endpoints_spec.rb | 41 - ..._id_to_network_ports_cloud_subnets_spec.rb | 210 - ...223941_add_process_to_miq_requests_spec.rb | 15 - ...0160310170333_add_service_ancestry_spec.rb | 56 - ...30_move_user_roles_to_entitlements_spec.rb | 20 - ...move_miq_user_role_from_miq_groups_spec.rb | 14 - ...5653_move_switch_host_to_jointable_spec.rb | 20 - ...2205357_remove_host_id_from_switch_spec.rb | 23 - ...d_ems_id_on_openstack_cloud_subnet_spec.rb | 178 - ..._manager_from_amazon_cloud_manager_spec.rb | 170 - ..._and_ems_id_on_amazon_cloud_subnet_spec.rb | 178 - ...24131349_add_hidden_to_ems_folders_spec.rb | 15 - ...q_server_product_update_join_table_spec.rb | 58 - ...urations_from_replication_excludes_spec.rb | 54 - ...k_manager_from_azure_cloud_manager_spec.rb | 170 - ...e_and_ems_id_on_azure_cloud_subnet_spec.rb | 178 - ..._add_id_primary_key_to_join_tables_spec.rb | 62 - ...t_sti_type_on_cloud_resource_quota_spec.rb | 43 - ...413202128_sti_configuration_script_spec.rb | 15 - ...ity_to_hash_from_persistent_volume_spec.rb | 57 - ...8141210_add_read_only_to_miq_alert_spec.rb | 17 - ...ck_to_chargeback_vm_on_miq_reports_spec.rb | 43 - ...d_tables_from_replication_settings_spec.rb | 53 - ...5_correct_sti_type_on_cloud_tenant_spec.rb | 39 - ...update_default_yum_repo_name_for56_spec.rb | 29 - ...15825_move_filters_to_entitlements_spec.rb | 38 - ...move_database_synchronization_role_spec.rb | 41 - ..._change_exclude_table_settings_key_spec.rb | 41 - ..._manager_from_google_cloud_manager_spec.rb | 170 - ...140841_fix_service_order_placed_at_spec.rb | 89 - ...remove_replication_worker_settings_spec.rb | 31 - ...upgrade_host_storage_from_reserved_spec.rb | 45 - ...tem_add_source_to_miq_ae_namespace_spec.rb | 35 - ...eneric_subtype_on_service_template_spec.rb | 41 - ...0_fix_null_verify_ssl_on_endpoints_spec.rb | 19 - ...25152940_fix_port_zero_on_enpoints_spec.rb | 19 - ...ion_tables_to_replication_excludes_spec.rb | 62 - ..._remove_atomic_container_providers_spec.rb | 126 - ...t_ranges_in_load_balancer_listener_spec.rb | 101 - ...lue_serialized_to_custom_attribute_spec.rb | 12 - ...epo_data_from_database_to_settings_spec.rb | 76 - ...replication_excludes_from_settings_spec.rb | 27 - ...e_ems_events_purging_settings_keys_spec.rb | 33 - ...3140739_remove_remote_api_settings_spec.rb | 37 - ...xtract_field_data_from_rate_detail_spec.rb | 44 - ...217_update_ems_in_miq_alert_status_spec.rb | 28 - ...r_each_job_and_transfer_attributes_spec.rb | 69 - ...te_description_in_miq_alert_status_spec.rb | 18 - ...ger_sti_type_to_automation_manager_spec.rb | 73 - ...ger_settings_to_automation_manager_spec.rb | 75 - ...rvice_display_and_retired_to_false_spec.rb | 39 - ...07215322_fix_vpor_time_profile_ids_spec.rb | 41 - ...ager_inventory_root_group_sti_type_spec.rb | 35 - ...job_sti_type_to_automation_manager_spec.rb | 33 - ..._central_admin_region_auth_records_spec.rb | 18 - ...move_openshift_enterprise_provider_spec.rb | 89 - ...222214902_add_initiator_to_service_spec.rb | 19 - ...grate_configuration_script_to_base_spec.rb | 37 - ...70315082311_update_o_virt_api_path_spec.rb | 106 - ...ate_persistent_volumes_parent_type_spec.rb | 27 - ..._id_to_miq_server_id_in_jobs_table_spec.rb | 26 - ...ve_oid_integer_args_from_miq_queue_spec.rb | 27 - ..._expression_in_tenant_quota_report_spec.rb | 46 - ...2333_delete_miq_replication_worker_spec.rb | 19 - ...409083720_add_enabled_field_to_ems_spec.rb | 16 - ...y_server_id_from_jobs_to_miq_tasks_spec.rb | 29 - .../20170420124055_update_policy_seed_spec.rb | 19 - ..._embedded_methods_to_miq_ae_method_spec.rb | 17 - ...70425154145_add_sti_to_middlewares_spec.rb | 25 - ..._remove_invalid_hawkular_endpoints_spec.rb | 83 - ...o_start_state_to_queuedin_miq_task_spec.rb | 34 - ..._container_group_failed_sync_event_spec.rb | 24 - ...2233333_drop_miq_server_rhn_mirror_spec.rb | 72 - ...519173044_remove_cim_ontap_records_spec.rb | 93 - ...d_options_to_ext_management_system_spec.rb | 37 - ...48_remove_mirrored_logger_settings_spec.rb | 18 - ...35623_update_container_image_types_spec.rb | 17 - ...5_add_hash_expression_to_miq_alert_spec.rb | 69 - ...se_deleted_on_in_containers_tables_spec.rb | 124 - ...20_update_container_template_types_spec.rb | 15 - ...5_convert_custom_button_to_classes_spec.rb | 88 - ...container_definition_and_container_spec.rb | 173 - ...ate_type_of_orchestration_template_spec.rb | 57 - ...ainer_quota_items_columns_to_float_spec.rb | 45 - ..._migrate_database_role_in_settings_spec.rb | 25 - ...sociations_to_use_new_relationship_spec.rb | 89 - ...ddleware_server_to_wildfly_and_eap_spec.rb | 54 - ..._move_openstack_refresher_settings_spec.rb | 21 - ...171023170841_ensure_cloud_managers_spec.rb | 76 - ...2732_move_ems_refresh_args_to_data_spec.rb | 88 - ...33_add_cores_allocated_rate_detail_spec.rb | 46 - ...ed_on_to_container_quota_and_items_spec.rb | 101 - ...x_hawkular_endpoints_with_port_nil_spec.rb | 65 - .../miq_provision_dialogs.rb | 155 - .../binary_blob_csv.yaml | 1 - .../binary_blob_hash.yaml | 133 - .../binary_blob_obj.yaml | 134 - .../miq_report_hash.yaml | 270 -- .../miq_report_obj.yaml | 271 -- .../simple.tmpl.yml | 19 - 822 files changed, 27902 deletions(-) delete mode 100644 db/migrate/20130923182042_collapsed_initial_migration.rb delete mode 100644 db/migrate/20131021190044_remove_miq_license_models_and_table.rb delete mode 100644 db/migrate/20131107000917_expand_dialog_field_default_value_size.rb delete mode 100644 db/migrate/20131118232818_encrypt_miq_database_registration_http_proxy_password_field.rb delete mode 100644 db/migrate/20131121211455_change_options_in_miq_alert.rb delete mode 100644 db/migrate/20131125153220_import_provision_dialogs.rb delete mode 100644 db/migrate/20131210202928_update_log_collection_path_in_configurations_settings.rb delete mode 100644 db/migrate/20131213173452_change_index_on_miq_queue_v2.rb delete mode 100644 db/migrate/20131216214850_fix_replication_on_upgrade_from_version_four.rb delete mode 100644 db/migrate/20140106184152_remove_miq_queue_md5.rb delete mode 100644 db/migrate/20140115160139_add_openstack_fields_to_cloud_networks.rb delete mode 100644 db/migrate/20140115160609_add_openstack_fields_to_cloud_subnets.rb delete mode 100644 db/migrate/20140121213913_split_widget_set_name_to_three_columns.rb delete mode 100644 db/migrate/20140201040548_add_update_repo_name_to_miq_database.rb delete mode 100644 db/migrate/20140207203449_add_system_to_miq_ae_namespaces.rb delete mode 100644 db/migrate/20140210175651_create_import_file_uploads.rb delete mode 100644 db/migrate/20140211141513_add_priority_to_miq_ae_namespaces.rb delete mode 100644 db/migrate/20140214191729_enhance_firewall_rules_for_neutron_networking.rb delete mode 100644 db/migrate/20140218232357_add_group_and_user_columns_to_miq_widget_contents.rb delete mode 100644 db/migrate/20140228153536_create_cloud_tenants.rb delete mode 100644 db/migrate/20140301034340_leverage_authentications_for_registration_http_proxy_credentials.rb delete mode 100644 db/migrate/20140306150006_add_cloud_tenant_ref_to_security_groups.rb delete mode 100644 db/migrate/20140306153718_add_cloud_tenant_ref_to_cloud_networks.rb delete mode 100644 db/migrate/20140306154541_add_cloud_tenant_ref_to_vms.rb delete mode 100644 db/migrate/20140306154747_add_cloud_tenant_ref_to_floating_ips.rb delete mode 100644 db/migrate/20140402134329_change_utc_time_profile_type_to_global.rb delete mode 100644 db/migrate/20140409134713_move_log_collection_depot_settings_to_file_depot.rb delete mode 100644 db/migrate/20140410132430_subclass_file_depot_by_protocol.rb delete mode 100644 db/migrate/20140415212812_add_hidden_column_to_product_features.rb delete mode 100644 db/migrate/20140421150958_create_miq_groups_users_join_table.rb delete mode 100644 db/migrate/20140421192753_add_enabled_to_miq_ae_namespaces.rb delete mode 100644 db/migrate/20140424173120_migrate_automate_to_customer_domain.rb delete mode 100644 db/migrate/20140428145436_add_validator_to_service_dialog_field.rb delete mode 100644 db/migrate/20140428155842_add_reconfigurable_to_dialog_field.rb delete mode 100644 db/migrate/20140428162159_rename_miq_group_id_column_in_users.rb delete mode 100644 db/migrate/20140519211930_add_user_current_group_to_miq_groups.rb delete mode 100644 db/migrate/20140520202225_add_file_depot_id_to_log_file.rb delete mode 100644 db/migrate/20140522201901_add_local_file_to_log_file.rb delete mode 100644 db/migrate/20140611194007_change_options_in_miq_alert_for_email_to.rb delete mode 100644 db/migrate/20140612181021_update_cloud_volume_and_cloud_volume_snapshot.rb delete mode 100644 db/migrate/20140612212226_create_cloud_object_store_containers_and_cloud_object_store_objects.rb delete mode 100644 db/migrate/20140613041358_add_backing_id_to_disks.rb delete mode 100644 db/migrate/20140620201430_create_cloud_resource_quotas.rb delete mode 100644 db/migrate/20140627175339_add_support_case_to_file_depot.rb delete mode 100644 db/migrate/20140715200621_set_default_for_pxe_server_customization_directory.rb delete mode 100644 db/migrate/20140821203124_add_vm_raw_power_state.rb delete mode 100644 db/migrate/20140903194919_add_virtualization_type_to_hardware.rb delete mode 100644 db/migrate/20140903195524_add_supports_hvm_to_flavor.rb delete mode 100644 db/migrate/20140905020643_update_default_registration_channel_names.rb delete mode 100644 db/migrate/20140908201058_add_block_storage_only_to_flavor.rb delete mode 100644 db/migrate/20140908211826_add_root_device_type_to_hardware.rb delete mode 100644 db/migrate/20140917145331_add_vm_publicly_available.rb delete mode 100644 db/migrate/20140918131740_add_template_multi_tenant_relationship.rb delete mode 100644 db/migrate/20140918140859_add_cloud_tenant_sti_column.rb delete mode 100644 db/migrate/20140918154013_add_provider_region_to_ext_management_systems.rb delete mode 100644 db/migrate/20140922163020_remove_vdi_models.rb delete mode 100644 db/migrate/20141002214356_add_refresh_status_to_ext_management_system.rb delete mode 100644 db/migrate/20141015170920_remove_vdi_tab_from_miq_dialogs.rb delete mode 100644 db/migrate/20141020195642_create_orchestration_stacks.rb delete mode 100644 db/migrate/20141021103820_remove_miq_search_vdi_instances.rb delete mode 100644 db/migrate/20141026111520_remove_black_box_from_vms.rb delete mode 100644 db/migrate/20141029000000_create_providers.rb delete mode 100644 db/migrate/20141029005602_create_configuration_managers.rb delete mode 100644 db/migrate/20141029005620_create_computer_systems.rb delete mode 100644 db/migrate/20141029165319_create_provisioning_managers.rb delete mode 100644 db/migrate/20141117082419_add_dynamic_field_to_dialog_fields.rb delete mode 100644 db/migrate/20141121200053_create_endpoints.rb delete mode 100644 db/migrate/20141121200153_migrate_ems_attributes_to_endpoints.rb delete mode 100644 db/migrate/20141121200523_remove_endpoint_data_from_ems.rb delete mode 100644 db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb delete mode 100644 db/migrate/20141202111010_add_ems_ref_to_cloudformation_stack.rb delete mode 100644 db/migrate/20141208194307_drop_miq_region_from_database_backups.rb delete mode 100644 db/migrate/20141219222843_remove_miq_worker_rows_without_model.rb delete mode 100644 db/migrate/20150109142457_namespace_ems_classes.rb delete mode 100644 db/migrate/20150111161446_create_nodes.rb delete mode 100644 db/migrate/20150111161504_create_kubernetes_services.rb delete mode 100644 db/migrate/20150128161824_create_container_groups.rb delete mode 100644 db/migrate/20150128195918_add_manager_error_reporting.rb delete mode 100644 db/migrate/20150131104420_remove_miq_proxy_models.rb delete mode 100644 db/migrate/20150202212058_fix_indexes_on_ems_events.rb delete mode 100644 db/migrate/20150202215346_create_container_definitions.rb delete mode 100644 db/migrate/20150202215414_create_containers.rb delete mode 100644 db/migrate/20150202215435_create_container_port_configs.rb delete mode 100644 db/migrate/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves.rb delete mode 100644 db/migrate/20150213135315_create_configured_system_last_checkin.rb delete mode 100644 db/migrate/20150224102026_create_host_hypervisor_hostname.rb delete mode 100644 db/migrate/20150224164512_add_loopback_to_memcache_server_opts_in_configuration.rb delete mode 100644 db/migrate/20150224192447_add_provider_id_to_ems.rb delete mode 100644 db/migrate/20150224192716_migrate_configuration_manager_to_ems.rb delete mode 100644 db/migrate/20150224192816_migrate_provisioning_manager_to_ems.rb delete mode 100644 db/migrate/20150224193752_drop_configration_manager_and_provisioning_manager.rb delete mode 100644 db/migrate/20150225160000_add_service_systemd_deps.rb delete mode 100644 db/migrate/20150227181349_add_configured_system_organization_location.rb delete mode 100644 db/migrate/20150311181430_add_draft_to_orchestration_templates.rb delete mode 100644 db/migrate/20150311182221_orchestration_template_rename_ems_ref_to_md5_and_drop_unique.rb delete mode 100644 db/migrate/20150312081342_add_read_only_to_dialog_fields.rb delete mode 100644 db/migrate/20150313110200_add_type_to_ems_clusters.rb delete mode 100644 db/migrate/20150316175916_update_miq_database_default_update_repo_name.rb delete mode 100644 db/migrate/20150319115040_create_replication_controllers.rb delete mode 100644 db/migrate/20150323003436_add_configured_system_attributes.rb delete mode 100644 db/migrate/20150323004436_add_locations_parent.rb delete mode 100644 db/migrate/20150323172109_add_availability_zone_id_to_host.rb delete mode 100644 db/migrate/20150324111111_add_retirement_requester_to_vms_and_services.rb delete mode 100644 db/migrate/20150324143511_add_organization_title.rb delete mode 100644 db/migrate/20150324164033_create_configuration_tags.rb delete mode 100644 db/migrate/20150326015341_add_container_group_node_relationship.rb delete mode 100644 db/migrate/20150326130147_create_container_groups_container_services.rb delete mode 100644 db/migrate/20150326154800_add_application_install_time.rb delete mode 100644 db/migrate/20150330214408_add_file_depot_id_to_miq_schedule.rb delete mode 100644 db/migrate/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag.rb delete mode 100644 db/migrate/20150401090146_add_systemd_and_openstack_related_columns_to_system_services.rb delete mode 100644 db/migrate/20150402115247_add_container_port_config_names.rb delete mode 100644 db/migrate/20150402133252_add_container_node_cross_provider_association.rb delete mode 100644 db/migrate/20150402182026_container_metrics.rb delete mode 100644 db/migrate/20150405141637_remove_port_config_from_container_service.rb delete mode 100644 db/migrate/20150406141646_remove_service_id_from_ems_events.rb delete mode 100644 db/migrate/20150407144345_add_kerberos_to_ext_management_system.rb delete mode 100644 db/migrate/20150409145038_add_host_service_group_to_system_services.rb delete mode 100644 db/migrate/20150409145147_add_host_service_group_to_filesystems.rb delete mode 100644 db/migrate/20150409145739_create_host_service_groups.rb delete mode 100644 db/migrate/20150414094834_create_container_projects.rb delete mode 100644 db/migrate/20150414183946_rename_container_id.rb delete mode 100644 db/migrate/20150414201314_update_foreman_raw_attributes.rb delete mode 100644 db/migrate/20150414204018_create_container_node_identities.rb delete mode 100644 db/migrate/20150415131224_create_container_routes.rb delete mode 100644 db/migrate/20150417125852_add_container_events.rb delete mode 100644 db/migrate/20150417162811_update_foreman_derived_values.rb delete mode 100644 db/migrate/20150417210709_add_retirement_to_orchestration_stack.rb delete mode 100644 db/migrate/20150420201056_add_auto_refresh_fields_to_dialog_fields.rb delete mode 100644 db/migrate/20150422162729_add_replicator_relationship.rb delete mode 100644 db/migrate/20150426135513_add_image_id_to_containers.rb delete mode 100644 db/migrate/20150429214648_add_direct_configuration_tags.rb delete mode 100644 db/migrate/20150501193927_default_provider_verify_ssl.rb delete mode 100644 db/migrate/20150503094838_add_container_group_ip_to_container_groups.rb delete mode 100644 db/migrate/20150504111111_add_cloud_subnet_required_to_flavor.rb delete mode 100644 db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb delete mode 100644 db/migrate/20150507102612_create_container_node_conditions.rb delete mode 100644 db/migrate/20150514124529_rename_replication_controllers_to_container_replicators.rb delete mode 100644 db/migrate/20150519123317_create_container_env_vars.rb delete mode 100644 db/migrate/20150521104843_create_container_images.rb delete mode 100644 db/migrate/20150521132514_create_container_image_registries.rb delete mode 100644 db/migrate/20150521204814_add_container_relationship.rb delete mode 100644 db/migrate/20150522161336_add_container_entities_type.rb delete mode 100644 db/migrate/20150526080322_add_container_node_versions_and_os_image.rb delete mode 100644 db/migrate/20150528113122_add_image_relation_to_container.rb delete mode 100644 db/migrate/20150604154825_rename_container_node_conditions_to_container_conditions.rb delete mode 100644 db/migrate/20150610155632_add_image_to_guest_application.rb delete mode 100644 db/migrate/20150610172646_add_container_project_relationship.rb delete mode 100644 db/migrate/20150611083448_change_custom_attribute_value_type_to_text.rb delete mode 100644 db/migrate/20150611094050_add_description_and_interpolated_value_to_custom_attribute.rb delete mode 100644 db/migrate/20150625220141_fix_serialized_reports_for_rails_four.rb delete mode 100644 db/migrate/20150630025128_create_tenant.rb delete mode 100644 db/migrate/20150630100251_namespace_ems_amazon.rb delete mode 100644 db/migrate/20150701142710_associate_tenant_vm.rb delete mode 100644 db/migrate/20150701191241_add_shared_to_cloud_network.rb delete mode 100644 db/migrate/20150708120923_create_tenant_resources.rb delete mode 100644 db/migrate/20150710081302_create_network_ports_and_routers.rb delete mode 100644 db/migrate/20150710110003_add_missing_fields_and_indexes_to_floating_ips.rb delete mode 100644 db/migrate/20150710110243_add_missing_fields_and_indexes_to_cloud_networks.rb delete mode 100644 db/migrate/20150710110244_add_sti_to_cloud_networks.rb delete mode 100644 db/migrate/20150710110707_add_missing_fields_and_indexes_to_cloud_subnets.rb delete mode 100644 db/migrate/20150710110708_add_sti_to_cloud_subnets.rb delete mode 100644 db/migrate/20150710120646_add_missing_fields_and_indexes_to_security_groups.rb delete mode 100644 db/migrate/20150714042229_add_routes_to_services.rb delete mode 100644 db/migrate/20150714053019_namespace_ems_redhat.rb delete mode 100644 db/migrate/20150714143821_remove_ui_tasks_and_ui_task_sets.rb delete mode 100644 db/migrate/20150716021334_fix_redhat_namespace.rb delete mode 100644 db/migrate/20150719123908_add_container_state.rb delete mode 100644 db/migrate/20150724030353_namespace_ems_foreman.rb delete mode 100644 db/migrate/20150726144643_remove_container_group_id_from_containers.rb delete mode 100644 db/migrate/20150730135121_add_container_group_phase.rb delete mode 100644 db/migrate/20150731025210_namespace_ems_openstack.rb delete mode 100644 db/migrate/20150804194147_create_blacklisted_events.rb delete mode 100644 db/migrate/20150806190149_rename_miq_event_table_to_miq_event_definition.rb delete mode 100644 db/migrate/20150806190349_rename_columns_starting_with_miq_event.rb delete mode 100644 db/migrate/20150806194147_migrate_filtered_events_to_blacklisted_events.rb delete mode 100644 db/migrate/20150806211453_rename_ems_event_table_to_event_stream.rb delete mode 100644 db/migrate/20150807165254_namespace_ems_container.rb delete mode 100644 db/migrate/20150810015500_add_tenant_hierarchy.rb delete mode 100644 db/migrate/20150813115025_create_container_resource_quota.rb delete mode 100644 db/migrate/20150814210507_rename_tenant_company_name.rb delete mode 100644 db/migrate/20150815051916_namespace_ems_microsoft.rb delete mode 100644 db/migrate/20150815052719_fix_foreman_provider_type.rb delete mode 100644 db/migrate/20150817213409_clear_tenant_seed.rb delete mode 100644 db/migrate/20150818181426_add_divisible_to_tenants.rb delete mode 100644 db/migrate/20150818181427_update_tenant_divisible_on_existing_rows.rb delete mode 100644 db/migrate/20150818184658_create_tenant_quota.rb delete mode 100644 db/migrate/20150819121823_drop_tenant_resources.rb delete mode 100644 db/migrate/20150819125202_add_tenant_description.rb delete mode 100644 db/migrate/20150819144149_add_container_entity_events.rb delete mode 100644 db/migrate/20150819154348_drop_tenant_appliance_name.rb delete mode 100644 db/migrate/20150820110215_create_container_limit_range.rb delete mode 100644 db/migrate/20150822102141_fix_more_foreman_types.rb delete mode 100644 db/migrate/20150823120001_namespace_ems_openstack_availability_zones_null.rb delete mode 100644 db/migrate/20150824120000_add_tenant_override_settings.rb delete mode 100644 db/migrate/20150824130000_update_tenant_override_settings.rb delete mode 100644 db/migrate/20150825120000_add_service_catalog_tenant.rb delete mode 100644 db/migrate/20150827120000_add_tenant_id_to_miq_ae_namespaces.rb delete mode 100644 db/migrate/20150831123700_rename_tenant_owner_id.rb delete mode 100644 db/migrate/20150903073337_add_container_node_max_container_group.rb delete mode 100644 db/migrate/20150903162623_assign_tenant.rb delete mode 100644 db/migrate/20150904132351_add_scan_columns_to_container_images.rb delete mode 100644 db/migrate/20150904181202_miq_groups_add_ldap_role.rb delete mode 100644 db/migrate/20150906123643_create_security_context.rb delete mode 100644 db/migrate/20150906123956_add_container_definition_security_contexts.rb delete mode 100644 db/migrate/20150906234626_add_service_type.rb delete mode 100644 db/migrate/20150906234635_add_node_port.rb delete mode 100644 db/migrate/20150907095639_add_container_image_digest.rb delete mode 100644 db/migrate/20150907120454_create_container_volumes.rb delete mode 100644 db/migrate/20150907163347_confirm_all_class_renames.rb delete mode 100644 db/migrate/20150907234623_add_container_command.rb delete mode 100644 db/migrate/20150909023532_namespace_ems_azure.rb delete mode 100644 db/migrate/20150910153517_add_full_name_to_custom_attributes.rb delete mode 100644 db/migrate/20150911152048_add_disk_info_to_flavors.rb delete mode 100644 db/migrate/20150914202922_correct_user_created_role_feature_sets.rb delete mode 100644 db/migrate/20150914203523_add_warn_value_to.rb delete mode 100644 db/migrate/20150915000737_add_tenant_id_to_miq_request.rb delete mode 100644 db/migrate/20150915001329_assign_tenant_to_miq_request.rb delete mode 100644 db/migrate/20150921204114_add_vmware_ro_datastores_to_hosts_storages.rb delete mode 100644 db/migrate/20150924195523_enhance_flavors_for_cloud_disk_info.rb delete mode 100644 db/migrate/20150930083543_add_status_to_floating_ips.rb delete mode 100644 db/migrate/20150930201117_change_cloud_tenant_description_to_text.rb delete mode 100644 db/migrate/20151001110220_add_resource_group_to_orchestration_stack.rb delete mode 100644 db/migrate/20151001193521_rename_hardware_columns.rb delete mode 100644 db/migrate/20151005082821_change_device_id_to_bigint_in_network_ports.rb delete mode 100644 db/migrate/20151008114043_create_chargeback_rate_detail_measure.rb delete mode 100644 db/migrate/20151008114125_add_measure_ref_to_chargeback_rate_detail.rb delete mode 100644 db/migrate/20151009174934_create_chargeback_rate_detail_currencies.rb delete mode 100644 db/migrate/20151012072007_create_container_component_statuses.rb delete mode 100644 db/migrate/20151013104702_add_currencies_ref_to_chargeback_rate_detail.rb delete mode 100644 db/migrate/20151018090641_create_persistent_volume_claim.rb delete mode 100644 db/migrate/20151019184531_create_resource_groups.rb delete mode 100644 db/migrate/20151019194111_tenant_cfg_not_nil.rb delete mode 100644 db/migrate/20151020222634_add_watermark_reporting_fields_to_metric_and_metric_rollup.rb delete mode 100644 db/migrate/20151021093644_set_correct_sti_type_on_cloud_network.rb delete mode 100644 db/migrate/20151021095831_set_correct_sti_type_on_cloud_subnet.rb delete mode 100644 db/migrate/20151021104529_add_persistent_volumes_to_container_volumes.rb delete mode 100644 db/migrate/20151021143818_add_replicator_entity_events.rb delete mode 100644 db/migrate/20151021151216_add_resource_group_id_to_vms.rb delete mode 100644 db/migrate/20151021174044_add_tenant_default_group.rb delete mode 100644 db/migrate/20151021174140_assign_tenant_default_group.rb delete mode 100644 db/migrate/20151022141745_remove_license_required_from_server_roles.rb delete mode 100644 db/migrate/20151026170631_set_miq_groups_group_type.rb delete mode 100644 db/migrate/20151026220722_assign_vm_group.rb delete mode 100644 db/migrate/20151030201919_fix_miq_group_sequences.rb delete mode 100644 db/migrate/20151104115400_create_chargeback_tiers.rb delete mode 100644 db/migrate/20151104120951_transfer_rate_value_to_tiers.rb delete mode 100644 db/migrate/20151106164333_add_project_to_ext_management_system.rb delete mode 100644 db/migrate/20151109203749_add_service_account_to_authentication.rb delete mode 100644 db/migrate/20151111165020_rename_miq_search_db.rb delete mode 100644 db/migrate/20151119202643_update_default_update_repo_names.rb delete mode 100644 db/migrate/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template.rb delete mode 100644 db/migrate/20151125155213_create_middleware_servers.rb delete mode 100644 db/migrate/20151204143045_set_correct_sti_type_on_openstack_cloud_volume.rb delete mode 100644 db/migrate/20151208150956_fix_host_storage_replication_on_upgrade.rb delete mode 100644 db/migrate/20151209141840_create_middleware_deployments.rb delete mode 100644 db/migrate/20151210154747_add_container_image_registry_to_container_service.rb delete mode 100644 db/migrate/20151216095054_create_container_builds.rb delete mode 100644 db/migrate/20151221134925_remove_sat5_repo_config.rb delete mode 100644 db/migrate/20151222103510_add_verify_ssl_to_endpoints.rb delete mode 100644 db/migrate/20151222103721_migrate_provider_attributes_to_endpoints.rb delete mode 100644 db/migrate/20151222105242_remove_endpoint_data_from_provider.rb delete mode 100644 db/migrate/20151222152212_remove_vm_discover_row_from_miq_event_definitions.rb delete mode 100644 db/migrate/20160105170524_remove_miq_worker_command_line.rb delete mode 100644 db/migrate/20160108214044_add_miq_workers_miq_servers_proportional_set_size.rb delete mode 100644 db/migrate/20160110104053_add_claim_ref_to_container_volumes.rb delete mode 100644 db/migrate/20160114085140_add_network_router_id_to_cloud_subnet.rb delete mode 100644 db/migrate/20160114111114_delete_network_router_id_from_floating_ips.rb delete mode 100644 db/migrate/20160114153948_delete_cloud_network_id_from_network_ports.rb delete mode 100644 db/migrate/20160115111829_chargeback_rate_detail_currency_not_nil.rb delete mode 100644 db/migrate/20160115142023_remove_replicated_rows_from_newly_excluded_tables.rb delete mode 100644 db/migrate/20160119125950_add_created_on_for_container_entities.rb delete mode 100644 db/migrate/20160120151045_add_url_to_endpoints.rb delete mode 100644 db/migrate/20160120151642_migrate_url_from_provider_to_endpoints.rb delete mode 100644 db/migrate/20160126151325_add_disk_and_memory_minimum_to_hardware.rb delete mode 100644 db/migrate/20160127210622_migrate_old_configuration_settings.rb delete mode 100644 db/migrate/20160127210623_create_settings_changes_table.rb delete mode 100644 db/migrate/20160127210624_convert_configurations_to_settings_changes.rb delete mode 100644 db/migrate/20160127210625_remove_configurations.rb delete mode 100644 db/migrate/20160127210705_create_configuration_script.rb delete mode 100644 db/migrate/20160202200713_create_generic_object.rb delete mode 100644 db/migrate/20160203101130_add_orderable_to_orchestration_templates.rb delete mode 100644 db/migrate/20160203162135_add_deletion_time_for_container_archivables.rb delete mode 100644 db/migrate/20160209124055_create_service_orders.rb delete mode 100644 db/migrate/20160209130938_add_service_order_to_miq_request.rb delete mode 100644 db/migrate/20160211113430_create_cloud_databases.rb delete mode 100644 db/migrate/20160214115800_inline_ems_id.rb delete mode 100644 db/migrate/20160219190002_add_type_to_ems_folders.rb delete mode 100644 db/migrate/20160220123313_add_open_scap_result_entities.rb delete mode 100644 db/migrate/20160222161500_add_parent_ems_id_to_ext_management_system.rb delete mode 100644 db/migrate/20160223085416_add_stat_containergroup_create_rate.rb delete mode 100644 db/migrate/20160224224115_remove_filters_from_users.rb delete mode 100644 db/migrate/20160225033835_remove_resource_id_and_resource_type_from_miq_groups.rb delete mode 100644 db/migrate/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager.rb delete mode 100644 db/migrate/20160226164206_remove_guid_from_miq_groups.rb delete mode 100644 db/migrate/20160301111647_remove_rate_column_from_chargeback_rate_detail.rb delete mode 100644 db/migrate/20160301164102_add_survey_specs_to_configuration_scripts.rb delete mode 100644 db/migrate/20160302203922_remove_is_datacenter_from_ems_folder.rb delete mode 100644 db/migrate/20160302214232_add_inventory_root_group_id_to_configured_systems.rb delete mode 100644 db/migrate/20160303115326_add_websocket_to_miq_server.rb delete mode 100644 db/migrate/20160307205816_fix_event_class_for_evm_alert_event.rb delete mode 100644 db/migrate/20160308093819_add_security_protocol_to_endpoints.rb delete mode 100644 db/migrate/20160308093916_migrate_security_protocol_atribute_to_endpoints.rb delete mode 100644 db/migrate/20160308093935_remove_security_protocol_from_ems.rb delete mode 100644 db/migrate/20160308162644_add_cloud_subnets_network_ports_table.rb delete mode 100644 db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb delete mode 100644 db/migrate/20160308165331_remove_cloud_subnet_id_from_network_port.rb delete mode 100644 db/migrate/20160309144534_create_system_consoles.rb delete mode 100644 db/migrate/20160309223941_add_process_to_miq_requests.rb delete mode 100644 db/migrate/20160310170333_add_service_ancestry.rb delete mode 100644 db/migrate/20160311155237_create_entitlements.rb delete mode 100644 db/migrate/20160311222150_create_git_repositories.rb delete mode 100644 db/migrate/20160311231152_add_commit_sha_to_miq_ae_namespaces.rb delete mode 100644 db/migrate/20160317041206_add_maintenance_to_host.rb delete mode 100644 db/migrate/20160317160230_move_user_roles_to_entitlements.rb delete mode 100644 db/migrate/20160317164141_add_old_projectid_to_container_projects.rb delete mode 100644 db/migrate/20160317194215_remove_miq_user_role_from_miq_groups.rb delete mode 100644 db/migrate/20160318133352_add_deprecated_to_vms.rb delete mode 100644 db/migrate/20160322141934_create_join_table_host_switch.rb delete mode 100644 db/migrate/20160322174516_add_old_ems_id_to_containers_and_definitions.rb delete mode 100644 db/migrate/20160322195653_move_switch_host_to_jointable.rb delete mode 100644 db/migrate/20160322205357_remove_host_id_from_switch.rb delete mode 100644 db/migrate/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet.rb delete mode 100644 db/migrate/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager.rb delete mode 100644 db/migrate/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet.rb delete mode 100644 db/migrate/20160324131349_add_hidden_to_ems_folders.rb delete mode 100644 db/migrate/20160324174132_create_container_deployments.rb delete mode 100644 db/migrate/20160324174218_create_container_deployment_nodes.rb delete mode 100644 db/migrate/20160328204930_remove_miq_server_product_update_join_table.rb delete mode 100644 db/migrate/20160329192055_add_virtual_instance_ref_to_configured_systems.rb delete mode 100644 db/migrate/20160329212403_add_switch_uuid_and_is_shared_to_switch.rb delete mode 100644 db/migrate/20160331111338_add_registered_on_to_container_image.rb delete mode 100644 db/migrate/20160331111827_add_stat_containerimage_registration_rate_to_metric_rollups.rb delete mode 100644 db/migrate/20160404152107_add_subscription_to_ext_management_system.rb delete mode 100644 db/migrate/20160405074214_change_container_group_metric_field_name.rb delete mode 100644 db/migrate/20160405143543_create_git_references.rb delete mode 100644 db/migrate/20160405151142_remove_configurations_from_replication_excludes.rb delete mode 100644 db/migrate/20160406072945_separate_azure_network_manager_from_azure_cloud_manager.rb delete mode 100644 db/migrate/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet.rb delete mode 100644 db/migrate/20160406190650_add_cross_manager_association_to_configured_system.rb delete mode 100644 db/migrate/20160406195810_add_id_primary_key_to_join_tables.rb delete mode 100644 db/migrate/20160408154738_drop_url_from_providers.rb delete mode 100644 db/migrate/20160412173518_add_inventory_group_relation_to_configuration_script.rb delete mode 100644 db/migrate/20160413175651_add_api_version_adn_path_to_endpoint.rb delete mode 100644 db/migrate/20160413191759_correct_sti_type_on_cloud_resource_quota.rb delete mode 100644 db/migrate/20160413202128_sti_configuration_script.rb delete mode 100644 db/migrate/20160414094300_change_capacity_to_hash_from_persistent_volume.rb delete mode 100644 db/migrate/20160414185708_create_container_label_tag_mappings.rb delete mode 100644 db/migrate/20160414192525_rename_configuration_manager_to_manager.rb delete mode 100644 db/migrate/20160415121724_create_cloud_services.rb delete mode 100644 db/migrate/20160417105237_add_read_only_to_policies.rb delete mode 100644 db/migrate/20160418141210_add_read_only_to_miq_alert.rb delete mode 100644 db/migrate/20160418205109_add_middleware_server_event_streams.rb delete mode 100644 db/migrate/20160419134542_add_deployment_authentication_options_to_authentications.rb delete mode 100644 db/migrate/20160424124613_create_network_groups.rb delete mode 100644 db/migrate/20160424124654_add_network_group_id_to_security_groups.rb delete mode 100644 db/migrate/20160424124710_add_network_group_id_to_cloud_subnets.rb delete mode 100644 db/migrate/20160424124736_add_network_group_id_to_network_router.rb delete mode 100644 db/migrate/20160425141742_add_parent_cloud_subnet_id_to_cloud_subnets.rb delete mode 100644 db/migrate/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports.rb delete mode 100644 db/migrate/20160425161234_remove_deleted_tables_from_replication_settings.rb delete mode 100644 db/migrate/20160425161235_correct_sti_type_on_cloud_tenant.rb delete mode 100644 db/migrate/20160425161456_update_default_yum_repo_name_for56.rb delete mode 100644 db/migrate/20160425161822_create_middleware_datasources.rb delete mode 100644 db/migrate/20160428215808_add_filters_to_entitlements.rb delete mode 100644 db/migrate/20160428215825_move_filters_to_entitlements.rb delete mode 100644 db/migrate/20160428215838_remove_filters_from_miq_groups.rb delete mode 100644 db/migrate/20160519083518_add_ems_id_and_ems_ref_to_orchestration_templates.rb delete mode 100644 db/migrate/20160607141740_remove_ruby_rep_tables_and_triggers.rb delete mode 100644 db/migrate/20160607141810_remove_database_synchronization_role.rb delete mode 100644 db/migrate/20160607141857_change_exclude_table_settings_key.rb delete mode 100644 db/migrate/20160610124506_add_lives_on_to_middleware_server.rb delete mode 100644 db/migrate/20160621023902_create_host_aggregate.rb delete mode 100644 db/migrate/20160621025312_create_host_aggregate_host.rb delete mode 100644 db/migrate/20160627074242_separate_google_network_manager_from_google_cloud_manager.rb delete mode 100644 db/migrate/20160627112436_fix_lives_on_index_on_middleware_servers.rb delete mode 100644 db/migrate/20160627114232_fix_counterpart_index_on_configured_systems.rb delete mode 100644 db/migrate/20160628124806_add_visible_to_dialog_fields.rb delete mode 100644 db/migrate/20160628140841_fix_service_order_placed_at.rb delete mode 100644 db/migrate/20160628165030_create_middleware_messagings.rb delete mode 100644 db/migrate/20160701134322_add_ems_ref_to_host_storages.rb delete mode 100644 db/migrate/20160701205641_add_properties_to_generic_object.rb delete mode 100644 db/migrate/20160706230546_add_status_to_middleware_deployments.rb delete mode 100644 db/migrate/20160708140404_add_blueprint_id_to_service_templates.rb delete mode 100644 db/migrate/20160708140611_create_blueprints.rb delete mode 100644 db/migrate/20160708182331_remove_replication_worker_settings.rb delete mode 100644 db/migrate/20160708204023_remove_last_replication_columns_from_miq_database.rb delete mode 100644 db/migrate/20160712043931_create_storage_profiles.rb delete mode 100644 db/migrate/20160712044409_create_join_table_storage_profile_storage.rb delete mode 100644 db/migrate/20160712144219_create_arbitration_defaults.rb delete mode 100644 db/migrate/20160713130940_remove_type_template_and_vms_filters_from_miq_search.rb delete mode 100644 db/migrate/20160713141244_upgrade_host_storage_from_reserved.rb delete mode 100644 db/migrate/20160714133426_rename_arbitration_defaults_to_arbitration_profiles.rb delete mode 100644 db/migrate/20160714210238_add_storage_profile_id_to_vms.rb delete mode 100644 db/migrate/20160714210434_add_storage_profile_id_to_disks.rb delete mode 100644 db/migrate/20160715155054_create_arbitration_settings.rb delete mode 100644 db/migrate/20160719080735_add_parent_to_cloud_tenants.rb delete mode 100644 db/migrate/20160719151049_add_bootable_to_disks.rb delete mode 100644 db/migrate/20160720085321_create_container_template.rb delete mode 100644 db/migrate/20160720151217_create_arbitration_rules.rb delete mode 100644 db/migrate/20160721173414_create_middleware_domains.rb delete mode 100644 db/migrate/20160725175531_create_middleware_server_groups.rb delete mode 100644 db/migrate/20160725175841_add_server_group_id_to_middleware_servers.rb delete mode 100644 db/migrate/20160726161153_add_feed_to_middleware_deployments_and_datasources.rb delete mode 100644 db/migrate/20160726162229_add_properties_to_middleware_deployments.rb delete mode 100644 db/migrate/20160729182517_remove_system_add_source_to_miq_ae_namespace.rb delete mode 100644 db/migrate/20160801170547_add_type_to_arbitration_profile.rb delete mode 100644 db/migrate/20160801214912_add_generic_subtype_to_service_template.rb delete mode 100644 db/migrate/20160802145938_set_generic_subtype_on_service_template.rb delete mode 100644 db/migrate/20160805084714_create_load_balancers.rb delete mode 100644 db/migrate/20160805104342_create_load_balancer_listeners.rb delete mode 100644 db/migrate/20160805123339_create_load_balancer_pools.rb delete mode 100644 db/migrate/20160805134120_create_load_balancer_health_checks.rb delete mode 100644 db/migrate/20160805134419_create_load_balancer_listener_pools.rb delete mode 100644 db/migrate/20160805141502_create_load_balancer_pool_members.rb delete mode 100644 db/migrate/20160805142719_create_load_balancer_health_check_members.rb delete mode 100644 db/migrate/20160808150745_add_metrics_status_to_ext_management_system.rb delete mode 100644 db/migrate/20160809142710_add_vm_id_to_load_balancer_pool_members.rb delete mode 100644 db/migrate/20160810083516_remove_load_balancer_pool_id_and_network_port_id_from_load_balancer_listeners.rb delete mode 100644 db/migrate/20160810090600_add_status_and_status_reason_to_load_balancer_health_check_members.rb delete mode 100644 db/migrate/20160810091423_add_load_balancer_id_to_load_balancer_health_checks.rb delete mode 100644 db/migrate/20160810111958_add_sti_types_to_load_balancer_models.rb delete mode 100644 db/migrate/20160810123100_create_load_balancer_pool_member_pools.rb delete mode 100644 db/migrate/20160810124827_add_ems_id_to_load_balancer_pool_members.rb delete mode 100644 db/migrate/20160810125803_change_load_balancer_m_to_n_tables_indexes_to_unique.rb delete mode 100644 db/migrate/20160811081235_add_source_to_tenants.rb delete mode 100644 db/migrate/20160811180711_create_cloud_volume_backups.rb delete mode 100644 db/migrate/20160817104523_create_notification_types.rb delete mode 100644 db/migrate/20160817120209_create_notifications.rb delete mode 100644 db/migrate/20160817121951_create_notification_recipients.rb delete mode 100644 db/migrate/20160820003340_add_flavor_multi_tenant_relationship.rb delete mode 100644 db/migrate/20160825070810_fix_null_verify_ssl_on_endpoints.rb delete mode 100644 db/migrate/20160825145949_remove_name_from_arbitration_rules.rb delete mode 100644 db/migrate/20160825152940_fix_port_zero_on_enpoints.rb delete mode 100644 db/migrate/20160825203056_add_state_to_hardware.rb delete mode 100644 db/migrate/20160826184028_add_notification_tables_to_replication_excludes.rb delete mode 100644 db/migrate/20160829134746_remove_atomic_container_providers.rb delete mode 100644 db/migrate/20160829152511_add_retirement_cols_to_load_balancers.rb delete mode 100644 db/migrate/20160830110050_change_cloud_subnets_network_ports_unique_index.rb delete mode 100644 db/migrate/20160830233154_add_port_ranges_to_load_balancer_listener.rb delete mode 100644 db/migrate/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener.rb delete mode 100644 db/migrate/20160830233842_drop_ports_in_load_balancer_listener.rb delete mode 100644 db/migrate/20160911130449_add_value_serialized_to_custom_attribute.rb delete mode 100644 db/migrate/20160912160750_change_retires_on_to_datetime.rb delete mode 100644 db/migrate/20160912183918_add_source_to_network_ports.rb delete mode 100644 db/migrate/20160913195129_move_repo_data_from_database_to_settings.rb delete mode 100644 db/migrate/20160913195130_remove_update_repo_name_from_miq_databases.rb delete mode 100644 db/migrate/20160915100611_add_openshift_data_to_container_image.rb delete mode 100644 db/migrate/20160915112948_add_disconnection_fields_to_container_image.rb delete mode 100644 db/migrate/20160915160023_add_tenant_mapping_enabled_to_ext_management_systems.rb delete mode 100644 db/migrate/20160915160517_create_shares.rb delete mode 100644 db/migrate/20160915173610_create_service_connections.rb delete mode 100644 db/migrate/20160915173740_add_blueprint_to_dialogs.rb delete mode 100644 db/migrate/20160915195120_add_timestamps_to_arbitration_profile.rb delete mode 100644 db/migrate/20160919115131_add_details_to_system_consoles.rb delete mode 100644 db/migrate/20160919145034_add_top_level_namespace_to_miq_ae_namespaces.rb delete mode 100644 db/migrate/20160921072726_add_options_to_notifications.rb delete mode 100644 db/migrate/20160922090347_remove_field_region_from_users.rb delete mode 100644 db/migrate/20160922171248_change_arbitration_rules_arbitration_profile_id_to_big_int.rb delete mode 100644 db/migrate/20160922212345_remove_notifications_foreign_key_constraints.rb delete mode 100644 db/migrate/20160922212346_remove_notification_recipients_foreign_key_constraints.rb delete mode 100644 db/migrate/20160922232606_change_cloud_volume_backup_size_to_bigint.rb delete mode 100644 db/migrate/20160922234606_add_mem_and_swap_free_and_used_to_miq_servers.rb delete mode 100644 db/migrate/20160922235000_create_ancestry_indexes.rb delete mode 100644 db/migrate/20160923000000_remove_replication_excludes_from_settings.rb delete mode 100644 db/migrate/20161010184005_create_physical_servers.rb delete mode 100644 db/migrate/20161024173542_add_cpu_memory_hot_plug_to_vms.rb delete mode 100644 db/migrate/20161101174139_rename_ems_events_purging_settings_keys.rb delete mode 100644 db/migrate/20161102093322_add_missing_fields_to_alert_statuses.rb delete mode 100644 db/migrate/20161113091851_add_miq_alert_status_actions.rb delete mode 100644 db/migrate/20161211162552_add_generating_ems_to_event_streams.rb delete mode 100644 db/migrate/20161213112148_add_server_group_id_to_middleware_deployments.rb delete mode 100644 db/migrate/20161213140739_remove_remote_api_settings.rb delete mode 100644 db/migrate/20170109101053_create_chargeable_fields.rb delete mode 100644 db/migrate/20170109124924_add_chargeable_field_to_chargeback_rate_detail.rb delete mode 100644 db/migrate/20170109142011_extract_field_data_from_rate_detail.rb delete mode 100644 db/migrate/20170109190411_make_job_belong_to_miq_task.rb delete mode 100644 db/migrate/20170109221226_create_configuration_script_sources.rb delete mode 100644 db/migrate/20170110090935_add_ems_to_miq_alert_status.rb delete mode 100644 db/migrate/20170111033729_add_configuration_script_payload_and_configuration_script_source_to_configuration_scripts.rb delete mode 100644 db/migrate/20170115140217_update_ems_in_miq_alert_status.rb delete mode 100644 db/migrate/20170116210702_add_manager_ref_to_authentications.rb delete mode 100644 db/migrate/20170117144629_add_certificate_authority_to_endpoint.rb delete mode 100644 db/migrate/20170118140522_add_configuration_template_to_resource_actions.rb delete mode 100644 db/migrate/20170118232430_create_join_table_authentication_configuration_script_base.rb delete mode 100644 db/migrate/20170120144842_change_datatype_of_message_on_miq_tasks_table_to_text.rb delete mode 100644 db/migrate/20170120154842_add_started_on_column_to_miq_tasks.rb delete mode 100644 db/migrate/20170120164058_create_task_for_each_job_and_transfer_attributes.rb delete mode 100644 db/migrate/20170125141153_add_message_to_alert_statuses.rb delete mode 100644 db/migrate/20170125141953_update_description_in_miq_alert_status.rb delete mode 100644 db/migrate/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager.rb delete mode 100644 db/migrate/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager.rb delete mode 100644 db/migrate/20170203161253_add_scm_attributes_to_configuration_script_source.rb delete mode 100644 db/migrate/20170206210552_add_options_column_to_authentication.rb delete mode 100644 db/migrate/20170207173837_set_service_display_and_retired_to_false.rb delete mode 100644 db/migrate/20170207200029_add_sti_type_to_configuration_script_source.rb delete mode 100644 db/migrate/20170207215322_fix_vpor_time_profile_ids.rb delete mode 100644 db/migrate/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type.rb delete mode 100644 db/migrate/20170209203904_orchestration_stack_enhancements_for_ansible_service_provision.rb delete mode 100644 db/migrate/20170209211017_join_authentication_orchestration_stack.rb delete mode 100644 db/migrate/20170216124055_add_name_to_cloud_object_store_container.rb delete mode 100644 db/migrate/20170216132118_add_health_state_property_to_physical_server.rb delete mode 100644 db/migrate/20170217085547_add_type_to_cloud_object_store_container.rb delete mode 100644 db/migrate/20170217163547_migrate_tower_job_sti_type_to_automation_manager.rb delete mode 100644 db/migrate/20170217170604_add_times_to_orchestration_stack_resources.rb delete mode 100644 db/migrate/20170217184205_add_power_state_property_to_physical_server.rb delete mode 100644 db/migrate/20170217194936_add_properties_to_physical_servers.rb delete mode 100644 db/migrate/20170217220618_remove_central_admin_region_auth_records.rb delete mode 100644 db/migrate/20170222105117_remove_openshift_enterprise_provider.rb delete mode 100644 db/migrate/20170222192610_create_firmwares.rb delete mode 100644 db/migrate/20170222214902_add_initiator_to_service.rb delete mode 100644 db/migrate/20170223135511_add_name_to_cloud_object_store_object.rb delete mode 100644 db/migrate/20170223135521_add_type_to_cloud_object_store_object.rb delete mode 100644 db/migrate/20170303180033_add_physical_server_id_to_hosts.rb delete mode 100644 db/migrate/20170303192951_remove_field_archive_form_jobs.rb delete mode 100644 db/migrate/20170303213837_remove_field_code_from_jobs.rb delete mode 100644 db/migrate/20170307203433_migrate_configuration_script_to_base.rb delete mode 100644 db/migrate/20170309111313_add_resolved_to_alerts.rb delete mode 100644 db/migrate/20170309125642_add_alert_ems_ref.rb delete mode 100644 db/migrate/20170313142647_add_raw_power_state_to_physical_server.rb delete mode 100644 db/migrate/20170313160354_remove_ancestry_from_alerts.rb delete mode 100644 db/migrate/20170313170754_add_mas_assignee.rb delete mode 100644 db/migrate/20170315082311_update_o_virt_api_path.rb delete mode 100644 db/migrate/20170315095936_update_persistent_volumes_parent_type.rb delete mode 100644 db/migrate/20170316200500_remove_agent_state_from_jobs.rb delete mode 100644 db/migrate/20170317134007_remove_agent_class_from_jobs.rb delete mode 100644 db/migrate/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table.rb delete mode 100644 db/migrate/20170320195659_remove_oid_integer_args_from_miq_queue.rb delete mode 100644 db/migrate/20170320195660_add_status_to_configuration_script_source.rb delete mode 100644 db/migrate/20170324124452_add_vendor_property_to_physical_server.rb delete mode 100644 db/migrate/20170328110106_fix_expression_in_tenant_quota_report.rb delete mode 100644 db/migrate/20170330234701_create_event_streams_index_availability_zone.rb delete mode 100644 db/migrate/20170404213245_add_loc_led_state_to_physical_servers.rb delete mode 100644 db/migrate/20170405192333_delete_miq_replication_worker.rb delete mode 100644 db/migrate/20170409083720_add_enabled_field_to_ems.rb delete mode 100644 db/migrate/20170410055056_add_iops_and_encrypted_to_cloud_volume.rb delete mode 100644 db/migrate/20170410130134_copy_server_id_from_jobs_to_miq_tasks.rb delete mode 100644 db/migrate/20170417185038_remove_process_column_from_jobs.rb delete mode 100644 db/migrate/20170418141731_drop_arbitration_tables.rb delete mode 100644 db/migrate/20170419154137_remove_deleted_migration_timestamps.rb delete mode 100644 db/migrate/20170420124055_update_policy_seed.rb delete mode 100644 db/migrate/20170421193150_add_embedded_methods_to_miq_ae_method.rb delete mode 100644 db/migrate/20170425154145_add_sti_to_middlewares.rb delete mode 100644 db/migrate/20170425185231_create_asset_details.rb delete mode 100644 db/migrate/20170427152006_remove_invalid_hawkular_endpoints.rb delete mode 100644 db/migrate/20170509224500_remove_agent_name_from_jobs.rb delete mode 100644 db/migrate/20170509230548_remove_agent_id_from_jobs.rb delete mode 100644 db/migrate/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task.rb delete mode 100644 db/migrate/20170511120047_remove_container_group_failed_sync_event.rb delete mode 100644 db/migrate/20170512233333_drop_miq_server_rhn_mirror.rb delete mode 100644 db/migrate/20170516230854_cockpit_ws.rb delete mode 100644 db/migrate/20170517185419_add_physical_server_id_to_event_parser.rb delete mode 100644 db/migrate/20170519003257_remove_cim_ontap_storage_tables.rb delete mode 100644 db/migrate/20170519153350_add_showback_models.rb delete mode 100644 db/migrate/20170519173044_remove_cim_ontap_records.rb delete mode 100644 db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb delete mode 100644 db/migrate/20170528102055_add_limits_resources_to_containers.rb delete mode 100644 db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb delete mode 100644 db/migrate/20170611130239_add_disconnection_fields_to_container_node.rb delete mode 100644 db/migrate/20170612051535_add_encrypted_to_cloud_volume_snapshot.rb delete mode 100644 db/migrate/20170613144708_add_sti_to_container_image.rb delete mode 100644 db/migrate/20170619161514_add_options_to_ext_management_system.rb delete mode 100644 db/migrate/20170619170148_remove_mirrored_logger_settings.rb delete mode 100644 db/migrate/20170621204151_drop_miq_queue_for_user.rb delete mode 100644 db/migrate/20170622181340_change_showback_column_name.rb delete mode 100644 db/migrate/20170622210452_create_miq_queues_work_label.rb delete mode 100644 db/migrate/20170627135623_update_container_image_types.rb delete mode 100644 db/migrate/20170703094235_add_hash_expression_to_miq_alert.rb delete mode 100644 db/migrate/20170704102506_add_deleted_on_indexes_to_containers_tables.rb delete mode 100644 db/migrate/20170704102536_use_deleted_on_in_containers_tables.rb delete mode 100644 db/migrate/20170705074637_add_object_labels_to_container_templates.rb delete mode 100644 db/migrate/20170706220336_add_sti_to_container_template.rb delete mode 100644 db/migrate/20170707150520_update_container_template_types.rb delete mode 100644 db/migrate/20170707155809_add_stored_data_to_showback_charge.rb delete mode 100644 db/migrate/20170707162731_add_columns_unit_time_to_showback_rate.rb delete mode 100644 db/migrate/20170710080149_remove_ems_ref_from_container_image.rb delete mode 100644 db/migrate/20170710132935_convert_custom_button_to_classes.rb delete mode 100644 db/migrate/20170713083836_rename_applies_to_visibility_expression.rb delete mode 100644 db/migrate/20170713085859_add_enablement_expression_and_disabled_text.rb delete mode 100644 db/migrate/20170713144355_create_dialog_field_associations_table.rb delete mode 100644 db/migrate/20170717084208_add_resource_to_open_scap_result.rb delete mode 100644 db/migrate/20170718111834_unify_container_definition_and_container.rb delete mode 100644 db/migrate/20170720194715_create_middleware_diagnostic_reports.rb delete mode 100644 db/migrate/20170728223124_add_expression_to_entitlements.rb delete mode 100644 db/migrate/20170804184133_create_automate_workspaces.rb delete mode 100644 db/migrate/20170809191203_metrics_sequences.rb delete mode 100644 db/migrate/20170821085511_update_type_of_orchestration_template.rb delete mode 100644 db/migrate/20170827091406_change_container_quota_items_columns_to_float.rb delete mode 100644 db/migrate/20170829220132_migrate_database_role_in_settings.rb delete mode 100644 db/migrate/20170904130801_add_project_id_to_persistent_volume_claims.rb delete mode 100644 db/migrate/20170905210626_create_configuration_templates.rb delete mode 100644 db/migrate/20170908130834_add_serial_number_to_hardware.rb delete mode 100644 db/migrate/20170914082040_showback_tiers.rb delete mode 100644 db/migrate/20170918190738_issue_showback_tiers.rb delete mode 100644 db/migrate/20170919211256_add_parent_id_to_lans.rb delete mode 100644 db/migrate/20170919211745_create_subnets.rb delete mode 100644 db/migrate/20170920212535_add_event_id_to_event_streams.rb delete mode 100644 db/migrate/20170922162503_change_dialog_field_description_from_string_to_text.rb delete mode 100644 db/migrate/20170922172113_rename_provisioning_manager_id_to_manager_id_in_customization_scripts.rb delete mode 100644 db/migrate/20170922205258_add_config_pattern_fields_to_customization_scripts.rb delete mode 100644 db/migrate/20170922212510_add_severity_to_miq_alerts.rb delete mode 100644 db/migrate/20170924102942_add_requests_and_limits_to_persistent_volume_claims.rb delete mode 100644 db/migrate/20170925155201_create_scan_result.rb delete mode 100644 db/migrate/20170927114802_drop_container_component_statuses.rb delete mode 100644 db/migrate/20170927135007_migrate_dialog_field_associations_to_use_new_relationship.rb delete mode 100644 db/migrate/20170928202851_migrate_middleware_server_to_wildfly_and_eap.rb delete mode 100644 db/migrate/20171002181644_add_userid_groupid_tenantid_to_miq_queue.rb delete mode 100644 db/migrate/20171003170751_add_middleware_domain_to_event_streams.rb delete mode 100644 db/migrate/20171009173946_remove_configuration_templates_table.rb delete mode 100644 db/migrate/20171011180000_move_openstack_refresher_settings.rb delete mode 100644 db/migrate/20171013125651_add_sub_metric_to_chargeback_rate_detail.rb delete mode 100644 db/migrate/20171016192352_add_user_to_event_stream.rb delete mode 100644 db/migrate/20171018081206_showback_fix_and_rename.rb delete mode 100644 db/migrate/20171023170841_ensure_cloud_managers.rb delete mode 100644 db/migrate/20171024144122_add_options_to_miq_ae_method.rb delete mode 100644 db/migrate/20171025122732_move_ems_refresh_args_to_data.rb delete mode 100644 db/migrate/20171026103833_add_cores_allocated_rate_detail.rb delete mode 100644 db/migrate/20171026114327_add_deleted_on_to_container_quota_and_items.rb delete mode 100644 db/migrate/20171026142653_create_container_quota_scopes.rb delete mode 100644 db/migrate/20171026152944_drop_blueprints.rb delete mode 100644 db/migrate/20171026190133_add_mtu_to_switches.rb delete mode 100644 db/migrate/20171030131403_fix_hawkular_endpoints_with_port_nil.rb delete mode 100644 db/migrate/data/20160127210624_convert_configurations_to_settings_changes/broker_notify_properties.tmpl.yml delete mode 100644 db/migrate/data/20160127210624_convert_configurations_to_settings_changes/capacity.tmpl.yml delete mode 100644 db/migrate/data/20160127210624_convert_configurations_to_settings_changes/event_handling.tmpl.yml delete mode 100644 db/migrate/data/20160127210624_convert_configurations_to_settings_changes/storage.tmpl.yml delete mode 100644 db/migrate/data/20160127210624_convert_configurations_to_settings_changes/vmdb.tmpl.yml delete mode 100644 spec/migrations/20131107000917_expand_dialog_field_default_value_size_spec.rb delete mode 100644 spec/migrations/20131118232818_encrypt_miq_database_registration_http_proxy_password_field_spec.rb delete mode 100644 spec/migrations/20131121211455_change_options_in_miq_alert_spec.rb delete mode 100644 spec/migrations/20131125153220_import_provision_dialogs_spec.rb delete mode 100644 spec/migrations/20131210202928_update_log_collection_path_in_configurations_settings_spec.rb delete mode 100644 spec/migrations/20131216214850_fix_replication_on_upgrade_from_version_four_spec.rb delete mode 100644 spec/migrations/20140121213913_split_widget_set_name_to_three_columns_spec.rb delete mode 100644 spec/migrations/20140201040548_add_update_repo_name_to_miq_database_spec.rb delete mode 100644 spec/migrations/20140214191729_enhance_firewall_rules_for_neutron_networking_spec.rb delete mode 100644 spec/migrations/20140218232357_add_group_and_user_columns_to_miq_widget_contents_spec.rb delete mode 100644 spec/migrations/20140301034340_leverage_authentications_for_registration_http_proxy_credentials_spec.rb delete mode 100644 spec/migrations/20140402134329_change_utc_time_profile_type_to_global_spec.rb delete mode 100644 spec/migrations/20140409134713_move_log_collection_depot_settings_to_file_depot_spec.rb delete mode 100644 spec/migrations/20140410132430_subclass_file_depot_by_protocol_spec.rb delete mode 100644 spec/migrations/20140421150958_create_miq_groups_users_join_table_spec.rb delete mode 100644 spec/migrations/20140424173120_migrate_automate_to_customer_domain_spec.rb delete mode 100644 spec/migrations/20140519211930_add_user_current_group_to_miq_groups_spec.rb delete mode 100644 spec/migrations/20140611194007_change_options_in_miq_alert_for_email_to_spec.rb delete mode 100644 spec/migrations/20140715200621_set_default_for_pxe_server_customization_directory_spec.rb delete mode 100644 spec/migrations/20140905020643_update_default_registration_channel_names_spec.rb delete mode 100644 spec/migrations/20140918140859_add_cloud_tenant_sti_column_spec.rb delete mode 100644 spec/migrations/20140918154013_add_provider_region_to_ext_management_systems_spec.rb delete mode 100644 spec/migrations/20141015170920_remove_vdi_tab_from_miq_dialogs_spec.rb delete mode 100644 spec/migrations/20141021103820_remove_miq_search_vdi_instances_spec.rb delete mode 100644 spec/migrations/20141121200153_migrate_ems_attributes_to_endpoints_spec.rb delete mode 100644 spec/migrations/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields_spec.rb delete mode 100644 spec/migrations/20141219222843_remove_miq_worker_rows_without_model_spec.rb delete mode 100644 spec/migrations/20150109142457_namespace_ems_classes_spec.rb delete mode 100644 spec/migrations/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves_spec.rb delete mode 100644 spec/migrations/20150224164512_add_loopback_to_memcache_server_opts_in_configuration_spec.rb delete mode 100644 spec/migrations/20150224192716_migrate_configuration_manager_to_ems_spec.rb delete mode 100644 spec/migrations/20150224192816_migrate_provisioning_manager_to_ems_spec.rb delete mode 100644 spec/migrations/20150311181430_add_draft_to_orchestration_templates_spec.rb delete mode 100644 spec/migrations/20150316175916_update_miq_database_default_update_repo_name_spec.rb delete mode 100644 spec/migrations/20150330214408_add_file_depot_id_to_miq_schedule_spec.rb delete mode 100644 spec/migrations/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag_spec.rb delete mode 100644 spec/migrations/20150405141637_remove_port_config_from_container_service_spec.rb delete mode 100644 spec/migrations/20150407144345_add_kerberos_to_ext_management_system_spec.rb delete mode 100644 spec/migrations/20150501193927_default_provider_verify_ssl_spec.rb delete mode 100644 spec/migrations/20150522161336_add_container_entities_type_spec.rb delete mode 100644 spec/migrations/20150604154825_rename_container_node_conditions_to_container_conditions_spec.rb delete mode 100644 spec/migrations/20150625220141_fix_serialized_reports_for_rails_four_spec.rb delete mode 100644 spec/migrations/20150630100251_namespace_ems_amazon_spec.rb delete mode 100644 spec/migrations/20150714053019_namespace_ems_redhat_spec.rb delete mode 100644 spec/migrations/20150714143821_remove_ui_tasks_and_ui_task_sets_spec.rb delete mode 100644 spec/migrations/20150716021334_fix_redhat_namespace_spec.rb delete mode 100644 spec/migrations/20150724030353_namespace_ems_foreman_spec.rb delete mode 100644 spec/migrations/20150731025210_namespace_ems_openstack_spec.rb delete mode 100644 spec/migrations/20150806190149_rename_miq_event_table_to_miq_event_definition_spec.rb delete mode 100644 spec/migrations/20150806194147_migrate_filtered_events_to_blacklisted_events_spec.rb delete mode 100644 spec/migrations/20150806211453_rename_ems_event_table_to_event_stream_spec.rb delete mode 100644 spec/migrations/20150807165254_namespace_ems_container_spec.rb delete mode 100644 spec/migrations/20150815051916_namespace_ems_microsoft_spec.rb delete mode 100644 spec/migrations/20150815052719_fix_foreman_provider_type_spec.rb delete mode 100644 spec/migrations/20150817213409_clear_tenant_seed_spec.rb delete mode 100644 spec/migrations/20150818181427_update_tenant_divisible_on_existing_rows_spec.rb delete mode 100644 spec/migrations/20150822102141_fix_more_foreman_types_spec.rb delete mode 100644 spec/migrations/20150823120001_namespace_ems_openstack_availability_zones_null_spec.rb delete mode 100644 spec/migrations/20150824130000_update_tenant_override_settings_spec.rb delete mode 100644 spec/migrations/20150903162623_assign_tenant_spec.rb delete mode 100644 spec/migrations/20150904181202_miq_groups_add_ldap_role_spec.rb delete mode 100644 spec/migrations/20150907095639_add_container_image_digest_spec.rb delete mode 100644 spec/migrations/20150907163347_confirm_all_class_renames_spec.rb delete mode 100644 spec/migrations/20150909023532_namespace_ems_azure_spec.rb delete mode 100644 spec/migrations/20150914202922_correct_user_created_role_feature_sets_spec.rb delete mode 100644 spec/migrations/20150915001329_assign_tenant_to_miq_request_spec.rb delete mode 100644 spec/migrations/20150921204114_add_vmware_ro_datastores_to_hosts_storages_spec.rb delete mode 100644 spec/migrations/20151019194111_tenant_cfg_not_nil_spec.rb delete mode 100644 spec/migrations/20151021093644_set_correct_sti_type_on_cloud_network_spec.rb delete mode 100644 spec/migrations/20151021095831_set_correct_sti_type_on_cloud_subnet_spec.rb delete mode 100644 spec/migrations/20151021104529_add_persistent_volumes_to_container_volumes_spec.rb delete mode 100644 spec/migrations/20151021174140_assign_tenant_default_group_spec.rb delete mode 100644 spec/migrations/20151026170631_set_miq_groups_group_type_spec.rb delete mode 100644 spec/migrations/20151026220722_assign_vm_group_spec.rb delete mode 100644 spec/migrations/20151030201919_fix_miq_group_sequences_spec.rb delete mode 100644 spec/migrations/20151104120951_transfer_rate_value_to_tiers_spec.rb delete mode 100644 spec/migrations/20151111165020_rename_miq_search_db_spec.rb delete mode 100644 spec/migrations/20151119202643_update_default_update_repo_names_spec.rb delete mode 100644 spec/migrations/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template_spec.rb delete mode 100644 spec/migrations/20151204143045_set_correct_sti_type_on_openstack_cloud_volume_spec.rb delete mode 100644 spec/migrations/20151208150956_fix_host_storage_replication_on_upgrade_spec.rb delete mode 100644 spec/migrations/20151221134925_remove_sat5_repo_config_spec.rb delete mode 100644 spec/migrations/20151222103721_migrate_provider_attributes_to_endpoints_spec.rb delete mode 100644 spec/migrations/20151222152212_remove_vm_discover_row_from_miq_event_definitions_spec.rb delete mode 100644 spec/migrations/20160115111829_chargeback_rate_detail_currency_not_nil_spec.rb delete mode 100644 spec/migrations/20160115142023_remove_replicated_rows_from_newly_excluded_tables_spec.rb delete mode 100644 spec/migrations/20160119125950_add_created_on_for_container_entities_spec.rb delete mode 100644 spec/migrations/20160120151642_migrate_url_from_provider_to_endpoints_spec.rb delete mode 100644 spec/migrations/20160127210622_migrate_old_configuration_settings_spec.rb delete mode 100644 spec/migrations/20160127210624_convert_configurations_to_settings_changes_spec.rb delete mode 100644 spec/migrations/20160203101130_add_orderable_to_orchestration_templates_spec.rb delete mode 100644 spec/migrations/20160214115800_inline_ems_id_spec.rb delete mode 100644 spec/migrations/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager_spec.rb delete mode 100644 spec/migrations/20160302203922_remove_is_datacenter_from_ems_folder_spec.rb delete mode 100644 spec/migrations/20160307205816_fix_event_class_for_evm_alert_event_spec.rb delete mode 100644 spec/migrations/20160308093916_migrate_security_protocol_atribute_to_endpoints_spec.rb delete mode 100644 spec/migrations/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets_spec.rb delete mode 100644 spec/migrations/20160309223941_add_process_to_miq_requests_spec.rb delete mode 100644 spec/migrations/20160310170333_add_service_ancestry_spec.rb delete mode 100644 spec/migrations/20160317160230_move_user_roles_to_entitlements_spec.rb delete mode 100644 spec/migrations/20160317194215_remove_miq_user_role_from_miq_groups_spec.rb delete mode 100644 spec/migrations/20160322195653_move_switch_host_to_jointable_spec.rb delete mode 100644 spec/migrations/20160322205357_remove_host_id_from_switch_spec.rb delete mode 100644 spec/migrations/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet_spec.rb delete mode 100644 spec/migrations/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager_spec.rb delete mode 100644 spec/migrations/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet_spec.rb delete mode 100644 spec/migrations/20160324131349_add_hidden_to_ems_folders_spec.rb delete mode 100644 spec/migrations/20160328204930_remove_miq_server_product_update_join_table_spec.rb delete mode 100644 spec/migrations/20160405151142_remove_configurations_from_replication_excludes_spec.rb delete mode 100644 spec/migrations/20160406072945_separate_azure_network_manager_from_azure_cloud_manager_spec.rb delete mode 100644 spec/migrations/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet_spec.rb delete mode 100644 spec/migrations/20160406195810_add_id_primary_key_to_join_tables_spec.rb delete mode 100644 spec/migrations/20160413191759_correct_sti_type_on_cloud_resource_quota_spec.rb delete mode 100644 spec/migrations/20160413202128_sti_configuration_script_spec.rb delete mode 100644 spec/migrations/20160414094300_change_capacity_to_hash_from_persistent_volume_spec.rb delete mode 100644 spec/migrations/20160418141210_add_read_only_to_miq_alert_spec.rb delete mode 100644 spec/migrations/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports_spec.rb delete mode 100644 spec/migrations/20160425161234_remove_deleted_tables_from_replication_settings_spec.rb delete mode 100644 spec/migrations/20160425161235_correct_sti_type_on_cloud_tenant_spec.rb delete mode 100644 spec/migrations/20160425161456_update_default_yum_repo_name_for56_spec.rb delete mode 100644 spec/migrations/20160428215825_move_filters_to_entitlements_spec.rb delete mode 100644 spec/migrations/20160607141810_remove_database_synchronization_role_spec.rb delete mode 100644 spec/migrations/20160607141857_change_exclude_table_settings_key_spec.rb delete mode 100644 spec/migrations/20160627074242_separate_google_network_manager_from_google_cloud_manager_spec.rb delete mode 100644 spec/migrations/20160628140841_fix_service_order_placed_at_spec.rb delete mode 100644 spec/migrations/20160708182331_remove_replication_worker_settings_spec.rb delete mode 100644 spec/migrations/20160713141244_upgrade_host_storage_from_reserved_spec.rb delete mode 100644 spec/migrations/20160729182517_remove_system_add_source_to_miq_ae_namespace_spec.rb delete mode 100644 spec/migrations/20160802145938_set_generic_subtype_on_service_template_spec.rb delete mode 100644 spec/migrations/20160825070810_fix_null_verify_ssl_on_endpoints_spec.rb delete mode 100644 spec/migrations/20160825152940_fix_port_zero_on_enpoints_spec.rb delete mode 100644 spec/migrations/20160826184028_add_notification_tables_to_replication_excludes_spec.rb delete mode 100644 spec/migrations/20160829134746_remove_atomic_container_providers_spec.rb delete mode 100644 spec/migrations/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener_spec.rb delete mode 100644 spec/migrations/20160911130449_add_value_serialized_to_custom_attribute_spec.rb delete mode 100644 spec/migrations/20160913195129_move_repo_data_from_database_to_settings_spec.rb delete mode 100644 spec/migrations/20160923000000_remove_replication_excludes_from_settings_spec.rb delete mode 100644 spec/migrations/20161101174139_rename_ems_events_purging_settings_keys_spec.rb delete mode 100644 spec/migrations/20161213140739_remove_remote_api_settings_spec.rb delete mode 100644 spec/migrations/20170109142011_extract_field_data_from_rate_detail_spec.rb delete mode 100644 spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb delete mode 100644 spec/migrations/20170120164058_create_task_for_each_job_and_transfer_attributes_spec.rb delete mode 100644 spec/migrations/20170125141953_update_description_in_miq_alert_status_spec.rb delete mode 100644 spec/migrations/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager_spec.rb delete mode 100644 spec/migrations/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager_spec.rb delete mode 100644 spec/migrations/20170207173837_set_service_display_and_retired_to_false_spec.rb delete mode 100644 spec/migrations/20170207215322_fix_vpor_time_profile_ids_spec.rb delete mode 100644 spec/migrations/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type_spec.rb delete mode 100644 spec/migrations/20170217163547_migrate_tower_job_sti_type_to_automation_manager_spec.rb delete mode 100644 spec/migrations/20170217220618_remove_central_admin_region_auth_records_spec.rb delete mode 100644 spec/migrations/20170222105117_remove_openshift_enterprise_provider_spec.rb delete mode 100644 spec/migrations/20170222214902_add_initiator_to_service_spec.rb delete mode 100644 spec/migrations/20170307203433_migrate_configuration_script_to_base_spec.rb delete mode 100644 spec/migrations/20170315082311_update_o_virt_api_path_spec.rb delete mode 100644 spec/migrations/20170315095936_update_persistent_volumes_parent_type_spec.rb delete mode 100644 spec/migrations/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table_spec.rb delete mode 100644 spec/migrations/20170320195659_remove_oid_integer_args_from_miq_queue_spec.rb delete mode 100644 spec/migrations/20170328110106_fix_expression_in_tenant_quota_report_spec.rb delete mode 100644 spec/migrations/20170405192333_delete_miq_replication_worker_spec.rb delete mode 100644 spec/migrations/20170409083720_add_enabled_field_to_ems_spec.rb delete mode 100644 spec/migrations/20170410130134_copy_server_id_from_jobs_to_miq_tasks_spec.rb delete mode 100644 spec/migrations/20170420124055_update_policy_seed_spec.rb delete mode 100644 spec/migrations/20170421193150_add_embedded_methods_to_miq_ae_method_spec.rb delete mode 100644 spec/migrations/20170425154145_add_sti_to_middlewares_spec.rb delete mode 100644 spec/migrations/20170427152006_remove_invalid_hawkular_endpoints_spec.rb delete mode 100644 spec/migrations/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task_spec.rb delete mode 100644 spec/migrations/20170511120047_remove_container_group_failed_sync_event_spec.rb delete mode 100644 spec/migrations/20170512233333_drop_miq_server_rhn_mirror_spec.rb delete mode 100644 spec/migrations/20170519173044_remove_cim_ontap_records_spec.rb delete mode 100644 spec/migrations/20170619161514_add_options_to_ext_management_system_spec.rb delete mode 100644 spec/migrations/20170619170148_remove_mirrored_logger_settings_spec.rb delete mode 100644 spec/migrations/20170627135623_update_container_image_types_spec.rb delete mode 100644 spec/migrations/20170703094235_add_hash_expression_to_miq_alert_spec.rb delete mode 100644 spec/migrations/20170704102536_use_deleted_on_in_containers_tables_spec.rb delete mode 100644 spec/migrations/20170707150520_update_container_template_types_spec.rb delete mode 100644 spec/migrations/20170710132935_convert_custom_button_to_classes_spec.rb delete mode 100644 spec/migrations/20170718111834_unify_container_definition_and_container_spec.rb delete mode 100644 spec/migrations/20170821085511_update_type_of_orchestration_template_spec.rb delete mode 100644 spec/migrations/20170827091406_change_container_quota_items_columns_to_float_spec.rb delete mode 100644 spec/migrations/20170829220132_migrate_database_role_in_settings_spec.rb delete mode 100644 spec/migrations/20170927135007_migrate_dialog_field_associations_to_use_new_relationship_spec.rb delete mode 100644 spec/migrations/20170928202851_migrate_middleware_server_to_wildfly_and_eap_spec.rb delete mode 100644 spec/migrations/20171011180000_move_openstack_refresher_settings_spec.rb delete mode 100644 spec/migrations/20171023170841_ensure_cloud_managers_spec.rb delete mode 100644 spec/migrations/20171025122732_move_ems_refresh_args_to_data_spec.rb delete mode 100644 spec/migrations/20171026103833_add_cores_allocated_rate_detail_spec.rb delete mode 100644 spec/migrations/20171026114327_add_deleted_on_to_container_quota_and_items_spec.rb delete mode 100644 spec/migrations/20171030131403_fix_hawkular_endpoints_with_port_nil_spec.rb delete mode 100644 spec/migrations/data/20131125153220_import_provision_dialogs_spec/miq_provision_dialogs.rb delete mode 100644 spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_csv.yaml delete mode 100644 spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_hash.yaml delete mode 100644 spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_obj.yaml delete mode 100644 spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_hash.yaml delete mode 100644 spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_obj.yaml delete mode 100644 spec/migrations/data/20160127210624_convert_configurations_to_settings_changes_spec/simple.tmpl.yml diff --git a/db/migrate/20130923182042_collapsed_initial_migration.rb b/db/migrate/20130923182042_collapsed_initial_migration.rb deleted file mode 100644 index 14882f9f3..000000000 --- a/db/migrate/20130923182042_collapsed_initial_migration.rb +++ /dev/null @@ -1,3714 +0,0 @@ -class CollapsedInitialMigration < ActiveRecord::Migration[4.2] - include MigrationHelper - - def up - create_table "accounts" do |t| - t.string "name" - t.integer "acctid" - t.string "homedir" - t.boolean "local" - t.string "domain" - t.string "accttype" - t.bigint "vm_or_template_id" - t.string "display_name" - t.string "comment" - t.string "expires" - t.boolean "enabled" - t.datetime "last_logon" - t.bigint "host_id" - end - - add_index "accounts", ["accttype"], :name => "index_accounts_on_accttype" - add_index "accounts", ["host_id"], :name => "index_accounts_on_host_id" - add_index "accounts", ["vm_or_template_id"], :name => "index_accounts_on_vm_id" - - create_table "advanced_settings" do |t| - t.string "name" - t.string "display_name" - t.string "description" - t.text "value" - t.string "default_value" - t.string "min" - t.string "max" - t.boolean "read_only" - t.string "resource_type" - t.bigint "resource_id" - t.datetime "created_on" - t.datetime "updated_on" - end - - add_index "advanced_settings", ["resource_id", "resource_type"], :name => "index_advanced_settings_on_resource_id_and_resource_type" - - create_table "assigned_server_roles" do |t| - t.bigint "miq_server_id" - t.bigint "server_role_id" - t.boolean "active" - t.integer "priority" - end - - add_index "assigned_server_roles", ["miq_server_id"], :name => "index_assigned_server_roles_on_miq_server_id" - add_index "assigned_server_roles", ["server_role_id"], :name => "index_assigned_server_roles_on_server_role_id" - - create_table "audit_events" do |t| - t.string "event" - t.string "status" - t.text "message" - t.string "severity" - t.bigint "target_id" - t.string "target_class" - t.string "userid" - t.string "source" - t.datetime "created_on" - end - - add_index "audit_events", ["target_id", "target_class"], :name => "index_audit_events_on_target_id_and_target_class" - - create_table "authentications" do |t| - t.string "name" - t.string "authtype" - t.string "userid" - t.string "password" - t.bigint "resource_id" - t.string "resource_type" - t.datetime "created_on" - t.datetime "updated_on" - t.datetime "last_valid_on" - t.datetime "last_invalid_on" - t.datetime "credentials_changed_on" - t.string "status" - t.string "status_details" - t.string "type" - t.text "auth_key" - t.string "fingerprint" - end - - add_index "authentications", ["resource_id", "resource_type"], :name => "index_authentications_on_resource_id_and_resource_type" - - create_table "availability_zones" do |t| - t.bigint "ems_id" - t.string "name" - t.string "ems_ref" - t.string "type" - end - - add_index "availability_zones", ["ems_id"], :name => "index_availability_zones_on_ems_id" - - create_table "binary_blob_parts" do |t| - t.string "md5" - t.binary "data" - t.bigint "binary_blob_id" - t.decimal "size", :precision => 20, :scale => 0 - end - - add_index "binary_blob_parts", ["binary_blob_id"], :name => "index_binary_blob_parts_on_binary_blob_id" - - create_table "binary_blobs" do |t| - t.string "resource_type" - t.bigint "resource_id" - t.string "md5" - t.decimal "size", :precision => 20, :scale => 0 - t.decimal "part_size", :precision => 20, :scale => 0 - t.string "name" - t.string "data_type" - end - - add_index "binary_blobs", ["resource_id", "resource_type"], :name => "index_binary_blobs_on_resource_id_and_resource_type" - - create_table "bottleneck_events" do |t| - t.datetime "timestamp" - t.datetime "created_on" - t.string "resource_name" - t.string "resource_type" - t.bigint "resource_id" - t.string "event_type" - t.integer "severity" - t.string "message" - t.text "context_data" - t.boolean "future" - end - - add_index "bottleneck_events", ["resource_id", "resource_type"], :name => "index_bottleneck_events_on_resource_id_and_resource_type" - - create_table "chargeback_rate_details" do |t| - t.boolean "enabled", :default => true - t.string "description" - t.string "group" - t.string "source" - t.string "metric" - t.string "rate" - t.string "per_time" - t.string "per_unit" - t.string "friendly_rate" - t.bigint "chargeback_rate_id" - t.datetime "created_on" - t.datetime "updated_on" - end - - add_index "chargeback_rate_details", ["chargeback_rate_id"], :name => "index_chargeback_rate_details_on_chargeback_rate_id" - - create_table "chargeback_rates" do |t| - t.string "guid", :limit => 36 - t.string "description" - t.string "rate_type" - t.datetime "created_on" - t.datetime "updated_on" - t.boolean "default", :default => false - end - - create_table "classifications" do |t| - t.text "description" - t.string "icon" - t.boolean "read_only" - t.string "syntax" - t.boolean "single_value" - t.text "example_text" - t.bigint "tag_id" - t.bigint "parent_id", :default => 0 - t.boolean "show" - t.boolean "default" - t.boolean "perf_by_tag" - end - - add_index "classifications", ["parent_id"], :name => "index_classifications_on_parent_id" - add_index "classifications", ["tag_id"], :name => "index_classifications_on_tag_id" - - create_table "cloud_networks" do |t| - t.string "name" - t.string "ems_ref" - t.bigint "ems_id" - t.string "cidr" - end - - create_table "cloud_subnets" do |t| - t.string "name" - t.string "ems_ref" - t.bigint "ems_id" - t.bigint "availability_zone_id" - t.bigint "cloud_network_id" - t.string "cidr" - t.string "status" - end - - create_table "cloud_volume_snapshots" do |t| - t.string "type" - t.string "ems_ref" - t.bigint "ems_id" - t.bigint "cloud_volume_id" - t.string "name" - t.string "description" - end - - create_table "cloud_volumes" do |t| - t.string "type" - t.string "ems_ref" - t.string "device_name" - t.bigint "size" - t.bigint "ems_id" - t.bigint "availability_zone_id" - t.bigint "cloud_volume_snapshot_id" - t.bigint "vm_id" - t.string "name" - end - - create_table "compliance_details" do |t| - t.bigint "compliance_id" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "miq_policy_id" - t.string "miq_policy_desc" - t.boolean "miq_policy_result" - t.bigint "condition_id" - t.string "condition_desc" - t.boolean "condition_result" - end - - add_index "compliance_details", ["compliance_id"], :name => "index_compliance_details_on_compliance_id" - add_index "compliance_details", ["condition_id"], :name => "index_compliance_details_on_condition_id" - add_index "compliance_details", ["miq_policy_id"], :name => "index_compliance_details_on_miq_policy_id" - - create_table "compliances" do |t| - t.bigint "resource_id" - t.string "resource_type" - t.boolean "compliant" - t.datetime "timestamp" - t.datetime "updated_on" - t.string "event_type" - end - - add_index "compliances", ["resource_id", "resource_type"], :name => "index_compliances_on_resource_id_and_resource_type" - - create_table "conditions" do |t| - t.string "name" - t.string "description" - t.string "modifier" - t.text "expression" - t.string "towhat" - t.datetime "file_mtime" - t.datetime "created_on" - t.datetime "updated_on" - t.string "guid", :limit => 36 - t.string "filename" - t.text "applies_to_exp" - t.bigint "miq_policy_id" - t.string "notes", :limit => 512 - end - - add_index "conditions", ["guid"], :name => "index_conditions_on_guid", :unique => true - add_index "conditions", ["miq_policy_id"], :name => "index_conditions_on_miq_policy_id" - - create_table "conditions_miq_policies", :id => false do |t| - t.bigint "miq_policy_id" - t.bigint "condition_id" - end - - create_table "configurations" do |t| - t.bigint "miq_server_id" - t.string "typ" - t.text "settings" - t.datetime "created_on" - t.datetime "updated_on" - end - - add_index "configurations", ["miq_server_id"], :name => "index_configurations_on_miq_server_id" - - create_table "custom_attributes" do |t| - t.string "section" - t.string "name" - t.string "value" - t.string "resource_type" - t.bigint "resource_id" - t.string "source" - end - - add_index "custom_attributes", ["resource_id", "resource_type"], :name => "index_custom_attributes_on_resource_id_and_resource_type" - - create_table "custom_buttons" do |t| - t.string "guid", :limit => 36 - t.string "description" - t.string "applies_to_class" - t.text "applies_to_exp" - t.text "options" - t.string "userid" - t.boolean "wait_for_complete" - t.datetime "created_on" - t.datetime "updated_on" - t.string "name" - t.text "visibility" - t.bigint "applies_to_id" - end - - create_table "customization_specs" do |t| - t.string "name" - t.bigint "ems_id" - t.string "typ" - t.text "description" - t.datetime "last_update_time" - t.text "spec" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "customization_specs", ["ems_id"], :name => "index_customization_specs_on_ems_id" - - create_table "customization_templates" do |t| - t.string "name" - t.string "description" - t.text "script" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "pxe_image_type_id" - t.string "type" - t.boolean "system" - end - - create_table "database_backups" do |t| - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "miq_region_id" - end - - add_index "database_backups", ["miq_region_id"], :name => "index_database_backups_on_miq_region_id" - - create_table "dialog_fields" do |t| - t.string "name" - t.string "description" - t.string "type" - t.string "data_type" - t.string "notes" - t.string "notes_display" - t.string "display" - t.string "display_method" - t.text "display_method_options" - t.boolean "required" - t.string "required_method" - t.text "required_method_options" - t.string "default_value" - t.text "values" - t.string "values_method" - t.text "values_method_options" - t.text "options" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "label" - t.bigint "dialog_group_id" - t.integer "position" - end - - create_table "dialog_groups" do |t| - t.string "description" - t.string "display" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "label" - t.string "display_method" - t.text "display_method_options" - t.bigint "dialog_tab_id" - t.integer "position" - end - - create_table "dialog_tabs" do |t| - t.string "description" - t.string "display" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "label" - t.string "display_method" - t.text "display_method_options" - t.bigint "dialog_id" - t.integer "position" - end - - create_table "dialogs" do |t| - t.string "description" - t.string "buttons" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "label" - end - - create_table "disks" do |t| - t.string "device_name" - t.string "device_type" - t.string "location" - t.string "filename" - t.bigint "hardware_id" - t.string "mode" - t.string "controller_type" - t.bigint "size" - t.bigint "free_space" - t.bigint "size_on_disk" - t.boolean "present", :default => true - t.boolean "start_connected", :default => true - t.boolean "auto_detect" - t.datetime "created_on" - t.datetime "updated_on" - t.string "disk_type" - t.bigint "storage_id" - end - - add_index "disks", ["device_name"], :name => "index_disks_on_device_name" - add_index "disks", ["device_type"], :name => "index_disks_on_device_type" - add_index "disks", ["hardware_id"], :name => "index_disks_on_hardware_id" - add_index "disks", ["storage_id"], :name => "index_disks_on_storage_id" - - create_table "drift_states" do |t| - t.datetime "timestamp" - t.bigint "resource_id" - t.string "resource_type" - t.text "data" - end - - add_index "drift_states", ["resource_id", "resource_type", "timestamp"], :name => "index_states_on_resource_id_and_resource_type_and_timestamp" - add_index "drift_states", ["timestamp"], :name => "index_drift_states_on_timestamp" - - create_table "ems_clusters" do |t| - t.string "name" - t.bigint "ems_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "uid_ems" - t.boolean "ha_enabled" - t.boolean "ha_admit_control" - t.integer "ha_max_failures" - t.boolean "drs_enabled" - t.string "drs_automation_level" - t.integer "drs_migration_threshold" - t.datetime "last_perf_capture_on" - t.string "ems_ref_obj" - t.bigint "effective_cpu" - t.bigint "effective_memory" - t.string "ems_ref" - end - - add_index "ems_clusters", ["ems_id"], :name => "index_ems_clusters_on_ems_id" - add_index "ems_clusters", ["uid_ems"], :name => "index_ems_clusters_on_uid" - - create_table "ems_events" do |t| - t.string "event_type" - t.text "message" - t.datetime "timestamp" - t.string "host_name" - t.bigint "host_id" - t.string "vm_name" - t.string "vm_location" - t.bigint "vm_or_template_id" - t.string "dest_host_name" - t.bigint "dest_host_id" - t.string "dest_vm_name" - t.string "dest_vm_location" - t.bigint "dest_vm_or_template_id" - t.string "source" - t.bigint "chain_id" - t.bigint "ems_id" - t.boolean "is_task" - t.text "full_data" - t.datetime "created_on" - t.string "username" - t.bigint "ems_cluster_id" - t.string "ems_cluster_name" - t.string "ems_cluster_uid" - t.bigint "dest_ems_cluster_id" - t.string "dest_ems_cluster_name" - t.string "dest_ems_cluster_uid" - t.bigint "vdi_endpoint_device_id" - t.string "vdi_endpoint_device_name" - t.bigint "vdi_controller_id" - t.string "vdi_controller_name" - t.bigint "vdi_user_id" - t.string "vdi_user_name" - t.bigint "vdi_desktop_id" - t.string "vdi_desktop_name" - t.bigint "vdi_desktop_pool_id" - t.string "vdi_desktop_pool_name" - t.bigint "service_id" - t.bigint "availability_zone_id" - end - - add_index "ems_events", ["chain_id", "ems_id"], :name => "index_ems_events_on_chain_id_and_ems_id" - add_index "ems_events", ["dest_host_id"], :name => "index_ems_events_on_dest_host_id" - add_index "ems_events", ["dest_vm_or_template_id"], :name => "index_ems_events_on_dest_vm_id" - add_index "ems_events", ["ems_cluster_id"], :name => "index_ems_events_on_ems_cluster_id" - add_index "ems_events", ["ems_id"], :name => "index_ems_events_on_ems_id" - add_index "ems_events", ["event_type"], :name => "index_ems_events_on_event_type" - add_index "ems_events", ["host_id"], :name => "index_ems_events_on_host_id" - add_index "ems_events", ["service_id"], :name => "index_ems_events_on_service_id" - add_index "ems_events", ["timestamp"], :name => "index_ems_events_on_timestamp" - add_index "ems_events", ["vm_or_template_id"], :name => "index_ems_events_on_vm_id" - - create_table "ems_folders" do |t| - t.string "name" - t.boolean "is_datacenter" - t.bigint "ems_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "uid_ems" - t.string "ems_ref_obj" - t.string "ems_ref" - end - - add_index "ems_folders", ["ems_id"], :name => "index_ems_folders_on_ems_id" - add_index "ems_folders", ["uid_ems"], :name => "index_ems_folders_on_uid" - - create_table "event_logs" do |t| - t.string "name" - t.datetime "generated" - t.text "message" - t.string "uid" - t.bigint "event_id" - t.string "computer_name" - t.string "source" - t.bigint "operating_system_id" - t.string "level" - t.string "category" - end - - add_index "event_logs", ["event_id"], :name => "index_event_logs_on_event_id" - add_index "event_logs", ["operating_system_id"], :name => "index_event_logs_on_operating_system_id" - - create_table "ext_management_systems" do |t| - t.string "name" - t.string "port" - t.string "hostname" - t.string "ipaddress" - t.datetime "created_on" - t.datetime "updated_on" - t.string "guid", :limit => 36 - t.bigint "zone_id" - t.string "type" - t.string "api_version" - t.string "uid_ems" - t.integer "host_default_vnc_port_start" - t.integer "host_default_vnc_port_end" - end - - add_index "ext_management_systems", ["guid"], :name => "index_ext_management_systems_on_guid", :unique => true - - create_table "ext_management_systems_vdi_desktop_pools", :id => false do |t| - t.bigint "ems_id" - t.bigint "vdi_desktop_pool_id" - end - - create_table "file_depots" do |t| - t.string "name" - t.bigint "resource_id" - t.string "resource_type" - t.string "uri" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "file_depots", ["resource_id", "resource_type"], :name => "index_file_depots_on_resource_id_and_resource_type" - - create_table "filesystems" do |t| - t.text "name" - t.string "md5" - t.bigint "size" - t.datetime "atime" - t.datetime "mtime" - t.datetime "ctime" - t.string "rsc_type" - t.text "base_name" - t.bigint "miq_set_id" - t.bigint "scan_item_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "file_version" - t.string "product_version" - t.string "file_version_header" - t.string "product_version_header" - t.string "resource_type" - t.bigint "resource_id" - t.string "permissions" - t.string "owner" - t.string "group" - end - - add_index "filesystems", ["miq_set_id"], :name => "index_filesystems_on_miq_set_id" - add_index "filesystems", ["resource_id", "resource_type"], :name => "index_filesystems_on_resource_id_and_resource_type" - add_index "filesystems", ["scan_item_id"], :name => "index_filesystems_on_scan_item_id" - - create_table "firewall_rules" do |t| - t.string "name" - t.string "display_name" - t.string "group" - t.boolean "enabled" - t.boolean "required" - t.string "protocol" - t.string "direction" - t.integer "port" - t.integer "end_port" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "resource_id" - t.string "resource_type" - t.bigint "source_security_group_id" - t.string "source_ip_range" - end - - add_index "firewall_rules", ["resource_id", "resource_type"], :name => "index_firewall_rules_on_resource_id_and_resource_type" - - create_table "flavors" do |t| - t.bigint "ems_id" - t.string "name" - t.string "description" - t.integer "cpus" - t.integer "cpu_cores" - t.bigint "memory" - t.string "ems_ref" - t.string "type" - t.boolean "supports_32_bit" - t.boolean "supports_64_bit" - t.boolean "enabled" - end - - add_index "flavors", ["ems_id"], :name => "index_flavors_on_ems_id" - - create_table "floating_ips" do |t| - t.string "type" - t.string "ems_ref" - t.string "address" - t.bigint "ems_id" - t.bigint "vm_id" - t.boolean "cloud_network_only" - end - - create_table "guest_applications" do |t| - t.string "name" - t.string "vendor" - t.string "version" - t.text "description" - t.string "package_name" - t.string "product_icon" - t.string "transform" - t.integer "language" - t.string "typename" - t.bigint "vm_or_template_id" - t.string "product_key" - t.string "path", :limit => 512 - t.string "arch" - t.bigint "host_id" - t.string "release" - end - - add_index "guest_applications", ["host_id"], :name => "index_guest_applications_on_host_id" - add_index "guest_applications", ["typename"], :name => "index_guest_applications_on_typename" - add_index "guest_applications", ["vm_or_template_id"], :name => "index_guest_applications_on_vm_id" - - create_table "guest_devices" do |t| - t.string "device_name" - t.string "device_type" - t.string "location" - t.string "filename" - t.bigint "hardware_id" - t.string "mode" - t.string "controller_type" - t.bigint "size" - t.bigint "free_space" - t.bigint "size_on_disk" - t.string "address" - t.bigint "switch_id" - t.bigint "lan_id" - t.string "model" - t.string "iscsi_name" - t.string "iscsi_alias" - t.boolean "present", :default => true - t.boolean "start_connected", :default => true - t.boolean "auto_detect" - t.string "uid_ems" - t.boolean "chap_auth_enabled" - end - - add_index "guest_devices", ["device_name"], :name => "index_guest_devices_on_device_name" - add_index "guest_devices", ["device_type"], :name => "index_guest_devices_on_device_type" - add_index "guest_devices", ["hardware_id"], :name => "index_guest_devices_on_hardware_id" - add_index "guest_devices", ["lan_id"], :name => "index_guest_devices_on_lan_id" - add_index "guest_devices", ["switch_id"], :name => "index_guest_devices_on_switch_id" - - create_table "hardwares" do |t| - t.string "config_version" - t.string "virtual_hw_version" - t.string "guest_os" - t.integer "numvcpus", :default => 1 - t.string "bios" - t.string "bios_location" - t.string "time_sync" - t.text "annotation" - t.bigint "vm_or_template_id" - t.integer "memory_cpu" - t.bigint "host_id" - t.integer "cpu_speed" - t.string "cpu_type" - t.bigint "size_on_disk" - t.string "manufacturer", :default => "" - t.string "model", :default => "" - t.integer "number_of_nics" - t.integer "cpu_usage" - t.integer "memory_usage" - t.integer "cores_per_socket" - t.integer "logical_cpus" - t.boolean "vmotion_enabled" - t.bigint "disk_free_space" - t.bigint "disk_capacity" - t.string "guest_os_full_name" - t.integer "memory_console" - t.integer "bitness" - end - - add_index "hardwares", ["host_id"], :name => "index_hardwares_on_host_id" - add_index "hardwares", ["vm_or_template_id"], :name => "index_hardwares_on_vm_id" - - create_table "hosts" do |t| - t.string "name" - t.string "hostname" - t.string "ipaddress" - t.string "vmm_vendor" - t.string "vmm_version" - t.string "vmm_product" - t.string "vmm_buildnumber" - t.datetime "created_on" - t.datetime "updated_on" - t.string "guid", :limit => 36 - t.bigint "ems_id" - t.string "user_assigned_os" - t.string "power_state", :default => "" - t.integer "smart" - t.string "settings" - t.datetime "last_perf_capture_on" - t.string "uid_ems" - t.string "connection_state" - t.string "ssh_permit_root_login" - t.string "ems_ref_obj" - t.boolean "admin_disabled" - t.string "service_tag" - t.string "asset_tag" - t.string "ipmi_address" - t.string "mac_address" - t.string "type" - t.boolean "failover" - t.string "ems_ref" - t.boolean "hyperthreading" - t.bigint "ems_cluster_id" - t.integer "next_available_vnc_port" - end - - add_index "hosts", ["ems_id"], :name => "index_hosts_on_ems_id" - add_index "hosts", ["guid"], :name => "index_hosts_on_guid", :unique => true - add_index "hosts", ["hostname"], :name => "index_hosts_on_hostname" - add_index "hosts", ["ipaddress"], :name => "index_hosts_on_ipaddress" - - create_table "hosts_storages", :id => false do |t| - t.bigint "storage_id" - t.bigint "host_id" - end - - add_index "hosts_storages", ["host_id", "storage_id"], :name => "index_hosts_storages_on_host_id_and_storage_id", :unique => true - - create_table "iso_datastores" do |t| - t.bigint "ems_id" - t.datetime "last_refresh_on" - end - - create_table "iso_images" do |t| - t.string "name" - t.bigint "iso_datastore_id" - t.bigint "pxe_image_type_id" - end - - create_table "jobs" do |t| - t.string "guid", :limit => 36 - t.string "state" - t.string "status" - t.text "message" - t.string "code" - t.string "name" - t.string "userid" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "target_id" - t.string "target_class" - t.string "type" - t.binary "process" - t.bigint "agent_id" - t.string "agent_class" - t.string "agent_state" - t.text "agent_message" - t.datetime "started_on" - t.string "dispatch_status" - t.string "sync_key" - t.bigint "miq_server_id" - t.string "zone" - t.string "agent_name" - t.boolean "archive" - t.text "options" - t.text "context" - end - - add_index "jobs", ["agent_id", "agent_class"], :name => "index_jobs_on_agent_id_and_agent_class" - add_index "jobs", ["dispatch_status"], :name => "index_jobs_on_dispatch_status" - add_index "jobs", ["guid"], :name => "index_jobs_on_guid", :unique => true - add_index "jobs", ["miq_server_id"], :name => "index_jobs_on_miq_server_id" - add_index "jobs", ["state"], :name => "index_jobs_on_state" - add_index "jobs", ["target_id", "target_class"], :name => "index_jobs_on_target_id_and_target_class" - - create_table "key_pairs_vms", :id => false do |t| - t.bigint "authentication_id" - t.bigint "vm_id" - end - - create_table "lans" do |t| - t.bigint "switch_id" - t.string "name" - t.string "tag" - t.datetime "created_on" - t.datetime "updated_on" - t.string "uid_ems" - t.boolean "allow_promiscuous" - t.boolean "forged_transmits" - t.boolean "mac_changes" - t.boolean "computed_allow_promiscuous" - t.boolean "computed_forged_transmits" - t.boolean "computed_mac_changes" - end - - add_index "lans", ["switch_id"], :name => "index_lans_on_switch_id" - - create_table "ldap_domains" do |t| - t.string "name" - t.string "base_dn" - t.string "user_type" - t.string "user_suffix" - t.integer "bind_timeout" - t.integer "search_timeout" - t.integer "group_membership_max_depth" - t.boolean "get_direct_groups" - t.boolean "follow_referrals" - t.bigint "ldap_domain_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "last_user_sync" - t.datetime "last_group_sync" - t.boolean "get_user_groups" - t.boolean "get_roles_from_home_forest" - t.bigint "ldap_region_id" - end - - add_index "ldap_domains", ["ldap_region_id"], :name => "index_ldap_domains_on_ldap_region_id" - - create_table "ldap_groups" do |t| - t.string "dn" - t.string "display_name" - t.string "whencreated" - t.string "whenchanged" - t.string "mail" - t.bigint "ldap_domain_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ldap_groups", ["ldap_domain_id"], :name => "index_ldap_groups_on_ldap_domain_id" - - create_table "ldap_managements" do |t| - t.bigint "manager_id" - t.bigint "ldap_user_id" - end - - create_table "ldap_regions" do |t| - t.string "name" - t.string "description" - t.bigint "zone_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ldap_regions", ["zone_id"], :name => "index_ldap_regions_on_zone_id" - - create_table "ldap_servers" do |t| - t.string "hostname" - t.string "mode" - t.integer "port" - t.bigint "ldap_domain_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ldap_servers", ["ldap_domain_id"], :name => "index_ldap_servers_on_ldap_domain_id" - - create_table "ldap_users" do |t| - t.string "dn" - t.string "first_name" - t.string "last_name" - t.string "title" - t.string "display_name" - t.string "mail" - t.string "address" - t.string "city" - t.string "state" - t.string "zip" - t.string "country" - t.string "company" - t.string "department" - t.string "office" - t.string "phone" - t.string "phone_home" - t.string "phone_mobile" - t.string "fax" - t.datetime "whencreated" - t.datetime "whenchanged" - t.string "sid" - t.bigint "ldap_domain_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "vdi_user_id" - t.string "sam_account_name" - t.string "upn" - end - - add_index "ldap_users", ["ldap_domain_id"], :name => "index_ldap_users_on_ldap_domain_id" - - create_table "lifecycle_events" do |t| - t.string "guid" - t.string "status" - t.string "event" - t.string "message" - t.string "location" - t.bigint "vm_or_template_id" - t.string "created_by" - t.datetime "created_on" - end - - add_index "lifecycle_events", ["guid"], :name => "index_lifecycle_events_on_guid", :unique => true - add_index "lifecycle_events", ["vm_or_template_id"], :name => "index_lifecycle_events_on_vm_id" - - create_table "log_files" do |t| - t.string "name" - t.string "description" - t.string "resource_type" - t.bigint "resource_id" - t.bigint "miq_task_id" - t.datetime "created_on" - t.datetime "updated_on" - t.datetime "logging_started_on" - t.datetime "logging_ended_on" - t.string "state" - t.boolean "historical" - t.string "log_uri" - end - - add_index "log_files", ["miq_task_id"], :name => "index_log_files_on_miq_task_id" - add_index "log_files", ["resource_id", "resource_type"], :name => "index_log_files_on_resource_id_and_resource_type" - - create_trigger_language # For metrics/metric_rollups inheritance triggers - - create_metrics_table "metrics" - (0..23).each do |n| - s = subtable_name("metrics", n) - create_metrics_table s - add_metrics_indexes s - add_table_inheritance s, "metrics", :conditions => ["capture_interval_name = ? AND EXTRACT(HOUR FROM timestamp) = ?", "realtime", n] - end - add_metrics_inheritance_triggers - - create_metrics_table "metric_rollups" - (1..12).each do |n| - s = subtable_name("metric_rollups", n) - create_metrics_table s - add_metrics_indexes s - add_table_inheritance s, "metric_rollups", :conditions => ["capture_interval_name != ? AND EXTRACT(MONTH FROM timestamp) = ?", "realtime", n] - end - add_metric_rollups_inheritance_triggers - - create_table "miq_actions" do |t| - t.string "name" - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - t.string "guid", :limit => 36 - t.string "action_type" - t.text "options" - end - - add_index "miq_actions", ["guid"], :name => "index_miq_actions_on_guid", :unique => true - - create_table "miq_ae_classes" do |t| - t.text "description" - t.string "display_name" - t.string "name" - t.string "type" - t.string "inherits" - t.string "visibility" - t.string "owner" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "namespace_id" - t.string "updated_by" - t.bigint "updated_by_user_id" - end - - add_index "miq_ae_classes", ["namespace_id"], :name => "index_miq_ae_classes_on_namespace_id" - add_index "miq_ae_classes", ["updated_by_user_id"], :name => "index_miq_ae_classes_on_updated_by_user_id" - - create_table "miq_ae_fields" do |t| - t.string "aetype" - t.string "name" - t.string "display_name" - t.string "datatype" - t.integer "priority" - t.string "owner" - t.text "default_value" - t.boolean "substitute", :default => true, :null => false - t.text "message" - t.string "visibility" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "class_id" - t.text "collect" - t.bigint "method_id" - t.string "scope" - t.text "description" - t.text "condition" - t.text "on_entry" - t.text "on_exit" - t.text "on_error" - t.string "max_retries" - t.string "max_time" - t.string "updated_by" - t.bigint "updated_by_user_id" - end - - add_index "miq_ae_fields", ["class_id"], :name => "index_miq_ae_fields_on_ae_class_id" - add_index "miq_ae_fields", ["method_id"], :name => "index_miq_ae_fields_on_method_id" - add_index "miq_ae_fields", ["updated_by_user_id"], :name => "index_miq_ae_fields_on_updated_by_user_id" - - create_table "miq_ae_instances" do |t| - t.string "display_name" - t.string "name" - t.string "inherits" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "class_id" - t.text "description" - t.string "updated_by" - t.bigint "updated_by_user_id" - end - - add_index "miq_ae_instances", ["class_id"], :name => "index_miq_ae_instances_on_ae_class_id" - add_index "miq_ae_instances", ["updated_by_user_id"], :name => "index_miq_ae_instances_on_updated_by_user_id" - - create_table "miq_ae_methods" do |t| - t.string "name" - t.bigint "class_id" - t.string "display_name" - t.text "description" - t.string "scope" - t.string "language" - t.string "location" - t.text "data" - t.datetime "created_on" - t.datetime "updated_on" - t.string "updated_by" - t.bigint "updated_by_user_id" - end - - add_index "miq_ae_methods", ["class_id"], :name => "index_miq_ae_methods_on_class_id" - add_index "miq_ae_methods", ["updated_by_user_id"], :name => "index_miq_ae_methods_on_updated_by_user_id" - - create_table "miq_ae_namespaces" do |t| - t.bigint "parent_id" - t.string "name" - t.datetime "created_on" - t.datetime "updated_on" - t.text "description" - t.string "display_name" - t.string "updated_by" - t.bigint "updated_by_user_id" - end - - add_index "miq_ae_namespaces", ["parent_id"], :name => "index_miq_ae_namespaces_on_parent_id" - add_index "miq_ae_namespaces", ["updated_by_user_id"], :name => "index_miq_ae_namespaces_on_updated_by_user_id" - - create_table "miq_ae_values" do |t| - t.bigint "instance_id" - t.bigint "field_id" - t.text "value" - t.datetime "created_on" - t.datetime "updated_on" - t.string "display_name" - t.text "condition" - t.text "collect" - t.text "on_entry" - t.text "on_exit" - t.text "on_error" - t.string "max_retries" - t.string "max_time" - t.string "updated_by" - t.bigint "updated_by_user_id" - end - - add_index "miq_ae_values", ["field_id"], :name => "index_miq_ae_values_on_field_id" - add_index "miq_ae_values", ["instance_id"], :name => "index_miq_ae_values_on_instance_id" - add_index "miq_ae_values", ["updated_by_user_id"], :name => "index_miq_ae_values_on_updated_by_user_id" - - create_table "miq_ae_workspaces" do |t| - t.string "guid", :limit => 36 - t.text "uri" - t.text "workspace" - t.text "setters" - t.datetime "created_on" - t.datetime "updated_on" - end - - create_table "miq_alert_statuses" do |t| - t.bigint "miq_alert_id" - t.bigint "resource_id" - t.string "resource_type" - t.datetime "evaluated_on" - t.boolean "result" - end - - add_index "miq_alert_statuses", ["miq_alert_id"], :name => "index_miq_alert_statuses_on_miq_alert_id" - add_index "miq_alert_statuses", ["resource_id", "resource_type"], :name => "index_miq_alert_statuses_on_resource_id_and_resource_type" - - create_table "miq_alerts" do |t| - t.string "guid", :limit => 36 - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - t.text "options" - t.string "db" - t.text "expression" - t.text "responds_to_events" - t.boolean "enabled" - end - - create_table "miq_approvals" do |t| - t.string "description" - t.string "state" - t.string "reason" - t.bigint "miq_request_id" - t.datetime "stamped_on" - t.string "stamper_name" - t.bigint "stamper_id" - t.bigint "approver_id" - t.string "approver_type" - t.string "approver_name" - t.datetime "created_on" - t.datetime "updated_on" - end - - add_index "miq_approvals", ["approver_id", "approver_type"], :name => "index_miq_approvals_on_approver_id_and_approver_type" - add_index "miq_approvals", ["miq_request_id"], :name => "index_miq_approvals_on_miq_request_id" - add_index "miq_approvals", ["stamper_id"], :name => "index_miq_approvals_on_stamper_id" - - create_table "miq_cim_associations" do |t| - t.string "assoc_class" - t.string "result_class" - t.string "role" - t.string "result_role" - t.string "obj_name" - t.string "result_obj_name" - t.bigint "miq_cim_instance_id" - t.bigint "result_instance_id" - t.integer "status" - t.bigint "zone_id" - end - - add_index "miq_cim_associations", ["miq_cim_instance_id", "assoc_class", "role", "result_role"], :name => "index_on_miq_cim_associations_for_gen_query" - add_index "miq_cim_associations", ["miq_cim_instance_id"], :name => "index_miq_cim_associations_on_miq_cim_instance_id" - add_index "miq_cim_associations", ["obj_name", "result_obj_name", "assoc_class"], :name => "index_on_miq_cim_associations_for_point_to_point" - add_index "miq_cim_associations", ["result_instance_id"], :name => "index_miq_cim_associations_on_result_instance_id" - - create_table "miq_cim_derived_metrics" do |t| - t.datetime "statistic_time" - t.integer "interval" - t.float "k_bytes_read_per_sec" - t.float "read_ios_per_sec" - t.float "k_bytes_written_per_sec" - t.float "k_bytes_transferred_per_sec" - t.float "write_ios_per_sec" - t.float "write_hit_ios_per_sec" - t.float "read_hit_ios_per_sec" - t.float "total_ios_per_sec" - t.float "utilization" - t.float "response_time_sec" - t.float "queue_depth" - t.float "service_time_sec" - t.float "wait_time_sec" - t.float "avg_read_size" - t.float "avg_write_size" - t.float "pct_read" - t.float "pct_write" - t.float "pct_hit" - t.bigint "miq_storage_metric_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "miq_cim_derived_metrics", ["miq_storage_metric_id"], :name => "index_miq_cim_derived_metrics_on_miq_storage_metric_id" - - create_table "miq_cim_instances" do |t| - t.string "class_name" - t.string "class_hier", :limit => 1024 - t.string "namespace" - t.string "obj_name_str" - t.text "obj_name" - t.text "obj" - t.integer "last_update_status" - t.boolean "is_top_managed_element" - t.bigint "top_managed_element_id" - t.bigint "agent_top_id" - t.bigint "agent_id" - t.bigint "metric_id" - t.bigint "metric_top_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "vmdb_obj_id" - t.string "vmdb_obj_type" - t.bigint "zone_id" - t.string "source" - t.string "type" - t.text "type_spec_obj" - end - - add_index "miq_cim_instances", ["agent_id"], :name => "index_miq_cim_instances_on_agent_id" - add_index "miq_cim_instances", ["agent_top_id"], :name => "index_miq_cim_instances_on_agent_top_id" - add_index "miq_cim_instances", ["metric_id"], :name => "index_miq_cim_instances_on_metric_id" - add_index "miq_cim_instances", ["metric_top_id"], :name => "index_miq_cim_instances_on_metric_top_id" - add_index "miq_cim_instances", ["obj_name_str"], :name => "index_miq_cim_instances_on_obj_name_str", :unique => true - add_index "miq_cim_instances", ["top_managed_element_id"], :name => "index_miq_cim_instances_on_top_managed_element_id" - add_index "miq_cim_instances", ["type"], :name => "index_miq_cim_instances_on_type" - - create_table "miq_databases" do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "last_replication_count" - t.bigint "last_replication_id" - t.string "registration_type" - t.string "registration_organization" - t.string "registration_server" - t.string "registration_http_proxy_server" - t.string "registration_http_proxy_username" - t.string "registration_http_proxy_password" - t.string "cfme_version_available" - t.boolean "postgres_update_available" - t.string "session_secret_token" - t.string "csrf_secret_token" - end - - create_table "miq_dialogs" do |t| - t.string "name" - t.string "description" - t.string "dialog_type" - t.text "content" - t.boolean "default", :default => false - t.string "filename" - t.datetime "file_mtime" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "miq_enterprises" do |t| - t.string "name" - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - t.text "settings" - end - - create_table "miq_events" do |t| - t.string "name" - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - t.string "guid", :limit => 36 - t.string "event_type" - t.text "definition" - t.boolean "default" - t.boolean "enabled" - end - - add_index "miq_events", ["guid"], :name => "index_miq_events_on_guid", :unique => true - - create_table "miq_globals" do |t| - t.string "section" - t.string "key" - t.text "value" - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - end - - create_table "miq_groups" do |t| - t.string "guid", :limit => 36 - t.string "description" - t.bigint "ui_task_set_id" - t.string "group_type" - t.integer "sequence" - t.string "resource_type" - t.bigint "resource_id" - t.text "filters" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "miq_user_role_id" - t.text "settings" - end - - add_index "miq_groups", ["miq_user_role_id"], :name => "index_miq_groups_on_miq_user_role_id" - add_index "miq_groups", ["resource_id", "resource_type"], :name => "index_miq_groups_on_resource_id_and_resource_type" - add_index "miq_groups", ["ui_task_set_id"], :name => "index_miq_groups_on_ui_task_set_id" - - create_table "miq_license_contents" do |t| - t.text "contents" - t.boolean "active" - t.datetime "created_on" - t.datetime "updated_on" - end - - create_table "miq_policies" do |t| - t.string "name" - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - t.text "expression" - t.string "towhat" - t.string "guid", :limit => 36 - t.string "created_by" - t.string "updated_by" - t.string "notes", :limit => 512 - t.boolean "active" - t.string "mode" - end - - create_table "miq_policy_contents" do |t| - t.bigint "miq_policy_id" - t.bigint "miq_action_id" - t.bigint "miq_event_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "qualifier" - t.integer "success_sequence" - t.integer "failure_sequence" - t.boolean "success_synchronous" - t.boolean "failure_synchronous" - end - - add_index "miq_policy_contents", ["miq_action_id"], :name => "index_miq_policy_contents_on_miq_action_id" - add_index "miq_policy_contents", ["miq_event_id"], :name => "index_miq_policy_contents_on_miq_event_id" - add_index "miq_policy_contents", ["miq_policy_id"], :name => "index_miq_policy_contents_on_miq_policy_id" - - create_table "miq_product_features" do |t| - t.string "identifier" - t.string "name" - t.string "description" - t.string "feature_type" - t.boolean "protected", :default => false - t.bigint "parent_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "miq_product_features", ["parent_id"], :name => "index_miq_product_features_on_parent_id" - - create_table "miq_proxies" do |t| - t.string "guid", :limit => 36 - t.string "name" - t.text "settings" - t.datetime "last_heartbeat" - t.string "version" - t.string "ws_port" - t.bigint "host_id" - t.bigint "vm_id" - t.datetime "created_on" - t.datetime "updated_on" - t.text "capabilities" - t.string "power_state" - t.string "upgrade_status" - t.string "upgrade_message" - t.text "remote_config" - t.string "upgrade_settings" - t.bigint "vdi_farm_id" - end - - add_index "miq_proxies", ["guid"], :name => "index_miq_proxies_on_guid", :unique => true - add_index "miq_proxies", ["host_id"], :name => "index_miq_proxies_on_host_id" - add_index "miq_proxies", ["vdi_farm_id"], :name => "index_miq_proxies_on_vdi_farm_id" - add_index "miq_proxies", ["vm_id"], :name => "index_miq_proxies_on_vm_id" - - create_table "miq_proxies_product_updates", :id => false do |t| - t.bigint "product_update_id" - t.bigint "miq_proxy_id" - end - - create_table "miq_queue" do |t| - t.bigint "target_id" - t.integer "priority" - t.string "method_name" - t.string "state" - t.datetime "created_on" - t.datetime "updated_on" - t.integer "lock_version", :default => 0 - t.string "task_id" - t.string "md5" - t.datetime "deliver_on" - t.string "queue_name" - t.string "class_name" - t.bigint "instance_id" - t.text "args" - t.text "miq_callback" - t.binary "msg_data" - t.string "zone" - t.string "role" - t.string "server_guid", :limit => 36 - t.integer "msg_timeout" - t.bigint "handler_id" - t.string "handler_type" - t.string "for_user" - t.bigint "for_user_id" - t.datetime "expires_on" - end - - add_index "miq_queue", ["state", "zone", "task_id", "queue_name", "role", "server_guid", "deliver_on", "priority", "id"], :name => "miq_queue_idx" - - create_table "miq_regions" do |t| - t.integer "region" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "description" - t.string "guid", :limit => 36 - end - - create_table "miq_report_result_details" do |t| - t.bigint "miq_report_result_id" - t.string "data_type" - t.text "data" - end - - add_index "miq_report_result_details", ["miq_report_result_id", "data_type", "id"], :name => "miq_report_result_details_idx" - - create_table "miq_report_results" do |t| - t.string "name" - t.bigint "miq_report_id" - t.bigint "miq_task_id" - t.string "userid" - t.string "report_source" - t.string "db" - t.text "report" - t.datetime "created_on" - t.datetime "scheduled_on" - t.datetime "last_run_on" - t.datetime "last_accessed_on" - t.integer "report_rows_per_detail_row" - t.bigint "miq_group_id" - end - - add_index "miq_report_results", ["miq_group_id"], :name => "index_miq_report_results_on_miq_group_id" - add_index "miq_report_results", ["miq_report_id"], :name => "index_miq_report_results_on_miq_report_id" - add_index "miq_report_results", ["miq_task_id"], :name => "index_miq_report_results_on_miq_task_id" - - create_table "miq_reports" do |t| - t.string "name" - t.string "title" - t.string "rpt_group" - t.string "rpt_type" - t.integer "priority" - t.string "db" - t.text "cols" - t.text "include" - t.text "col_order" - t.text "headers" - t.text "conditions" - t.string "order" - t.string "sortby" - t.string "group" - t.string "graph" - t.integer "dims" - t.datetime "created_on" - t.datetime "updated_on" - t.string "filename" - t.datetime "file_mtime" - t.text "categories" - t.text "timeline" - t.string "template_type" - t.string "where_clause" - t.text "db_options" - t.text "generate_cols" - t.text "generate_rows" - t.text "col_formats" - t.string "tz" - t.bigint "time_profile_id" - t.text "display_filter" - t.text "col_options" - t.text "rpt_options" - t.bigint "miq_group_id" - t.bigint "user_id" - end - - add_index "miq_reports", ["db"], :name => "index_miq_reports_on_db" - add_index "miq_reports", ["miq_group_id"], :name => "index_miq_reports_on_miq_group_id" - add_index "miq_reports", ["rpt_type"], :name => "index_miq_reports_on_rpt_type" - add_index "miq_reports", ["template_type"], :name => "index_miq_reports_on_template_type" - add_index "miq_reports", ["time_profile_id"], :name => "index_miq_reports_on_time_profile_id" - - create_table "miq_request_tasks" do |t| - t.string "description" - t.string "state" - t.string "request_type" - t.string "userid" - t.text "options" - t.datetime "created_on" - t.datetime "updated_on" - t.string "message" - t.string "status" - t.string "type" - t.bigint "miq_request_id" - t.bigint "source_id" - t.string "source_type" - t.bigint "destination_id" - t.string "destination_type" - t.bigint "miq_request_task_id" - t.string "phase" - t.text "phase_context" - end - - add_index "miq_request_tasks", ["destination_id", "destination_type"], :name => "index_miq_request_tasks_on_destination_id_and_destination_type" - add_index "miq_request_tasks", ["miq_request_id"], :name => "index_miq_request_tasks_on_miq_request_id" - add_index "miq_request_tasks", ["source_id", "source_type"], :name => "index_miq_request_tasks_on_source_id_and_source_type" - - create_table "miq_requests" do |t| - t.string "description" - t.string "approval_state" - t.string "type" - t.datetime "created_on" - t.datetime "updated_on" - t.datetime "fulfilled_on" - t.bigint "requester_id" - t.string "requester_name" - t.string "request_type" - t.string "request_state" - t.string "message" - t.string "status" - t.text "options" - t.string "userid" - t.bigint "source_id" - t.string "source_type" - t.bigint "destination_id" - t.string "destination_type" - end - - add_index "miq_requests", ["destination_id", "destination_type"], :name => "index_miq_requests_on_destination_id_and_destination_type" - add_index "miq_requests", ["requester_id"], :name => "index_miq_requests_on_requester_id" - add_index "miq_requests", ["source_id", "source_type"], :name => "index_miq_requests_on_source_id_and_source_type" - - create_table "miq_roles_features", :id => false do |t| - t.bigint "miq_user_role_id" - t.bigint "miq_product_feature_id" - end - - create_table "miq_schedules" do |t| - t.string "name" - t.string "description" - t.text "sched_action" - t.text "filter" - t.string "towhat" - t.text "run_at" - t.boolean "enabled" - t.string "userid" - t.string "prod_default" - t.datetime "last_run_on" - t.datetime "created_on" - t.datetime "updated_at" - t.bigint "miq_search_id" - t.bigint "zone_id" - t.boolean "adhoc" - end - - add_index "miq_schedules", ["miq_search_id"], :name => "index_miq_schedules_on_miq_search_id" - add_index "miq_schedules", ["zone_id"], :name => "index_miq_schedules_on_zone_id" - - create_table "miq_scsi_luns" do |t| - t.bigint "miq_scsi_target_id" - t.integer "lun" - t.string "canonical_name" - t.string "lun_type" - t.string "device_name" - t.bigint "block" - t.integer "block_size" - t.bigint "capacity" - t.string "device_type" - t.string "uid_ems" - end - - add_index "miq_scsi_luns", ["miq_scsi_target_id"], :name => "index_miq_scsi_luns_on_miq_scsi_target_id" - - create_table "miq_scsi_targets" do |t| - t.bigint "guest_device_id" - t.integer "target" - t.string "iscsi_name" - t.string "iscsi_alias" - t.string "address" - t.string "uid_ems" - end - - add_index "miq_scsi_targets", ["guest_device_id"], :name => "index_miq_scsi_targets_on_guest_device_id" - - create_table "miq_searches" do |t| - t.string "name" - t.string "description" - t.text "options" - t.text "filter" - t.string "db" - t.string "search_type" - t.string "search_key" - end - - create_table "miq_servers" do |t| - t.string "guid", :limit => 36 - t.string "status" - t.datetime "started_on" - t.datetime "stopped_on" - t.integer "pid" - t.string "build" - t.float "percent_memory" - t.float "percent_cpu" - t.float "cpu_time" - t.string "name" - t.text "capabilities" - t.datetime "last_heartbeat" - t.integer "os_priority" - t.boolean "is_master", :default => false - t.binary "logo" - t.string "version" - t.bigint "zone_id" - t.string "upgrade_status" - t.string "upgrade_message" - t.decimal "memory_usage", :precision => 20, :scale => 0 - t.decimal "memory_size", :precision => 20, :scale => 0 - t.string "hostname" - t.string "ipaddress" - t.string "drb_uri" - t.string "mac_address" - t.bigint "vm_id" - t.boolean "has_active_userinterface" - t.boolean "has_active_webservices" - t.integer "sql_spid" - t.boolean "rh_registered" - t.boolean "rh_subscribed" - t.string "last_update_check" - t.boolean "updates_available" - t.boolean "rhn_mirror" - end - - add_index "miq_servers", ["guid"], :name => "index_miq_servers_on_guid", :unique => true - add_index "miq_servers", ["vm_id"], :name => "index_miq_servers_on_vm_id" - add_index "miq_servers", ["zone_id"], :name => "index_miq_servers_on_zone_id" - - create_table "miq_servers_product_updates", :id => false do |t| - t.bigint "product_update_id" - t.bigint "miq_server_id" - end - - create_table "miq_sets" do |t| - t.string "name" - t.string "description" - t.string "set_type" - t.datetime "created_on" - t.datetime "updated_on" - t.string "guid", :limit => 36 - t.boolean "read_only" - t.text "set_data" - t.string "mode" - t.string "owner_type" - t.bigint "owner_id" - end - - add_index "miq_sets", ["guid"], :name => "index_miq_sets_on_guid", :unique => true - add_index "miq_sets", ["name"], :name => "index_miq_sets_on_name" - add_index "miq_sets", ["owner_id", "owner_type"], :name => "index_miq_sets_on_owner_id_and_owner_type" - add_index "miq_sets", ["set_type"], :name => "index_miq_sets_on_set_type" - - create_table "miq_shortcuts" do |t| - t.string "name" - t.string "description" - t.string "url" - t.string "rbac_feature_name" - t.boolean "startup" - t.integer "sequence" - end - - create_table "miq_storage_metrics" do |t| - t.text "metric_obj" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "type" - end - - create_table "miq_tasks" do |t| - t.string "name" - t.string "state" - t.string "status" - t.string "message" - t.string "userid" - t.datetime "created_on" - t.datetime "updated_on" - t.integer "pct_complete" - t.text "context_data" - t.text "results" - t.bigint "miq_server_id" - t.string "identifier" - end - - add_index "miq_tasks", ["miq_server_id"], :name => "index_miq_tasks_on_miq_server_id" - - create_table "miq_user_roles" do |t| - t.string "name" - t.boolean "read_only" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "settings" - end - - create_table "miq_widget_contents" do |t| - t.bigint "miq_widget_id" - t.bigint "miq_report_result_id" - t.text "contents" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "owner_id" - t.string "owner_type" - t.string "timezone" - end - - add_index "miq_widget_contents", ["miq_report_result_id"], :name => "index_miq_widget_contents_on_miq_report_result_id" - add_index "miq_widget_contents", ["miq_widget_id"], :name => "index_miq_widget_contents_on_miq_widget_id" - add_index "miq_widget_contents", ["owner_id"], :name => "index_miq_widget_contents_on_owner_id" - - create_table "miq_widget_shortcuts" do |t| - t.string "description" - t.bigint "miq_shortcut_id" - t.bigint "miq_widget_id" - t.integer "sequence" - end - - create_table "miq_widgets" do |t| - t.string "guid", :limit => 36 - t.string "description" - t.string "title" - t.string "content_type" - t.text "options" - t.text "visibility" - t.bigint "user_id" - t.bigint "resource_id" - t.string "resource_type" - t.bigint "miq_schedule_id" - t.boolean "enabled" - t.boolean "read_only" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "last_generated_content_on" - t.bigint "miq_task_id" - end - - add_index "miq_widgets", ["miq_schedule_id"], :name => "index_miq_widgets_on_miq_schedule_id" - add_index "miq_widgets", ["miq_task_id"], :name => "index_miq_widgets_on_miq_task_id" - add_index "miq_widgets", ["resource_id", "resource_type"], :name => "index_miq_widgets_on_resource_id_and_resource_type" - add_index "miq_widgets", ["user_id"], :name => "index_miq_widgets_on_user_id" - - create_table "miq_workers" do |t| - t.string "guid", :limit => 36 - t.string "status" - t.datetime "started_on" - t.datetime "stopped_on" - t.datetime "last_heartbeat" - t.integer "pid" - t.string "queue_name" - t.string "type" - t.string "command_line", :limit => 512 - t.float "percent_memory" - t.float "percent_cpu" - t.float "cpu_time" - t.integer "os_priority" - t.decimal "memory_usage", :precision => 20, :scale => 0 - t.decimal "memory_size", :precision => 20, :scale => 0 - t.string "uri" - t.bigint "miq_server_id" - t.integer "sql_spid" - end - - add_index "miq_workers", ["guid"], :name => "index_miq_workers_on_guid", :unique => true - add_index "miq_workers", ["miq_server_id"], :name => "index_miq_workers_on_miq_server_id" - add_index "miq_workers", ["queue_name"], :name => "index_miq_workers_on_queue_name" - add_index "miq_workers", ["status"], :name => "index_miq_workers_on_status" - add_index "miq_workers", ["type"], :name => "index_miq_workers_on_worker_type" - - create_table "networks" do |t| - t.bigint "hardware_id" - t.bigint "device_id" - t.string "description" - t.string "guid", :limit => 36 - t.boolean "dhcp_enabled" - t.string "ipaddress" - t.string "subnet_mask" - t.datetime "lease_obtained" - t.datetime "lease_expires" - t.string "default_gateway" - t.string "dhcp_server" - t.string "dns_server" - t.string "hostname" - t.string "domain" - t.string "ipv6address" - end - - add_index "networks", ["device_id"], :name => "index_networks_on_device_id" - add_index "networks", ["hardware_id"], :name => "index_networks_on_hardware_id" - - create_table "ontap_aggregate_derived_metrics" do |t| - t.datetime "statistic_time" - t.integer "interval" - t.float "total_transfers" - t.float "user_reads" - t.float "user_writes" - t.float "cp_reads" - t.float "user_read_blocks" - t.float "user_write_blocks" - t.float "cp_read_blocks" - t.bigint "miq_storage_metric_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "base_counters" - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_aggregate_derived_metrics", ["miq_cim_instance_id"], :name => "index_ontap_aggregate_derived_metrics_on_miq_cim_instance_id" - add_index "ontap_aggregate_derived_metrics", ["miq_storage_metric_id"], :name => "index_ontap_aggregate_derived_metrics_on_miq_storage_metric_id" - add_index "ontap_aggregate_derived_metrics", ["storage_metrics_metadata_id"], :name => "index_ontap_aggregate_derived_metrics_on_smm_id" - - create_table "ontap_aggregate_metrics_rollups" do |t| - t.datetime "statistic_time" - t.string "rollup_type" - t.bigint "interval" - t.float "total_transfers" - t.float "total_transfers_min" - t.float "total_transfers_max" - t.float "user_reads" - t.float "user_reads_min" - t.float "user_reads_max" - t.float "user_writes" - t.float "user_writes_min" - t.float "user_writes_max" - t.float "cp_reads" - t.float "cp_reads_min" - t.float "cp_reads_max" - t.float "user_read_blocks" - t.float "user_read_blocks_min" - t.float "user_read_blocks_max" - t.float "user_write_blocks" - t.float "user_write_blocks_min" - t.float "user_write_blocks_max" - t.float "cp_read_blocks" - t.float "cp_read_blocks_min" - t.float "cp_read_blocks_max" - t.text "base_counters" - t.bigint "miq_storage_metric_id" - t.bigint "time_profile_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_aggregate_metrics_rollups", ["miq_cim_instance_id"], :name => "index_ontap_aggregate_metrics_rollups_on_miq_cim_instance_id" - add_index "ontap_aggregate_metrics_rollups", ["miq_storage_metric_id"], :name => "index_ontap_aggregate_metrics_rollups_on_miq_storage_metric_id" - add_index "ontap_aggregate_metrics_rollups", ["storage_metrics_metadata_id"], :name => "index_ontap_aggregate_metrics_rollups_on_smm_id" - add_index "ontap_aggregate_metrics_rollups", ["time_profile_id"], :name => "index_ontap_aggregate_metrics_rollups_on_time_profile_id" - - create_table "ontap_disk_derived_metrics" do |t| - t.datetime "statistic_time" - t.integer "interval" - t.float "total_transfers" - t.float "user_read_chain" - t.float "user_reads" - t.float "user_write_chain" - t.float "user_writes" - t.float "user_writes_in_skip_mask" - t.float "user_skip_write_ios" - t.float "cp_read_chain" - t.float "cp_reads" - t.float "guarenteed_read_chain" - t.float "guarenteed_reads" - t.float "guarenteed_write_chain" - t.float "guarenteed_writes" - t.float "user_read_latency" - t.float "user_read_blocks" - t.float "user_write_latency" - t.float "user_write_blocks" - t.float "skip_blocks" - t.float "cp_read_latency" - t.float "cp_read_blocks" - t.float "guarenteed_read_latency" - t.float "guarenteed_read_blocks" - t.float "guarenteed_write_latency" - t.float "guarenteed_write_blocks" - t.float "disk_busy" - t.float "io_pending" - t.float "io_queued" - t.bigint "miq_storage_metric_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "base_counters" - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_disk_derived_metrics", ["miq_cim_instance_id"], :name => "index_ontap_disk_derived_metrics_on_miq_cim_instance_id" - add_index "ontap_disk_derived_metrics", ["miq_storage_metric_id"], :name => "index_ontap_disk_derived_metrics_on_miq_storage_metric_id" - add_index "ontap_disk_derived_metrics", ["storage_metrics_metadata_id"], :name => "index_ontap_disk_derived_metrics_on_smm_id" - - create_table "ontap_disk_metrics_rollups" do |t| - t.datetime "statistic_time" - t.string "rollup_type" - t.bigint "interval" - t.float "total_transfers" - t.float "total_transfers_min" - t.float "total_transfers_max" - t.float "user_read_chain" - t.float "user_read_chain_min" - t.float "user_read_chain_max" - t.float "user_reads" - t.float "user_reads_min" - t.float "user_reads_max" - t.float "user_write_chain" - t.float "user_write_chain_min" - t.float "user_write_chain_max" - t.float "user_writes" - t.float "user_writes_min" - t.float "user_writes_max" - t.float "user_writes_in_skip_mask" - t.float "user_writes_in_skip_mask_min" - t.float "user_writes_in_skip_mask_max" - t.float "user_skip_write_ios" - t.float "user_skip_write_ios_min" - t.float "user_skip_write_ios_max" - t.float "cp_read_chain" - t.float "cp_read_chain_min" - t.float "cp_read_chain_max" - t.float "cp_reads" - t.float "cp_reads_min" - t.float "cp_reads_max" - t.float "guarenteed_read_chain" - t.float "guarenteed_read_chain_min" - t.float "guarenteed_read_chain_max" - t.float "guarenteed_reads" - t.float "guarenteed_reads_min" - t.float "guarenteed_reads_max" - t.float "guarenteed_write_chain" - t.float "guarenteed_write_chain_min" - t.float "guarenteed_write_chain_max" - t.float "guarenteed_writes" - t.float "guarenteed_writes_min" - t.float "guarenteed_writes_max" - t.float "user_read_latency" - t.float "user_read_latency_min" - t.float "user_read_latency_max" - t.float "user_read_blocks" - t.float "user_read_blocks_min" - t.float "user_read_blocks_max" - t.float "user_write_latency" - t.float "user_write_latency_min" - t.float "user_write_latency_max" - t.float "user_write_blocks" - t.float "user_write_blocks_min" - t.float "user_write_blocks_max" - t.float "skip_blocks" - t.float "skip_blocks_min" - t.float "skip_blocks_max" - t.float "cp_read_latency" - t.float "cp_read_latency_min" - t.float "cp_read_latency_max" - t.float "cp_read_blocks" - t.float "cp_read_blocks_min" - t.float "cp_read_blocks_max" - t.float "guarenteed_read_latency" - t.float "guarenteed_read_latency_min" - t.float "guarenteed_read_latency_max" - t.float "guarenteed_read_blocks" - t.float "guarenteed_read_blocks_min" - t.float "guarenteed_read_blocks_max" - t.float "guarenteed_write_latency" - t.float "guarenteed_write_latency_min" - t.float "guarenteed_write_latency_max" - t.float "guarenteed_write_blocks" - t.float "guarenteed_write_blocks_min" - t.float "guarenteed_write_blocks_max" - t.float "disk_busy" - t.float "disk_busy_min" - t.float "disk_busy_max" - t.float "io_pending" - t.float "io_pending_min" - t.float "io_pending_max" - t.float "io_queued" - t.float "io_queued_min" - t.float "io_queued_max" - t.text "base_counters" - t.bigint "miq_storage_metric_id" - t.bigint "time_profile_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_disk_metrics_rollups", ["miq_cim_instance_id"], :name => "index_ontap_disk_metrics_rollups_on_miq_cim_instance_id" - add_index "ontap_disk_metrics_rollups", ["miq_storage_metric_id"], :name => "index_ontap_disk_metrics_rollups_on_miq_storage_metric_id" - add_index "ontap_disk_metrics_rollups", ["storage_metrics_metadata_id"], :name => "index_ontap_disk_metrics_rollups_on_smm_id" - add_index "ontap_disk_metrics_rollups", ["time_profile_id"], :name => "index_ontap_disk_metrics_rollups_on_time_profile_id" - - create_table "ontap_lun_derived_metrics" do |t| - t.datetime "statistic_time" - t.integer "interval" - t.float "read_ops" - t.float "write_ops" - t.float "other_ops" - t.float "total_ops" - t.float "read_data" - t.float "write_data" - t.float "queue_full" - t.float "avg_latency" - t.bigint "miq_storage_metric_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "base_counters" - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_lun_derived_metrics", ["miq_cim_instance_id"], :name => "index_ontap_lun_derived_metrics_on_miq_cim_instance_id" - add_index "ontap_lun_derived_metrics", ["miq_storage_metric_id"], :name => "index_ontap_lun_derived_metrics_on_miq_storage_metric_id" - add_index "ontap_lun_derived_metrics", ["storage_metrics_metadata_id"], :name => "index_ontap_lun_derived_metrics_on_smm_id" - - create_table "ontap_lun_metrics_rollups" do |t| - t.datetime "statistic_time" - t.string "rollup_type" - t.bigint "interval" - t.float "read_ops" - t.float "read_ops_min" - t.float "read_ops_max" - t.float "write_ops" - t.float "write_ops_min" - t.float "write_ops_max" - t.float "other_ops" - t.float "other_ops_min" - t.float "other_ops_max" - t.float "total_ops" - t.float "total_ops_min" - t.float "total_ops_max" - t.float "read_data" - t.float "read_data_min" - t.float "read_data_max" - t.float "write_data" - t.float "write_data_min" - t.float "write_data_max" - t.float "queue_full" - t.float "queue_full_min" - t.float "queue_full_max" - t.float "avg_latency" - t.float "avg_latency_min" - t.float "avg_latency_max" - t.text "base_counters" - t.bigint "miq_storage_metric_id" - t.bigint "time_profile_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_lun_metrics_rollups", ["miq_cim_instance_id"], :name => "index_ontap_lun_metrics_rollups_on_miq_cim_instance_id" - add_index "ontap_lun_metrics_rollups", ["miq_storage_metric_id"], :name => "index_ontap_lun_metrics_rollups_on_miq_storage_metric_id" - add_index "ontap_lun_metrics_rollups", ["storage_metrics_metadata_id"], :name => "index_ontap_lun_metrics_rollups_on_smm_id" - add_index "ontap_lun_metrics_rollups", ["time_profile_id"], :name => "index_ontap_lun_metrics_rollups_on_time_profile_id" - - create_table "ontap_system_derived_metrics" do |t| - t.datetime "statistic_time" - t.integer "interval" - t.float "cpu_busy" - t.float "avg_processor_busy" - t.float "total_processor_busy" - t.float "read_ops" - t.float "write_ops" - t.float "total_ops" - t.float "sys_read_latency" - t.float "sys_write_latency" - t.float "sys_avg_latency" - t.float "nfs_ops" - t.float "cifs_ops" - t.float "http_ops" - t.float "fcp_ops" - t.float "iscsi_ops" - t.float "net_data_recv" - t.float "net_data_sent" - t.float "disk_data_read" - t.float "disk_data_written" - t.bigint "miq_storage_metric_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "base_counters" - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_system_derived_metrics", ["miq_cim_instance_id"], :name => "index_ontap_system_derived_metrics_on_miq_cim_instance_id" - add_index "ontap_system_derived_metrics", ["miq_storage_metric_id"], :name => "index_ontap_system_derived_metrics_on_miq_storage_metric_id" - add_index "ontap_system_derived_metrics", ["storage_metrics_metadata_id"], :name => "index_ontap_system_derived_metrics_on_smm_id" - - create_table "ontap_system_metrics_rollups" do |t| - t.datetime "statistic_time" - t.string "rollup_type" - t.bigint "interval" - t.float "cpu_busy" - t.float "cpu_busy_min" - t.float "cpu_busy_max" - t.float "avg_processor_busy" - t.float "avg_processor_busy_min" - t.float "avg_processor_busy_max" - t.float "total_processor_busy" - t.float "total_processor_busy_min" - t.float "total_processor_busy_max" - t.float "read_ops" - t.float "read_ops_min" - t.float "read_ops_max" - t.float "write_ops" - t.float "write_ops_min" - t.float "write_ops_max" - t.float "total_ops" - t.float "total_ops_min" - t.float "total_ops_max" - t.float "sys_read_latency" - t.float "sys_read_latency_min" - t.float "sys_read_latency_max" - t.float "sys_write_latency" - t.float "sys_write_latency_min" - t.float "sys_write_latency_max" - t.float "sys_avg_latency" - t.float "sys_avg_latency_min" - t.float "sys_avg_latency_max" - t.float "nfs_ops" - t.float "nfs_ops_min" - t.float "nfs_ops_max" - t.float "cifs_ops" - t.float "cifs_ops_min" - t.float "cifs_ops_max" - t.float "http_ops" - t.float "http_ops_min" - t.float "http_ops_max" - t.float "fcp_ops" - t.float "fcp_ops_min" - t.float "fcp_ops_max" - t.float "iscsi_ops" - t.float "iscsi_ops_min" - t.float "iscsi_ops_max" - t.float "net_data_recv" - t.float "net_data_recv_min" - t.float "net_data_recv_max" - t.float "net_data_sent" - t.float "net_data_sent_min" - t.float "net_data_sent_max" - t.float "disk_data_read" - t.float "disk_data_read_min" - t.float "disk_data_read_max" - t.float "disk_data_written" - t.float "disk_data_written_min" - t.float "disk_data_written_max" - t.text "base_counters" - t.bigint "miq_storage_metric_id" - t.bigint "time_profile_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_system_metrics_rollups", ["miq_cim_instance_id"], :name => "index_ontap_system_metrics_rollups_on_miq_cim_instance_id" - add_index "ontap_system_metrics_rollups", ["miq_storage_metric_id"], :name => "index_ontap_system_metrics_rollups_on_miq_storage_metric_id" - add_index "ontap_system_metrics_rollups", ["storage_metrics_metadata_id"], :name => "index_ontap_system_metrics_rollups_on_smm_id" - add_index "ontap_system_metrics_rollups", ["time_profile_id"], :name => "index_ontap_system_metrics_rollups_on_time_profile_id" - - create_table "ontap_volume_derived_metrics" do |t| - t.datetime "statistic_time" - t.integer "interval" - t.float "avg_latency" - t.float "total_ops" - t.float "read_data" - t.float "read_latency" - t.float "read_ops" - t.float "write_data" - t.float "write_latency" - t.float "write_ops" - t.float "other_latency" - t.float "other_ops" - t.float "nfs_read_data" - t.float "nfs_read_latency" - t.float "nfs_read_ops" - t.float "nfs_write_data" - t.float "nfs_write_latency" - t.float "nfs_write_ops" - t.float "nfs_other_latency" - t.float "nfs_other_ops" - t.float "cifs_read_data" - t.float "cifs_read_latency" - t.float "cifs_read_ops" - t.float "cifs_write_data" - t.float "cifs_write_latency" - t.float "cifs_write_ops" - t.float "cifs_other_latency" - t.float "cifs_other_ops" - t.float "san_read_data" - t.float "san_read_latency" - t.float "san_read_ops" - t.float "san_write_data" - t.float "san_write_latency" - t.float "san_write_ops" - t.float "san_other_latency" - t.float "san_other_ops" - t.float "queue_depth" - t.bigint "miq_storage_metric_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "base_counters" - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_volume_derived_metrics", ["miq_cim_instance_id"], :name => "index_ontap_volume_derived_metrics_on_miq_cim_instance_id" - add_index "ontap_volume_derived_metrics", ["miq_storage_metric_id"], :name => "index_ontap_volume_derived_metrics_on_miq_storage_metric_id" - add_index "ontap_volume_derived_metrics", ["storage_metrics_metadata_id"], :name => "index_ontap_volume_derived_metrics_on_smm_id" - - create_table "ontap_volume_metrics_rollups" do |t| - t.datetime "statistic_time" - t.string "rollup_type" - t.bigint "interval" - t.float "avg_latency" - t.float "avg_latency_min" - t.float "avg_latency_max" - t.float "total_ops" - t.float "total_ops_min" - t.float "total_ops_max" - t.float "read_data" - t.float "read_data_min" - t.float "read_data_max" - t.float "read_latency" - t.float "read_latency_min" - t.float "read_latency_max" - t.float "read_ops" - t.float "read_ops_min" - t.float "read_ops_max" - t.float "write_data" - t.float "write_data_min" - t.float "write_data_max" - t.float "write_latency" - t.float "write_latency_min" - t.float "write_latency_max" - t.float "write_ops" - t.float "write_ops_min" - t.float "write_ops_max" - t.float "other_latency" - t.float "other_latency_min" - t.float "other_latency_max" - t.float "other_ops" - t.float "other_ops_min" - t.float "other_ops_max" - t.float "nfs_read_data" - t.float "nfs_read_data_min" - t.float "nfs_read_data_max" - t.float "nfs_read_latency" - t.float "nfs_read_latency_min" - t.float "nfs_read_latency_max" - t.float "nfs_read_ops" - t.float "nfs_read_ops_min" - t.float "nfs_read_ops_max" - t.float "nfs_write_data" - t.float "nfs_write_data_min" - t.float "nfs_write_data_max" - t.float "nfs_write_latency" - t.float "nfs_write_latency_min" - t.float "nfs_write_latency_max" - t.float "nfs_write_ops" - t.float "nfs_write_ops_min" - t.float "nfs_write_ops_max" - t.float "nfs_other_latency" - t.float "nfs_other_latency_min" - t.float "nfs_other_latency_max" - t.float "nfs_other_ops" - t.float "nfs_other_ops_min" - t.float "nfs_other_ops_max" - t.float "cifs_read_data" - t.float "cifs_read_data_min" - t.float "cifs_read_data_max" - t.float "cifs_read_latency" - t.float "cifs_read_latency_min" - t.float "cifs_read_latency_max" - t.float "cifs_read_ops" - t.float "cifs_read_ops_min" - t.float "cifs_read_ops_max" - t.float "cifs_write_data" - t.float "cifs_write_data_min" - t.float "cifs_write_data_max" - t.float "cifs_write_latency" - t.float "cifs_write_latency_min" - t.float "cifs_write_latency_max" - t.float "cifs_write_ops" - t.float "cifs_write_ops_min" - t.float "cifs_write_ops_max" - t.float "cifs_other_latency" - t.float "cifs_other_latency_min" - t.float "cifs_other_latency_max" - t.float "cifs_other_ops" - t.float "cifs_other_ops_min" - t.float "cifs_other_ops_max" - t.float "san_read_data" - t.float "san_read_data_min" - t.float "san_read_data_max" - t.float "san_read_latency" - t.float "san_read_latency_min" - t.float "san_read_latency_max" - t.float "san_read_ops" - t.float "san_read_ops_min" - t.float "san_read_ops_max" - t.float "san_write_data" - t.float "san_write_data_min" - t.float "san_write_data_max" - t.float "san_write_latency" - t.float "san_write_latency_min" - t.float "san_write_latency_max" - t.float "san_write_ops" - t.float "san_write_ops_min" - t.float "san_write_ops_max" - t.float "san_other_latency" - t.float "san_other_latency_min" - t.float "san_other_latency_max" - t.float "san_other_ops" - t.float "san_other_ops_min" - t.float "san_other_ops_max" - t.text "base_counters" - t.bigint "miq_storage_metric_id" - t.bigint "time_profile_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "miq_cim_instance_id" - t.bigint "storage_metrics_metadata_id" - end - - add_index "ontap_volume_metrics_rollups", ["miq_cim_instance_id"], :name => "index_ontap_volume_metrics_rollups_on_miq_cim_instance_id" - add_index "ontap_volume_metrics_rollups", ["miq_storage_metric_id"], :name => "index_ontap_volume_metrics_rollups_on_miq_storage_metric_id" - add_index "ontap_volume_metrics_rollups", ["storage_metrics_metadata_id"], :name => "index_ontap_volume_metrics_rollups_on_smm_id" - add_index "ontap_volume_metrics_rollups", ["time_profile_id"], :name => "index_ontap_volume_metrics_rollups_on_time_profile_id" - - create_table "operating_systems" do |t| - t.string "name" - t.string "product_name" - t.string "version" - t.string "build_number" - t.string "system_root" - t.string "distribution" - t.string "product_type" - t.string "service_pack" - t.string "productid" - t.bigint "vm_or_template_id" - t.bigint "host_id" - t.integer "bitness" - t.string "product_key" - t.integer "pw_hist" - t.integer "max_pw_age" - t.integer "min_pw_age" - t.integer "min_pw_len" - t.boolean "pw_complex" - t.boolean "pw_encrypt" - t.integer "lockout_threshold" - t.bigint "lockout_duration" - t.integer "reset_lockout_counter" - t.string "system_type" - end - - add_index "operating_systems", ["host_id"], :name => "index_operating_systems_on_host_id" - add_index "operating_systems", ["vm_or_template_id"], :name => "index_operating_systems_on_vm_id" - - create_table "os_processes" do |t| - t.string "name" - t.integer "pid" - t.bigint "memory_usage" - t.bigint "memory_size" - t.float "percent_memory" - t.float "percent_cpu" - t.integer "cpu_time" - t.integer "priority" - t.bigint "operating_system_id" - t.datetime "created_on" - t.datetime "updated_on" - end - - add_index "os_processes", ["operating_system_id"], :name => "index_os_processes_on_operating_system_id" - - create_table "partitions" do |t| - t.bigint "disk_id" - t.string "name" - t.bigint "size" - t.bigint "free_space" - t.bigint "used_space" - t.datetime "created_on" - t.datetime "updated_on" - t.integer "location" - t.bigint "hardware_id" - t.string "volume_group" - t.integer "partition_type" - t.string "controller" - t.string "virtual_disk_file" - t.string "uid" - t.bigint "start_address" - end - - add_index "partitions", ["disk_id"], :name => "index_partitions_on_disk_id" - add_index "partitions", ["hardware_id", "volume_group"], :name => "index_partitions_on_hardware_id_and_volume_group" - - create_table "patches" do |t| - t.string "name" - t.string "vendor" - t.text "description" - t.string "service_pack" - t.string "is_valid" - t.string "installed" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "vm_or_template_id" - t.bigint "host_id" - t.datetime "installed_on" - end - - add_index "patches", ["host_id"], :name => "index_patches_on_host_id" - add_index "patches", ["vm_or_template_id"], :name => "index_patches_on_vm_id" - - create_table "pictures" do |t| - t.bigint "resource_id" - t.string "resource_type" - end - - create_table "policy_event_contents" do |t| - t.bigint "policy_event_id" - t.bigint "resource_id" - t.string "resource_type" - t.string "resource_description" - end - - add_index "policy_event_contents", ["policy_event_id"], :name => "index_policy_event_contents_on_policy_event_id" - add_index "policy_event_contents", ["resource_id", "resource_type"], :name => "index_policy_event_contents_on_resource_id_and_resource_type" - - create_table "policy_events" do |t| - t.bigint "miq_event_id" - t.string "event_type" - t.string "miq_event_description" - t.bigint "miq_policy_id" - t.string "miq_policy_description" - t.string "result" - t.datetime "timestamp" - t.bigint "target_id" - t.string "target_class" - t.string "target_name" - t.bigint "chain_id" - t.string "username" - t.bigint "host_id" - t.bigint "ems_cluster_id" - t.bigint "ems_id" - end - - add_index "policy_events", ["chain_id"], :name => "index_policy_events_on_chain_id" - add_index "policy_events", ["ems_cluster_id"], :name => "index_policy_events_on_ems_cluster_id" - add_index "policy_events", ["ems_id"], :name => "index_policy_events_on_ems_id" - add_index "policy_events", ["host_id"], :name => "index_policy_events_on_host_id" - add_index "policy_events", ["miq_event_id"], :name => "index_policy_events_on_miq_event_id" - add_index "policy_events", ["miq_policy_id"], :name => "index_policy_events_on_miq_policy_id" - add_index "policy_events", ["target_id", "target_class"], :name => "index_policy_events_on_target_id_and_target_class" - - create_table "product_updates" do |t| - t.string "name" - t.string "description" - t.string "md5" - t.string "version" - t.string "build" - t.string "component" - t.string "platform" - t.string "arch" - t.string "update_type" - t.string "vmdb_schema_version" - t.datetime "created_on" - t.datetime "updated_on" - end - - create_table "proxy_tasks" do |t| - t.integer "priority" - t.text "command" - t.string "state" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "miq_proxy_id" - end - - add_index "proxy_tasks", ["miq_proxy_id"], :name => "index_proxy_tasks_on_miq_proxy_id" - - create_table "pxe_image_types" do |t| - t.string "name" - t.string "provision_type" - end - - create_table "pxe_images" do |t| - t.string "name" - t.string "description" - t.bigint "pxe_server_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "pxe_menu_id" - t.string "type" - t.bigint "pxe_image_type_id" - t.string "kernel", :limit => 1024 - t.string "kernel_options", :limit => 1024 - t.string "initrd", :limit => 1024 - t.boolean "default_for_windows" - t.string "path" - end - - add_index "pxe_images", ["pxe_server_id"], :name => "index_pxe_images_on_pxe_server_id" - - create_table "pxe_menus" do |t| - t.string "file_name" - t.text "contents" - t.bigint "pxe_server_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "type" - end - - create_table "pxe_servers" do |t| - t.string "name" - t.string "uri_prefix" - t.string "uri" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "last_refresh_on" - t.text "visibility" - t.string "access_url" - t.string "pxe_directory" - t.string "customization_directory" - t.string "windows_images_directory" - end - - create_table "registry_items" do |t| - t.bigint "miq_set_id" - t.bigint "scan_item_id" - t.bigint "vm_or_template_id" - t.string "name" - t.text "data" - t.string "format" - t.datetime "created_on" - t.datetime "updated_on" - t.string "value_name" - end - - add_index "registry_items", ["miq_set_id"], :name => "index_registry_items_on_miq_set_id" - add_index "registry_items", ["scan_item_id"], :name => "index_registry_items_on_scan_item_id" - add_index "registry_items", ["vm_or_template_id"], :name => "index_registry_items_on_vm_id" - - create_table "relationships" do |t| - t.string "resource_type" - t.bigint "resource_id" - t.string "ancestry", :limit => 2000 - t.string "relationship" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "relationships", ["ancestry"], :name => "index_relationships_on_ancestry" - add_index "relationships", ["resource_id", "resource_type", "relationship"], :name => "index_relationships_on_resource_and_relationship" - - create_table "repositories" do |t| - t.string "name" - t.string "relative_path" - t.bigint "storage_id" - t.datetime "created_on" - t.datetime "updated_on" - end - - add_index "repositories", ["storage_id"], :name => "index_repositories_on_storage_id" - - create_table "reserves" do |t| - t.string "resource_type" - t.bigint "resource_id" - t.text "reserved" - end - - add_index "reserves", ["resource_id", "resource_type"], :name => "index_reserves_on_resource_id_and_resource_type" - - create_table "resource_actions" do |t| - t.string "action" - t.bigint "dialog_id" - t.bigint "resource_id" - t.string "resource_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "ae_namespace" - t.string "ae_class" - t.string "ae_instance" - t.string "ae_message" - t.text "ae_attributes" - end - - create_table "resource_pools" do |t| - t.string "name" - t.bigint "ems_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "uid_ems" - t.integer "memory_reserve" - t.boolean "memory_reserve_expand" - t.integer "memory_limit" - t.integer "memory_shares" - t.string "memory_shares_level" - t.integer "cpu_reserve" - t.boolean "cpu_reserve_expand" - t.integer "cpu_limit" - t.integer "cpu_shares" - t.string "cpu_shares_level" - t.boolean "is_default" - t.string "ems_ref_obj" - t.boolean "vapp" - t.string "ems_ref" - end - - add_index "resource_pools", ["ems_id"], :name => "index_resource_pools_on_ems_id" - add_index "resource_pools", ["uid_ems"], :name => "index_resource_pools_on_uid" - - create_table "rss_feeds" do |t| - t.string "name" - t.text "title" - t.text "link" - t.text "description" - t.datetime "created_on" - t.datetime "updated_on" - t.datetime "yml_file_mtime" - end - - add_index "rss_feeds", ["name"], :name => "index_rss_feeds_on_name" - - create_table "scan_histories" do |t| - t.bigint "vm_or_template_id" - t.string "status" - t.text "message" - t.datetime "started_on" - t.datetime "finished_on" - t.datetime "created_on" - t.datetime "updated_on" - t.string "task_id", :limit => 36 - t.integer "status_code" - end - - add_index "scan_histories", ["vm_or_template_id"], :name => "index_scan_histories_on_vm_id" - - create_table "scan_items" do |t| - t.string "name" - t.string "description" - t.string "guid", :limit => 36 - t.datetime "created_on" - t.datetime "updated_on" - t.string "item_type" - t.text "definition" - t.string "filename" - t.datetime "file_mtime" - t.string "prod_default" - t.string "mode" - end - - add_index "scan_items", ["guid"], :name => "index_scan_items_on_guid", :unique => true - add_index "scan_items", ["item_type"], :name => "index_scan_items_on_item_type" - add_index "scan_items", ["name"], :name => "index_scan_items_on_name" - - create_table "security_groups" do |t| - t.string "name" - t.string "description" - t.string "type" - t.bigint "ems_id" - t.string "ems_ref" - t.bigint "cloud_network_id" - end - - create_table "security_groups_vms", :id => false do |t| - t.bigint "security_group_id" - t.bigint "vm_id" - end - - create_table "server_roles" do |t| - t.string "name" - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - t.string "license_required" - t.integer "max_concurrent" - t.boolean "external_failover" - t.string "role_scope" - end - - create_table "service_resources" do |t| - t.bigint "service_template_id" - t.bigint "resource_id" - t.string "resource_type" - t.integer "group_idx" - t.integer "scaling_min" - t.integer "scaling_max" - t.string "start_action" - t.integer "start_delay" - t.string "stop_action" - t.integer "stop_delay" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "name" - t.bigint "service_id" - t.bigint "source_id" - t.string "source_type" - t.integer "provision_index" - end - - create_table "service_template_catalogs" do |t| - t.string "name" - t.string "description" - end - - create_table "service_templates" do |t| - t.string "name" - t.string "description" - t.string "guid" - t.string "type" - t.bigint "service_template_id" - t.text "options" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "display" - t.bigint "evm_owner_id" - t.bigint "miq_group_id" - t.string "service_type" - t.string "prov_type" - t.float "provision_cost" - t.bigint "service_template_catalog_id" - t.text "long_description" - end - - create_table "services" do |t| - t.string "name" - t.string "description" - t.string "guid" - t.string "type" - t.bigint "service_template_id" - t.text "options" - t.boolean "display" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "evm_owner_id" - t.bigint "miq_group_id" - t.bigint "service_id" - t.boolean "retired" - t.date "retires_on" - t.bigint "retirement_warn" - t.datetime "retirement_last_warn" - t.string "retirement_state" - end - - create_table "sessions" do |t| - t.string "session_id" - t.text "data" - t.datetime "updated_at" - end - - add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" - add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at" - - create_table "snapshots" do |t| - t.string "uid" - t.string "parent_uid" - t.string "name" - t.text "description" - t.integer "current" - t.bigint "total_size" - t.string "filename" - t.datetime "create_time" - t.text "disks" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "parent_id" - t.bigint "vm_or_template_id" - t.string "uid_ems" - t.string "ems_ref_obj" - t.string "ems_ref" - end - - add_index "snapshots", ["parent_id"], :name => "index_snapshots_on_parent_id" - add_index "snapshots", ["parent_uid"], :name => "index_snapshots_on_parent_uid" - add_index "snapshots", ["uid"], :name => "index_snapshots_on_uid" - add_index "snapshots", ["vm_or_template_id"], :name => "index_snapshots_on_vm_id" - - create_table "storage_files" do |t| - t.text "name" - t.string "size" - t.datetime "mtime" - t.string "rsc_type" - t.text "base_name" - t.string "ext_name" - t.bigint "storage_id" - t.bigint "vm_or_template_id" - end - - add_index "storage_files", ["storage_id"], :name => "index_storage_files_on_storage_id" - add_index "storage_files", ["vm_or_template_id"], :name => "index_storage_files_on_vm_id" - - create_table "storage_managers" do |t| - t.string "ipaddress" - t.string "agent_type" - t.integer "last_update_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "zone_id" - t.string "name" - t.string "hostname" - t.string "port" - t.bigint "parent_agent_id" - t.string "vendor" - t.string "version" - t.string "type" - t.text "type_spec_data" - end - - add_index "storage_managers", ["parent_agent_id"], :name => "index_storage_managers_on_parent_agent_id" - add_index "storage_managers", ["zone_id"], :name => "index_storage_managers_on_zone_id" - - create_table "storage_metrics_metadata" do |t| - t.string "type" - t.text "counter_info" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "storages" do |t| - t.string "name" - t.string "store_type" - t.bigint "total_space" - t.bigint "free_space" - t.datetime "created_on" - t.datetime "updated_on" - t.integer "multiplehostaccess" - t.string "location", :default => "" - t.datetime "last_scan_on" - t.bigint "uncommitted" - t.datetime "last_perf_capture_on" - t.string "ems_ref_obj" - t.boolean "directory_hierarchy_supported" - t.boolean "thin_provisioning_supported" - t.boolean "raw_disk_mappings_supported" - t.boolean "master", :default => false - t.string "ems_ref" - t.string "storage_domain_type" - end - - add_index "storages", ["location"], :name => "index_storages_on_location" - add_index "storages", ["name"], :name => "index_storages_on_name" - - create_table "storages_vms_and_templates", :id => false do |t| - t.bigint "storage_id" - t.bigint "vm_or_template_id" - end - - add_index "storages_vms_and_templates", ["vm_or_template_id", "storage_id"], :name => "index_storages_vms_on_vm_id_and_storage_id", :unique => true - - create_table "switches" do |t| - t.bigint "host_id" - t.string "name" - t.integer "ports" - t.datetime "created_on" - t.datetime "updated_on" - t.string "uid_ems" - t.boolean "allow_promiscuous" - t.boolean "forged_transmits" - t.boolean "mac_changes" - end - - add_index "switches", ["host_id"], :name => "index_switches_on_host_id" - add_index "switches", ["name"], :name => "index_switches_on_name" - - create_table "system_services" do |t| - t.string "name" - t.string "svc_type" - t.string "typename" - t.string "start" - t.text "image_path" - t.string "display_name" - t.string "depend_on_service" - t.string "depend_on_group" - t.string "object_name" - t.text "description" - t.bigint "vm_or_template_id" - t.string "enable_run_levels" - t.string "disable_run_levels" - t.bigint "host_id" - t.boolean "running" - end - - add_index "system_services", ["host_id"], :name => "index_system_services_on_host_id" - add_index "system_services", ["typename"], :name => "index_system_services_on_typename" - add_index "system_services", ["vm_or_template_id"], :name => "index_system_services_on_vm_id" - - create_table "taggings" do |t| - t.bigint "taggable_id" - t.bigint "tag_id" - t.string "taggable_type" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type" - - create_table "tags" do |t| - t.text "name" - end - - create_table "time_profiles" do |t| - t.string "description" - t.string "profile_type" - t.string "profile_key" - t.text "profile" - t.datetime "created_on" - t.datetime "updated_on" - t.boolean "rollup_daily_metrics" - end - - create_table "ui_tasks" do |t| - t.string "name" - t.string "area" - t.string "typ" - t.string "task" - t.datetime "created_on" - t.datetime "updated_on" - end - - add_index "ui_tasks", ["area", "typ", "task"], :name => "index_ui_tasks_on_area_and_typ_and_task" - - create_table "users" do |t| - t.string "name" - t.string "email" - t.string "icon" - t.datetime "created_on" - t.datetime "updated_on" - t.string "userid" - t.text "settings" - t.text "filters" - t.bigint "ui_task_set_id" - t.datetime "lastlogon" - t.datetime "lastlogoff" - t.integer "region" - t.bigint "miq_group_id" - t.string "first_name" - t.string "last_name" - t.string "password_digest" - end - - add_index "users", ["miq_group_id"], :name => "index_users_on_miq_group_id" - add_index "users", ["ui_task_set_id"], :name => "index_users_on_ui_task_set_id" - add_index "users", ["userid", "region"], :name => "index_users_on_userid_and_region", :unique => true - - create_table "vdi_controllers" do |t| - t.bigint "vdi_farm_id" - t.string "name" - t.string "version" - t.string "zone_preference" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "vdi_controllers", ["vdi_farm_id"], :name => "index_vdi_controllers_on_vdi_farm_id" - - create_table "vdi_desktop_pools" do |t| - t.bigint "vdi_farm_id" - t.string "name" - t.string "description" - t.string "vendor" - t.boolean "enabled" - t.string "uid_ems" - t.string "assignment_behavior" - t.string "hosting_vendor" - t.string "hosting_server" - t.string "hosting_ipaddress" - t.string "default_encryption_level" - t.string "default_color_depth" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "vdi_desktop_pools", ["vdi_farm_id"], :name => "index_vdi_desktop_pools_on_vdi_farm_id" - - create_table "vdi_desktop_pools_vdi_users", :id => false do |t| - t.bigint "vdi_desktop_pool_id" - t.bigint "vdi_user_id" - end - - add_index "vdi_desktop_pools_vdi_users", ["vdi_desktop_pool_id"], :name => "index_vdi_desktop_pools_vdi_users_on_vdi_desktop_pool_id" - add_index "vdi_desktop_pools_vdi_users", ["vdi_user_id"], :name => "index_vdi_desktop_pools_vdi_users_on_vdi_user_id" - - create_table "vdi_desktops" do |t| - t.bigint "vdi_desktop_pool_id" - t.bigint "vm_or_template_id" - t.string "name" - t.string "agent_version" - t.string "connection_state" - t.string "power_state" - t.string "assigned_username" - t.boolean "maintenance_mode" - t.string "vm_uid_ems" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "vdi_desktops", ["vdi_desktop_pool_id"], :name => "index_vdi_desktops_on_vdi_desktop_pool_id" - add_index "vdi_desktops", ["vm_or_template_id"], :name => "index_vdi_desktops_on_vm_id" - - create_table "vdi_desktops_vdi_users", :id => false do |t| - t.bigint "vdi_desktop_id" - t.bigint "vdi_user_id" - end - - create_table "vdi_endpoint_devices" do |t| - t.string "name" - t.string "ipaddress" - t.string "uid_ems" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "vdi_farms" do |t| - t.string "name" - t.string "vendor" - t.string "edition" - t.string "uid_ems" - t.string "license_server_name" - t.string "enable_session_reliability" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "zone_id" - t.string "type" - end - - create_table "vdi_sessions" do |t| - t.bigint "vdi_desktop_id" - t.bigint "vdi_controller_id" - t.bigint "vdi_user_id" - t.string "user_name" - t.string "state" - t.datetime "start_time" - t.string "encryption_level" - t.string "protocol" - t.string "horizontal_resolution" - t.string "vertical_resolution" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.bigint "vdi_endpoint_device_id" - t.string "uid_ems" - end - - add_index "vdi_sessions", ["vdi_controller_id"], :name => "index_vdi_sessions_on_vdi_controller_id" - add_index "vdi_sessions", ["vdi_desktop_id"], :name => "index_vdi_sessions_on_vdi_desktop_id" - add_index "vdi_sessions", ["vdi_endpoint_device_id"], :name => "index_vdi_sessions_on_vdi_endpoint_device_id" - add_index "vdi_sessions", ["vdi_user_id"], :name => "index_vdi_sessions_on_vdi_user_id" - - create_table "vdi_users" do |t| - t.string "uid_ems" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "vim_performance_operating_ranges" do |t| - t.bigint "resource_id" - t.string "resource_type" - t.bigint "time_profile_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "values" - t.integer "days" - end - - add_index "vim_performance_operating_ranges", ["resource_id", "resource_type"], :name => "index_vpor_on_resource" - add_index "vim_performance_operating_ranges", ["time_profile_id"], :name => "index_vpor_on_time_profile_id" - - create_table "vim_performance_states" do |t| - t.datetime "timestamp" - t.integer "capture_interval" - t.string "resource_type" - t.bigint "resource_id" - t.text "state_data" - end - - add_index "vim_performance_states", ["resource_id", "resource_type", "timestamp"], :name => "index_vim_performance_states_on_resource_and_timestamp" - - create_table "vim_performance_tag_values" do |t| - t.string "association_type" - t.string "category" - t.string "tag_name" - t.string "column_name" - t.float "value" - t.text "assoc_ids" - t.bigint "metric_id" - t.string "metric_type" - end - - add_index "vim_performance_tag_values", ["metric_id", "metric_type"], :name => "index_vim_performance_tag_values_on_metric_id_and_metric_type" - - create_table "vmdb_database_metrics" do |t| - t.bigint "vmdb_database_id" - t.integer "running_processes" - t.integer "active_connections" - t.datetime "timestamp" - t.string "capture_interval_name" - t.bigint "disk_total_bytes" - t.bigint "disk_free_bytes" - t.bigint "disk_used_bytes" - t.bigint "disk_total_inodes" - t.bigint "disk_used_inodes" - t.bigint "disk_free_inodes" - end - - create_table "vmdb_databases" do |t| - t.string "name" - t.string "ipaddress" - t.string "vendor" - t.string "version" - t.string "data_directory" - t.datetime "last_start_time" - t.string "data_disk" - end - - create_table "vmdb_indexes" do |t| - t.bigint "vmdb_table_id" - t.string "name" - t.text "prior_raw_metrics" - end - - create_table "vmdb_metrics" do |t| - t.bigint "resource_id" - t.string "resource_type" - t.bigint "size" - t.bigint "rows" - t.bigint "pages" - t.float "percent_bloat" - t.float "wasted_bytes" - t.integer "otta" - t.bigint "table_scans" - t.bigint "sequential_rows_read" - t.bigint "index_scans" - t.bigint "index_rows_fetched" - t.bigint "rows_inserted" - t.bigint "rows_updated" - t.bigint "rows_deleted" - t.bigint "rows_hot_updated" - t.bigint "rows_live" - t.bigint "rows_dead" - t.datetime "last_vacuum_date" - t.datetime "last_autovacuum_date" - t.datetime "last_analyze_date" - t.datetime "last_autoanalyze_date" - t.datetime "timestamp" - t.string "capture_interval_name" - end - - add_index "vmdb_metrics", ["resource_id", "resource_type", "timestamp"], :name => "index_vmdb_metrics_on_resource_and_timestamp" - - create_table "vmdb_tables" do |t| - t.bigint "vmdb_database_id" - t.string "name" - t.string "type" - t.bigint "parent_id" - t.text "prior_raw_metrics" - end - - create_table "vms" do |t| - t.string "vendor" - t.string "format" - t.string "version" - t.string "name" - t.text "description" - t.string "location" - t.string "config_xml" - t.string "autostart" - t.bigint "host_id" - t.datetime "last_sync_on" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "storage_id" - t.string "guid", :limit => 36 - t.bigint "ems_id" - t.datetime "last_scan_on" - t.datetime "last_scan_attempt_on" - t.string "uid_ems" - t.date "retires_on" - t.boolean "retired" - t.datetime "boot_time" - t.string "tools_status" - t.string "standby_action" - t.string "power_state" - t.datetime "state_changed_on" - t.string "previous_state" - t.string "connection_state" - t.datetime "last_perf_capture_on" - t.boolean "blackbox_exists" - t.boolean "blackbox_validated" - t.boolean "registered" - t.boolean "busy" - t.boolean "smart" - t.integer "memory_reserve" - t.boolean "memory_reserve_expand" - t.integer "memory_limit" - t.integer "memory_shares" - t.string "memory_shares_level" - t.integer "cpu_reserve" - t.boolean "cpu_reserve_expand" - t.integer "cpu_limit" - t.integer "cpu_shares" - t.string "cpu_shares_level" - t.string "cpu_affinity" - t.datetime "ems_created_on" - t.boolean "template", :default => false - t.bigint "evm_owner_id" - t.string "ems_ref_obj" - t.bigint "miq_group_id" - t.boolean "vdi", :default => false, :null => false - t.boolean "linked_clone" - t.boolean "fault_tolerance" - t.string "type" - t.string "ems_ref" - t.bigint "ems_cluster_id" - t.bigint "retirement_warn" - t.datetime "retirement_last_warn" - t.integer "vnc_port" - t.bigint "flavor_id" - t.bigint "availability_zone_id" - t.boolean "cloud" - t.string "retirement_state" - t.bigint "cloud_network_id" - t.bigint "cloud_subnet_id" - end - - add_index "vms", ["availability_zone_id"], :name => "index_vms_on_availability_zone_id" - add_index "vms", ["ems_id"], :name => "index_vms_on_ems_id" - add_index "vms", ["evm_owner_id"], :name => "index_vms_on_evm_owner_id" - add_index "vms", ["flavor_id"], :name => "index_vms_on_flavor_id" - add_index "vms", ["guid"], :name => "index_vms_on_guid", :unique => true - add_index "vms", ["host_id"], :name => "index_vms_on_host_id" - add_index "vms", ["location"], :name => "index_vms_on_location" - add_index "vms", ["miq_group_id"], :name => "index_vms_on_miq_group_id" - add_index "vms", ["name"], :name => "index_vms_on_name" - add_index "vms", ["storage_id"], :name => "index_vms_on_storage_id" - add_index "vms", ["uid_ems"], :name => "index_vms_on_vmm_uuid" - - create_table "volumes" do |t| - t.string "name" - t.string "typ" - t.string "filesystem" - t.datetime "created_on" - t.datetime "updated_on" - t.bigint "hardware_id" - t.string "volume_group" - t.string "uid" - t.bigint "size" - t.bigint "free_space" - t.bigint "used_space" - end - - add_index "volumes", ["hardware_id", "volume_group"], :name => "index_volumes_on_hardware_id_and_volume_group" - - create_table "windows_images" do |t| - t.string "name" - t.string "description" - t.string "path" - t.integer "index" - t.bigint "pxe_server_id" - t.bigint "pxe_image_type_id" - end - - create_table "zones" do |t| - t.string "name" - t.string "description" - t.datetime "created_on" - t.datetime "updated_on" - t.text "settings" - end - end - - def down - drop_table "zones" - drop_table "windows_images" - drop_table "volumes" - drop_table "vms" - drop_table "vmdb_tables" - drop_table "vmdb_metrics" - drop_table "vmdb_indexes" - drop_table "vmdb_databases" - drop_table "vmdb_database_metrics" - drop_table "vim_performance_tag_values" - drop_table "vim_performance_states" - drop_table "vim_performance_operating_ranges" - drop_table "vdi_users" - drop_table "vdi_sessions" - drop_table "vdi_farms" - drop_table "vdi_endpoint_devices" - drop_table "vdi_desktops_vdi_users" - drop_table "vdi_desktops" - drop_table "vdi_desktop_pools_vdi_users" - drop_table "vdi_desktop_pools" - drop_table "vdi_controllers" - drop_table "users" - drop_table "ui_tasks" - drop_table "time_profiles" - drop_table "tags" - drop_table "taggings" - drop_table "system_services" - drop_table "switches" - drop_table "storages_vms_and_templates" - drop_table "storages" - drop_table "storage_metrics_metadata" - drop_table "storage_managers" - drop_table "storage_files" - drop_table "snapshots" - drop_table "sessions" - drop_table "services" - drop_table "service_templates" - drop_table "service_template_catalogs" - drop_table "service_resources" - drop_table "server_roles" - drop_table "security_groups_vms" - drop_table "security_groups" - drop_table "scan_items" - drop_table "scan_histories" - drop_table "rss_feeds" - drop_table "resource_pools" - drop_table "resource_actions" - drop_table "reserves" - drop_table "repositories" - drop_table "relationships" - drop_table "registry_items" - drop_table "pxe_servers" - drop_table "pxe_menus" - drop_table "pxe_images" - drop_table "pxe_image_types" - drop_table "proxy_tasks" - drop_table "product_updates" - drop_table "policy_events" - drop_table "policy_event_contents" - drop_table "pictures" - drop_table "patches" - drop_table "partitions" - drop_table "os_processes" - drop_table "operating_systems" - drop_table "ontap_volume_metrics_rollups" - drop_table "ontap_volume_derived_metrics" - drop_table "ontap_system_metrics_rollups" - drop_table "ontap_system_derived_metrics" - drop_table "ontap_lun_metrics_rollups" - drop_table "ontap_lun_derived_metrics" - drop_table "ontap_disk_metrics_rollups" - drop_table "ontap_disk_derived_metrics" - drop_table "ontap_aggregate_metrics_rollups" - drop_table "ontap_aggregate_derived_metrics" - drop_table "networks" - drop_table "miq_workers" - drop_table "miq_widgets" - drop_table "miq_widget_shortcuts" - drop_table "miq_widget_contents" - drop_table "miq_user_roles" - drop_table "miq_tasks" - drop_table "miq_storage_metrics" - drop_table "miq_shortcuts" - drop_table "miq_sets" - drop_table "miq_servers_product_updates" - drop_table "miq_servers" - drop_table "miq_searches" - drop_table "miq_scsi_targets" - drop_table "miq_scsi_luns" - drop_table "miq_schedules" - drop_table "miq_roles_features" - drop_table "miq_requests" - drop_table "miq_request_tasks" - drop_table "miq_reports" - drop_table "miq_report_results" - drop_table "miq_report_result_details" - drop_table "miq_regions" - drop_table "miq_queue" - drop_table "miq_proxies_product_updates" - drop_table "miq_proxies" - drop_table "miq_product_features" - drop_table "miq_policy_contents" - drop_table "miq_policies" - drop_table "miq_license_contents" - drop_table "miq_groups" - drop_table "miq_globals" - drop_table "miq_events" - drop_table "miq_enterprises" - drop_table "miq_dialogs" - drop_table "miq_databases" - drop_table "miq_cim_instances" - drop_table "miq_cim_derived_metrics" - drop_table "miq_cim_associations" - drop_table "miq_approvals" - drop_table "miq_alerts" - drop_table "miq_alert_statuses" - drop_table "miq_ae_workspaces" - drop_table "miq_ae_values" - drop_table "miq_ae_namespaces" - drop_table "miq_ae_methods" - drop_table "miq_ae_instances" - drop_table "miq_ae_fields" - drop_table "miq_ae_classes" - drop_table "miq_actions" - - drop_inheritance_triggers "metrics" - (0..23).each { |n| drop_table subtable_name("metrics", n) } - drop_table "metrics" - - drop_inheritance_triggers "metric_rollups" - (1..12).each { |n| drop_table subtable_name("metric_rollups", n) } - drop_table "metric_rollups" - - drop_table "log_files" - drop_table "lifecycle_events" - drop_table "ldap_users" - drop_table "ldap_servers" - drop_table "ldap_regions" - drop_table "ldap_managements" - drop_table "ldap_groups" - drop_table "ldap_domains" - drop_table "lans" - drop_table "key_pairs_vms" - drop_table "jobs" - drop_table "iso_images" - drop_table "iso_datastores" - drop_table "hosts_storages" - drop_table "hosts" - drop_table "hardwares" - drop_table "guest_devices" - drop_table "guest_applications" - drop_table "floating_ips" - drop_table "flavors" - drop_table "firewall_rules" - drop_table "filesystems" - drop_table "file_depots" - drop_table "ext_management_systems_vdi_desktop_pools" - drop_table "ext_management_systems" - drop_table "event_logs" - drop_table "ems_folders" - drop_table "ems_events" - drop_table "ems_clusters" - drop_table "drift_states" - drop_table "disks" - drop_table "dialogs" - drop_table "dialog_tabs" - drop_table "dialog_groups" - drop_table "dialog_fields" - drop_table "database_backups" - drop_table "customization_templates" - drop_table "customization_specs" - drop_table "custom_buttons" - drop_table "custom_attributes" - drop_table "configurations" - drop_table "conditions_miq_policies" - drop_table "conditions" - drop_table "compliances" - drop_table "compliance_details" - drop_table "cloud_volumes" - drop_table "cloud_volume_snapshots" - drop_table "cloud_subnets" - drop_table "cloud_networks" - drop_table "classifications" - drop_table "chargeback_rates" - drop_table "chargeback_rate_details" - drop_table "bottleneck_events" - drop_table "binary_blobs" - drop_table "binary_blob_parts" - drop_table "availability_zones" - drop_table "authentications" - drop_table "audit_events" - drop_table "assigned_server_roles" - drop_table "advanced_settings" - drop_table "accounts" - - say_with_time("Clean old migrations from schema_migrations") do - connection.truncate("schema_migrations") - end - end - - def create_trigger_language - say_with_time("create_trigger_language") do - language_name = "plpgsql" - - count = connection.select_value <<-EOSQL, 'Query Language' - SELECT COUNT(*) FROM pg_language WHERE lanname = '#{language_name}'; - EOSQL - - if count.to_i == 0 - connection.execute <<-EOSQL, 'Create language' - CREATE LANGUAGE #{language_name}; - EOSQL - end - end - end - - def create_metrics_table(table) - create_table table do |t| - t.datetime "timestamp" - t.integer "capture_interval" - t.string "resource_type" - t.bigint "resource_id" - t.float "cpu_usage_rate_average" - t.float "cpu_usagemhz_rate_average" - t.float "mem_usage_absolute_average" - t.float "disk_usage_rate_average" - t.float "net_usage_rate_average" - t.float "sys_uptime_absolute_latest" - t.datetime "created_on" - t.float "derived_cpu_available" - t.float "derived_memory_available" - t.float "derived_memory_used" - t.float "derived_cpu_reserved" - t.float "derived_memory_reserved" - t.integer "derived_vm_count_on" - t.integer "derived_host_count_on" - t.integer "derived_vm_count_off" - t.integer "derived_host_count_off" - t.float "derived_storage_total" - t.float "derived_storage_free" - t.string "capture_interval_name" - t.text "assoc_ids" - t.float "cpu_ready_delta_summation" - t.float "cpu_system_delta_summation" - t.float "cpu_wait_delta_summation" - t.string "resource_name" - t.float "cpu_used_delta_summation" - t.text "tag_names" - t.bigint "parent_host_id" - t.bigint "parent_ems_cluster_id" - t.bigint "parent_storage_id" - t.bigint "parent_ems_id" - t.float "derived_storage_vm_count_registered" - t.float "derived_storage_vm_count_unregistered" - t.float "derived_storage_vm_count_unmanaged" - t.float "derived_storage_used_registered" - t.float "derived_storage_used_unregistered" - t.float "derived_storage_used_unmanaged" - t.float "derived_storage_snapshot_registered" - t.float "derived_storage_snapshot_unregistered" - t.float "derived_storage_snapshot_unmanaged" - t.float "derived_storage_mem_registered" - t.float "derived_storage_mem_unregistered" - t.float "derived_storage_mem_unmanaged" - t.float "derived_storage_disk_registered" - t.float "derived_storage_disk_unregistered" - t.float "derived_storage_disk_unmanaged" - t.float "derived_storage_vm_count_managed" - t.float "derived_storage_used_managed" - t.float "derived_storage_snapshot_managed" - t.float "derived_storage_mem_managed" - t.float "derived_storage_disk_managed" - t.text "min_max" - t.integer "intervals_in_rollup" - t.float "mem_vmmemctl_absolute_average" - t.float "mem_vmmemctltarget_absolute_average" - t.float "mem_swapin_absolute_average" - t.float "mem_swapout_absolute_average" - t.float "mem_swapped_absolute_average" - t.float "mem_swaptarget_absolute_average" - t.float "disk_devicelatency_absolute_average" - t.float "disk_kernellatency_absolute_average" - t.float "disk_queuelatency_absolute_average" - t.float "derived_vm_used_disk_storage" - t.float "derived_vm_allocated_disk_storage" - t.float "derived_vm_numvcpus" - t.bigint "time_profile_id" - end - end - - def add_metrics_indexes(table) - add_index table, ["resource_id", "resource_type", "capture_interval_name", "timestamp"], :name => "index_#{table}_on_resource_and_ts" - add_index table, ["timestamp", "capture_interval_name", "resource_id", "resource_type"], :name => "index_#{table}_on_ts_and_capture_interval_name" - end - - def subtable_name(inherit_from, index) - "#{inherit_from}_#{index.to_s.rjust(2, '0')}" - end - - # NOTE: The reason we are doing the inheritance with a before that adds and - # an after trigger that deletes is that otherwise returning NULL from the - # before trigger causes INSERT INTO RETURNING to return nil. ActiveRecord - # uses this insert format to get the resultant id, so it ends up creating - # an AR instance with a nil instead of an id. - # See: https://gist.github.com/59067 - - def add_metrics_inheritance_triggers - add_trigger "before", "metrics", "metrics_inheritance_before", <<-EOSQL - CASE EXTRACT(HOUR FROM NEW.timestamp) - WHEN 0 THEN - INSERT INTO metrics_00 VALUES (NEW.*); - WHEN 1 THEN - INSERT INTO metrics_01 VALUES (NEW.*); - WHEN 2 THEN - INSERT INTO metrics_02 VALUES (NEW.*); - WHEN 3 THEN - INSERT INTO metrics_03 VALUES (NEW.*); - WHEN 4 THEN - INSERT INTO metrics_04 VALUES (NEW.*); - WHEN 5 THEN - INSERT INTO metrics_05 VALUES (NEW.*); - WHEN 6 THEN - INSERT INTO metrics_06 VALUES (NEW.*); - WHEN 7 THEN - INSERT INTO metrics_07 VALUES (NEW.*); - WHEN 8 THEN - INSERT INTO metrics_08 VALUES (NEW.*); - WHEN 9 THEN - INSERT INTO metrics_09 VALUES (NEW.*); - WHEN 10 THEN - INSERT INTO metrics_10 VALUES (NEW.*); - WHEN 11 THEN - INSERT INTO metrics_11 VALUES (NEW.*); - WHEN 12 THEN - INSERT INTO metrics_12 VALUES (NEW.*); - WHEN 13 THEN - INSERT INTO metrics_13 VALUES (NEW.*); - WHEN 14 THEN - INSERT INTO metrics_14 VALUES (NEW.*); - WHEN 15 THEN - INSERT INTO metrics_15 VALUES (NEW.*); - WHEN 16 THEN - INSERT INTO metrics_16 VALUES (NEW.*); - WHEN 17 THEN - INSERT INTO metrics_17 VALUES (NEW.*); - WHEN 18 THEN - INSERT INTO metrics_18 VALUES (NEW.*); - WHEN 19 THEN - INSERT INTO metrics_19 VALUES (NEW.*); - WHEN 20 THEN - INSERT INTO metrics_20 VALUES (NEW.*); - WHEN 21 THEN - INSERT INTO metrics_21 VALUES (NEW.*); - WHEN 22 THEN - INSERT INTO metrics_22 VALUES (NEW.*); - WHEN 23 THEN - INSERT INTO metrics_23 VALUES (NEW.*); - END CASE; - RETURN NEW; - EOSQL - - add_trigger "after", "metrics", "metrics_inheritance_after", <<-EOSQL - DELETE FROM ONLY metrics WHERE id = NEW.id; - RETURN NEW; - EOSQL - end - - def add_metric_rollups_inheritance_triggers - add_trigger "before", "metric_rollups", "metric_rollups_inheritance_before", <<-EOSQL - CASE EXTRACT(MONTH FROM NEW.timestamp) - WHEN 1 THEN - INSERT INTO metric_rollups_01 VALUES (NEW.*); - WHEN 2 THEN - INSERT INTO metric_rollups_02 VALUES (NEW.*); - WHEN 3 THEN - INSERT INTO metric_rollups_03 VALUES (NEW.*); - WHEN 4 THEN - INSERT INTO metric_rollups_04 VALUES (NEW.*); - WHEN 5 THEN - INSERT INTO metric_rollups_05 VALUES (NEW.*); - WHEN 6 THEN - INSERT INTO metric_rollups_06 VALUES (NEW.*); - WHEN 7 THEN - INSERT INTO metric_rollups_07 VALUES (NEW.*); - WHEN 8 THEN - INSERT INTO metric_rollups_08 VALUES (NEW.*); - WHEN 9 THEN - INSERT INTO metric_rollups_09 VALUES (NEW.*); - WHEN 10 THEN - INSERT INTO metric_rollups_10 VALUES (NEW.*); - WHEN 11 THEN - INSERT INTO metric_rollups_11 VALUES (NEW.*); - WHEN 12 THEN - INSERT INTO metric_rollups_12 VALUES (NEW.*); - END CASE; - RETURN NEW; - EOSQL - - add_trigger "after", "metric_rollups", "metric_rollups_inheritance_after", <<-EOSQL - DELETE FROM ONLY metric_rollups WHERE id = NEW.id; - RETURN NEW; - EOSQL - end - - def drop_inheritance_triggers(table) - drop_trigger table, "#{table}_inheritance_before" - drop_trigger table, "#{table}_inheritance_after" - end -end diff --git a/db/migrate/20131021190044_remove_miq_license_models_and_table.rb b/db/migrate/20131021190044_remove_miq_license_models_and_table.rb deleted file mode 100644 index ca1cb48f4..000000000 --- a/db/migrate/20131021190044_remove_miq_license_models_and_table.rb +++ /dev/null @@ -1,14 +0,0 @@ -class RemoveMiqLicenseModelsAndTable < ActiveRecord::Migration[4.2] - def up - drop_table :miq_license_contents - end - - def down - create_table :miq_license_contents do |t| - t.text :contents - t.boolean :active - t.datetime :created_on - t.datetime :updated_on - end - end -end diff --git a/db/migrate/20131107000917_expand_dialog_field_default_value_size.rb b/db/migrate/20131107000917_expand_dialog_field_default_value_size.rb deleted file mode 100644 index 3e1686c57..000000000 --- a/db/migrate/20131107000917_expand_dialog_field_default_value_size.rb +++ /dev/null @@ -1,29 +0,0 @@ -class ExpandDialogFieldDefaultValueSize < ActiveRecord::Migration[4.2] - class DialogField < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - include ReservedMigrationMixin - include MigrationStubHelper # NOTE: Must be included after other mixins - end - - def up - change_column :dialog_fields, :default_value, :text - - say_with_time("Migrate data from reserved table") do - DialogField.includes(:reserved_rec).each do |d| - d.reserved_hash_migrate(:default_value) if d.reserved_hash_get(:default_value) - end - end - end - - def down - say_with_time("Migrate data to reserved table") do - DialogField.includes(:reserved_rec).each do |d| - d.reserved_hash_set(:default_value, d.default_value) if d.default_value - d.save! - end - end - - change_column :dialog_fields, :default_value, :string - end -end diff --git a/db/migrate/20131118232818_encrypt_miq_database_registration_http_proxy_password_field.rb b/db/migrate/20131118232818_encrypt_miq_database_registration_http_proxy_password_field.rb deleted file mode 100644 index 1b54f98f8..000000000 --- a/db/migrate/20131118232818_encrypt_miq_database_registration_http_proxy_password_field.rb +++ /dev/null @@ -1,19 +0,0 @@ -class EncryptMiqDatabaseRegistrationHttpProxyPasswordField < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base; end - - def up - say_with_time("Encrypt miq_database registration_http_proxy_password field") do - MiqDatabase.all.each do |db| - db.update_attribute(:registration_http_proxy_password, ManageIQ::Password.encrypt(db.registration_http_proxy_password)) unless ManageIQ::Password.encrypted?(db.registration_http_proxy_password) - end - end - end - - def down - say_with_time("Decrypt miq_database registration_http_proxy_password field") do - MiqDatabase.all.each do |db| - db.update_attribute(:registration_http_proxy_password, ManageIQ::Password.decrypt(db.registration_http_proxy_password)) if ManageIQ::Password.encrypted?(db.registration_http_proxy_password) - end - end - end -end diff --git a/db/migrate/20131121211455_change_options_in_miq_alert.rb b/db/migrate/20131121211455_change_options_in_miq_alert.rb deleted file mode 100644 index 8f2d1a813..000000000 --- a/db/migrate/20131121211455_change_options_in_miq_alert.rb +++ /dev/null @@ -1,18 +0,0 @@ -class ChangeOptionsInMiqAlert < ActiveRecord::Migration[4.2] - class MiqAlert < ActiveRecord::Base - serialize :options - end - - def up - say_with_time("Replacing instances of 'alert@manageiq.com' from canned Alerts with ''") do - MiqAlert.all.each do |a| - value = a.options - email_to = [:notifications, :email, :to] - if value.fetch_path(email_to) == ['alert@manageiq.com'] - value.store_path(email_to, '') - a.save - end - end - end - end -end diff --git a/db/migrate/20131125153220_import_provision_dialogs.rb b/db/migrate/20131125153220_import_provision_dialogs.rb deleted file mode 100644 index 2d49ab13e..000000000 --- a/db/migrate/20131125153220_import_provision_dialogs.rb +++ /dev/null @@ -1,31 +0,0 @@ -class ImportProvisionDialogs < ActiveRecord::Migration[4.2] - class MiqDialog < ActiveRecord::Base - serialize :content - end - - def up - say_with_time("Import Provision dialogs") do - # Convert v4-style provisioning dialogs from Ruby files into YAML format - # and store in the miq_dialogs table. - Dir.glob(Rails.root.join("db/fixtures/*.rb")) do |dialog_file| - begin - dialog_text = File.read(dialog_file) - next unless dialog_text.include?('module MiqProvisionDialogs') && dialog_text.include?('def self.dialogs') - - dialog_name = File.basename(dialog_file, '.*') - - if MiqDialog.exists?(:name => dialog_name) - say "Dialog record already exists for name:<#{dialog_name}>" - else - say "Importing dialog name:<#{dialog_name}>" - load(dialog_file) - MiqDialog.create(:name => dialog_name, :description => dialog_name, :dialog_type => 'MiqProvisionWorkflow', :content => MiqProvisionDialogs.dialogs) - Object.send(:remove_const, :MiqProvisionDialogs) - end - rescue ScriptError, StandardError => err - say "Failed to import dialog from file <#{dialog_file}>. Error: <#{err}>" - end - end - end - end -end diff --git a/db/migrate/20131210202928_update_log_collection_path_in_configurations_settings.rb b/db/migrate/20131210202928_update_log_collection_path_in_configurations_settings.rb deleted file mode 100644 index d41d61c79..000000000 --- a/db/migrate/20131210202928_update_log_collection_path_in_configurations_settings.rb +++ /dev/null @@ -1,30 +0,0 @@ -class UpdateLogCollectionPathInConfigurationsSettings < ActiveRecord::Migration[4.2] - class Configuration < ActiveRecord::Base - serialize :settings - end - - NEW_PG_CONF_PATH = "/opt/rh/postgresql92/root/var/lib/pgsql/data/*.conf" - NEW_PG_LOGS_PATH = "/opt/rh/postgresql92/root/var/lib/pgsql/data/pg_log/*" - OLD_PG_CONF_PATH = "/var/lib/pgsql/data/*.conf" - OLD_PG_LOGS_PATH = "/var/lib/pgsql/data/serverlog*" - - def up - say_with_time("Updating PG paths in VMDB configurations") { change_pg_log_paths("OLD", "NEW") } - end - - def down - say_with_time("Reverting PG paths in VMDB configurations") { change_pg_log_paths("NEW", "OLD") } - end - - def change_pg_log_paths(current_path, desired_path) - Configuration.where(:typ => "vmdb").each do |c| - path = ["log", "collection", :current, :pattern] - pg_conf_index = c.settings.fetch_path(path).try(:index, self.class.const_get("#{current_path}_PG_CONF_PATH")) - pg_logs_index = c.settings.fetch_path(path).try(:index, self.class.const_get("#{current_path}_PG_LOGS_PATH")) - - c.settings.store_path(path.dup.push(pg_conf_index), self.class.const_get("#{desired_path}_PG_CONF_PATH")) if pg_conf_index - c.settings.store_path(path.dup.push(pg_logs_index), self.class.const_get("#{desired_path}_PG_LOGS_PATH")) if pg_logs_index - c.save - end - end -end diff --git a/db/migrate/20131213173452_change_index_on_miq_queue_v2.rb b/db/migrate/20131213173452_change_index_on_miq_queue_v2.rb deleted file mode 100644 index f38b2bbc8..000000000 --- a/db/migrate/20131213173452_change_index_on_miq_queue_v2.rb +++ /dev/null @@ -1,26 +0,0 @@ -class ChangeIndexOnMiqQueueV2 < ActiveRecord::Migration[4.2] - def up - remove_index :miq_queue, :name => "miq_queue_idx" - - # MiqQueue.find_by_task_id - add_index :miq_queue, :task_id - - # query for GET/PEEK - execute "CREATE INDEX miq_queue_get_idx ON miq_queue(queue_name, zone, role, server_guid, priority, deliver_on, task_id) WHERE state = 'ready'" - - # sub query for GET - execute "CREATE INDEX miq_queue_get_sub_idx on miq_queue(task_id, zone) WHERE state = 'dequeue' AND task_id IS NOT NULL" - - # query for put_updates - add_index :miq_queue, %w(class_name method_name queue_name state zone), :name => 'miq_queue_put_idx' - end - - def down - remove_index :miq_queue, :task_id - remove_index :miq_queue, :name => 'miq_queue_get_idx' - remove_index :miq_queue, :name => "miq_queue_get_sub_idx" - remove_index :miq_queue, :name => "miq_queue_put_idx" - - add_index :miq_queue, [:state, :zone, :task_id, :queue_name, :role, :server_guid, :deliver_on, :priority, :id], :name => "miq_queue_idx" - end -end diff --git a/db/migrate/20131216214850_fix_replication_on_upgrade_from_version_four.rb b/db/migrate/20131216214850_fix_replication_on_upgrade_from_version_four.rb deleted file mode 100644 index 082d8fa1e..000000000 --- a/db/migrate/20131216214850_fix_replication_on_upgrade_from_version_four.rb +++ /dev/null @@ -1,136 +0,0 @@ -class FixReplicationOnUpgradeFromVersionFour < ActiveRecord::Migration[4.2] - include MigrationHelper - - class Configuration < ActiveRecord::Base - serialize :settings - end - - V5_DEFAULT_EXCLUDE_TABLES = %w( - assigned_server_roles - audit_events - binary_blobs - binary_blob_parts - chargeback_rate_details - chargeback_rates - conditions - conditions_miq_policies - configurations - custom_buttons - customization_specs - database_backups - event_logs - file_depots - jobs - log_files - metrics - metrics_00 - metrics_01 - metrics_02 - metrics_03 - metrics_04 - metrics_05 - metrics_06 - metrics_07 - metrics_08 - metrics_09 - metrics_10 - metrics_11 - metrics_12 - metrics_13 - metrics_14 - metrics_15 - metrics_16 - metrics_17 - metrics_18 - metrics_19 - metrics_20 - metrics_21 - metrics_22 - metrics_23 - metric_rollups - miq_actions - miq_ae_classes - miq_ae_fields - miq_ae_instances - miq_ae_methods - miq_ae_namespaces - miq_ae_values - miq_ae_workspaces - miq_alert_statuses - miq_alerts - miq_databases - miq_enterprises - miq_events - miq_globals - miq_groups - miq_license_contents - miq_policies - miq_policy_contents - miq_product_features - miq_proxies_product_updates - miq_proxies - miq_queue - miq_roles_features - miq_report_result_details - miq_report_results - miq_reports - miq_searches - miq_servers_product_updates - miq_sets - miq_schedules - miq_tasks - miq_user_roles - miq_widgets - miq_widget_contents - miq_workers - product_updates - proxy_tasks - rss_feeds - schema_migrations - server_roles - sessions - ui_tasks - vim_performances - vim_performance_states - vim_performance_tag_values - vmdb_database_metrics - vmdb_databases - vmdb_indexes - vmdb_metrics - vmdb_tables - ) - - RENAMED_TABLES = { - "states" => "drift_states", - "miq_cim_derived_stats" => "miq_cim_derived_metrics", - "miq_provisions" => "miq_request_tasks", - "miq_cim_stats" => "miq_storage_metrics", - "storages_vms" => "storages_vms_and_templates", - } - - REMOVED_TABLES = %w( - automation_requests - automation_tasks - miq_provision_requests - vim_performances - ) - - def up - say_with_time("Updating configurations for replication") do - path = ["workers", "worker_base", :replication_worker, :replication] - Configuration.where(:typ => "vmdb").each do |c| - settings_path = path.dup.push(:include_tables) - Rails.logger.info("Removing the path [#{settings_path.join(", ")}] from Configuration id [#{c.id}].") - Rails.logger.info("Current value is:\n#{c.settings.fetch_path(settings_path).to_yaml}") - c.settings.delete_path(settings_path) - - settings_path = path.dup.push(:exclude_tables) - Rails.logger.info("Replacing the path [#{settings_path.join(", ")}] from Configuration id [#{c.id}].") - Rails.logger.info("Current value is:\n#{c.settings.fetch_path(settings_path).to_yaml}") - c.settings.store_path(settings_path, V5_DEFAULT_EXCLUDE_TABLES) - - c.save! - end - end - end -end diff --git a/db/migrate/20140106184152_remove_miq_queue_md5.rb b/db/migrate/20140106184152_remove_miq_queue_md5.rb deleted file mode 100644 index 2786f42cd..000000000 --- a/db/migrate/20140106184152_remove_miq_queue_md5.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveMiqQueueMd5 < ActiveRecord::Migration[4.2] - def up - remove_column :miq_queue, :md5 - end - - def down - add_column :miq_queue, :md5, :string - end -end diff --git a/db/migrate/20140115160139_add_openstack_fields_to_cloud_networks.rb b/db/migrate/20140115160139_add_openstack_fields_to_cloud_networks.rb deleted file mode 100644 index de0da70b8..000000000 --- a/db/migrate/20140115160139_add_openstack_fields_to_cloud_networks.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddOpenstackFieldsToCloudNetworks < ActiveRecord::Migration[4.2] - def change - add_column :cloud_networks, :status, :string - add_column :cloud_networks, :enabled, :boolean - add_column :cloud_networks, :external_facing, :boolean - end -end diff --git a/db/migrate/20140115160609_add_openstack_fields_to_cloud_subnets.rb b/db/migrate/20140115160609_add_openstack_fields_to_cloud_subnets.rb deleted file mode 100644 index 4140cfae7..000000000 --- a/db/migrate/20140115160609_add_openstack_fields_to_cloud_subnets.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddOpenstackFieldsToCloudSubnets < ActiveRecord::Migration[4.2] - def change - add_column :cloud_subnets, :dhcp_enabled, :boolean - add_column :cloud_subnets, :gateway, :string - add_column :cloud_subnets, :network_protocol, :string - end -end diff --git a/db/migrate/20140121213913_split_widget_set_name_to_three_columns.rb b/db/migrate/20140121213913_split_widget_set_name_to_three_columns.rb deleted file mode 100644 index 02f244ba4..000000000 --- a/db/migrate/20140121213913_split_widget_set_name_to_three_columns.rb +++ /dev/null @@ -1,37 +0,0 @@ -class SplitWidgetSetNameToThreeColumns < ActiveRecord::Migration[4.2] - class MiqSet < ActiveRecord::Base; end - - def up - add_column :miq_sets, :userid, :string - add_column :miq_sets, :group_id, :bigint - - say_with_time("Splitting name column for MiqWidgetSet") do - MiqSet.where(:set_type => 'MiqWidgetSet').each do |ws| - next unless ws.name.include?("|") - items = ws.name.split("|") - if items.size == 3 - userid, group_id, name = items - ws.update(:name => name, :userid => userid, :group_id => group_id) - else - ws.destroy - end - end - end - - add_index :miq_sets, :userid - add_index :miq_sets, :group_id - end - - def down - MiqSet.where(:set_type => 'MiqWidgetSet').each do |ws| - next if ws.userid.nil? || ws.group_id.nil? - name = "#{ws.userid}|#{ws.group_id}|#{ws.name}" - ws.update(:name => name) - end - - remove_index :miq_sets, :userid - remove_index :miq_sets, :group_id - remove_column :miq_sets, :userid - remove_column :miq_sets, :group_id - end -end diff --git a/db/migrate/20140201040548_add_update_repo_name_to_miq_database.rb b/db/migrate/20140201040548_add_update_repo_name_to_miq_database.rb deleted file mode 100644 index c5c4b8bdf..000000000 --- a/db/migrate/20140201040548_add_update_repo_name_to_miq_database.rb +++ /dev/null @@ -1,27 +0,0 @@ -class AddUpdateRepoNameToMiqDatabase < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base - include ReservedMigrationMixin - include MigrationStubHelper # NOTE: Must be included after other mixins - end - - def up - add_column :miq_databases, :update_repo_name, :string - - say_with_time("Migrate data from reserved table") do - MiqDatabase.includes(:reserved_rec).each do |db| - db.reserved_hash_migrate(:update_repo_name) - end - end - end - - def down - say_with_time("Migrating update_repo_name to Reserves table") do - MiqDatabase.includes(:reserved_rec).each do |d| - d.reserved_hash_set(:update_repo_name, d.update_repo_name) - d.save! - end - end - - remove_column :miq_databases, :update_repo_name - end -end diff --git a/db/migrate/20140207203449_add_system_to_miq_ae_namespaces.rb b/db/migrate/20140207203449_add_system_to_miq_ae_namespaces.rb deleted file mode 100644 index 0c488b497..000000000 --- a/db/migrate/20140207203449_add_system_to_miq_ae_namespaces.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSystemToMiqAeNamespaces < ActiveRecord::Migration[4.2] - def change - add_column :miq_ae_namespaces, :system, :boolean - end -end diff --git a/db/migrate/20140210175651_create_import_file_uploads.rb b/db/migrate/20140210175651_create_import_file_uploads.rb deleted file mode 100644 index 6e7675a1a..000000000 --- a/db/migrate/20140210175651_create_import_file_uploads.rb +++ /dev/null @@ -1,5 +0,0 @@ -class CreateImportFileUploads < ActiveRecord::Migration[4.2] - def change - create_table :import_file_uploads - end -end diff --git a/db/migrate/20140211141513_add_priority_to_miq_ae_namespaces.rb b/db/migrate/20140211141513_add_priority_to_miq_ae_namespaces.rb deleted file mode 100644 index 69d989968..000000000 --- a/db/migrate/20140211141513_add_priority_to_miq_ae_namespaces.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddPriorityToMiqAeNamespaces < ActiveRecord::Migration[4.2] - def change - add_column :miq_ae_namespaces, :priority, :integer - end -end diff --git a/db/migrate/20140214191729_enhance_firewall_rules_for_neutron_networking.rb b/db/migrate/20140214191729_enhance_firewall_rules_for_neutron_networking.rb deleted file mode 100644 index 31da18df4..000000000 --- a/db/migrate/20140214191729_enhance_firewall_rules_for_neutron_networking.rb +++ /dev/null @@ -1,32 +0,0 @@ -class EnhanceFirewallRulesForNeutronNetworking < ActiveRecord::Migration[4.2] - class FirewallRule < ActiveRecord::Base - include ReservedMigrationMixin - include MigrationStubHelper # NOTE: Must be included after other mixins - end - - def up - add_column :firewall_rules, :ems_ref, :string - add_column :firewall_rules, :network_protocol, :string - rename_column :firewall_rules, :protocol, :host_protocol - - say_with_time("Migrate ems_ref and network_protocol from reserved table") do - FirewallRule.includes(:reserved_rec).each do |fr| - fr.reserved_hash_migrate(:ems_ref, :network_protocol) - end - end - end - - def down - say_with_time("Migrating ems_ref and network_protocol to Reserves table") do - FirewallRule.includes(:reserved_rec).each do |d| - d.reserved_hash_set(:ems_ref, d.ems_ref) - d.reserved_hash_set(:network_protocol, d.network_protocol) - d.save! - end - end - - remove_column :firewall_rules, :ems_ref - remove_column :firewall_rules, :network_protocol - rename_column :firewall_rules, :host_protocol, :protocol - end -end diff --git a/db/migrate/20140218232357_add_group_and_user_columns_to_miq_widget_contents.rb b/db/migrate/20140218232357_add_group_and_user_columns_to_miq_widget_contents.rb deleted file mode 100644 index bb93e8119..000000000 --- a/db/migrate/20140218232357_add_group_and_user_columns_to_miq_widget_contents.rb +++ /dev/null @@ -1,29 +0,0 @@ -class AddGroupAndUserColumnsToMiqWidgetContents < ActiveRecord::Migration[4.2] - class MiqWidgetContent < ActiveRecord::Base; end - - def up - add_column :miq_widget_contents, :miq_group_id, :bigint - add_column :miq_widget_contents, :user_id, :bigint - add_index :miq_widget_contents, :user_id - remove_index :miq_widget_contents, :owner_id - remove_column :miq_widget_contents, :owner_type - remove_column :miq_widget_contents, :owner_id - - say_with_time "Remove all existing widget content" do - MiqWidgetContent.delete_all - end - end - - def down - add_column :miq_widget_contents, :owner_type, :string - add_column :miq_widget_contents, :owner_id, :bigint - add_index :miq_widget_contents, :owner_id - remove_index :miq_widget_contents, :user_id - remove_column :miq_widget_contents, :miq_group_id - remove_column :miq_widget_contents, :user_id - - say_with_time "Remove all existing widget content" do - MiqWidgetContent.delete_all - end - end -end diff --git a/db/migrate/20140228153536_create_cloud_tenants.rb b/db/migrate/20140228153536_create_cloud_tenants.rb deleted file mode 100644 index 2e271d01d..000000000 --- a/db/migrate/20140228153536_create_cloud_tenants.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateCloudTenants < ActiveRecord::Migration[4.2] - def change - create_table :cloud_tenants do |t| - t.string :name - t.string :description - t.boolean :enabled - t.string :ems_ref - - t.belongs_to :ems, :type => :bigint - - t.timestamps :null => true - end - end -end diff --git a/db/migrate/20140301034340_leverage_authentications_for_registration_http_proxy_credentials.rb b/db/migrate/20140301034340_leverage_authentications_for_registration_http_proxy_credentials.rb deleted file mode 100644 index 134ffcf18..000000000 --- a/db/migrate/20140301034340_leverage_authentications_for_registration_http_proxy_credentials.rb +++ /dev/null @@ -1,48 +0,0 @@ -class LeverageAuthenticationsForRegistrationHttpProxyCredentials < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base; end - - class Authentication < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - say_with_time("Leverage Authentication mixin for registration_http_proxy credentials") do - MiqDatabase.all.each do |db| - Authentication.create( - :authtype => "registration_http_proxy", - :name => "MiqDatabase vmdb_development", - :userid => db.registration_http_proxy_username, - :password => ManageIQ::Password.try_encrypt(db.registration_http_proxy_password), - :resource_id => db.id, - :resource_type => "MiqDatabase", - :type => "AuthUseridPassword" - ) - end - end - - remove_column :miq_databases, :registration_http_proxy_username - remove_column :miq_databases, :registration_http_proxy_password - end - - def down - add_column :miq_databases, :registration_http_proxy_username, :string - add_column :miq_databases, :registration_http_proxy_password, :string - - say_with_time("Move registration_http_proxy credentials from Authentication to MiqDatabase record") do - MiqDatabase.all.each do |db| - auth = Authentication.where( - :authtype => "registration_http_proxy", - :resource_type => "MiqDatabase", - :resource_id => db.id, - ).first - - db.update( - :registration_http_proxy_username => auth.userid, - :registration_http_proxy_password => ManageIQ::Password.try_encrypt(auth.password) - ) - - auth.destroy - end - end - end -end diff --git a/db/migrate/20140306150006_add_cloud_tenant_ref_to_security_groups.rb b/db/migrate/20140306150006_add_cloud_tenant_ref_to_security_groups.rb deleted file mode 100644 index 9af943e22..000000000 --- a/db/migrate/20140306150006_add_cloud_tenant_ref_to_security_groups.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddCloudTenantRefToSecurityGroups < ActiveRecord::Migration[4.2] - def self.up - change_table :security_groups do |t| - t.belongs_to :cloud_tenant, :type => :bigint - end - end - - def self.down - change_table :security_groups do |t| - t.remove_belongs_to :cloud_tenant - end - end -end diff --git a/db/migrate/20140306153718_add_cloud_tenant_ref_to_cloud_networks.rb b/db/migrate/20140306153718_add_cloud_tenant_ref_to_cloud_networks.rb deleted file mode 100644 index 7c230a482..000000000 --- a/db/migrate/20140306153718_add_cloud_tenant_ref_to_cloud_networks.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddCloudTenantRefToCloudNetworks < ActiveRecord::Migration[4.2] - def self.up - change_table :cloud_networks do |t| - t.belongs_to :cloud_tenant, :type => :bigint - end - end - - def self.down - change_table :cloud_networks do |t| - t.remove_belongs_to :cloud_tenant - end - end -end diff --git a/db/migrate/20140306154541_add_cloud_tenant_ref_to_vms.rb b/db/migrate/20140306154541_add_cloud_tenant_ref_to_vms.rb deleted file mode 100644 index 15f929ac0..000000000 --- a/db/migrate/20140306154541_add_cloud_tenant_ref_to_vms.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddCloudTenantRefToVms < ActiveRecord::Migration[4.2] - def self.up - change_table :vms do |t| - t.belongs_to :cloud_tenant, :type => :bigint - end - end - - def self.down - change_table :vms do |t| - t.remove_belongs_to :cloud_tenant - end - end -end diff --git a/db/migrate/20140306154747_add_cloud_tenant_ref_to_floating_ips.rb b/db/migrate/20140306154747_add_cloud_tenant_ref_to_floating_ips.rb deleted file mode 100644 index bdd38b903..000000000 --- a/db/migrate/20140306154747_add_cloud_tenant_ref_to_floating_ips.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddCloudTenantRefToFloatingIps < ActiveRecord::Migration[4.2] - def self.up - change_table :floating_ips do |t| - t.belongs_to :cloud_tenant, :type => :bigint - end - end - - def self.down - change_table :floating_ips do |t| - t.remove_belongs_to :cloud_tenant - end - end -end diff --git a/db/migrate/20140402134329_change_utc_time_profile_type_to_global.rb b/db/migrate/20140402134329_change_utc_time_profile_type_to_global.rb deleted file mode 100644 index 0b3cd05a6..000000000 --- a/db/migrate/20140402134329_change_utc_time_profile_type_to_global.rb +++ /dev/null @@ -1,14 +0,0 @@ -class ChangeUtcTimeProfileTypeToGlobal < ActiveRecord::Migration[4.2] - class TimeProfile < ActiveRecord::Base; end - - def up - say_with_time("Change Default UTC Time Profile to Type Global") do - TimeProfile.all.each do |tp| - if tp.profile_type.nil? - tp.profile_type = "global" - tp.save - end - end - end - end -end diff --git a/db/migrate/20140409134713_move_log_collection_depot_settings_to_file_depot.rb b/db/migrate/20140409134713_move_log_collection_depot_settings_to_file_depot.rb deleted file mode 100644 index f4b69dff9..000000000 --- a/db/migrate/20140409134713_move_log_collection_depot_settings_to_file_depot.rb +++ /dev/null @@ -1,76 +0,0 @@ -class MoveLogCollectionDepotSettingsToFileDepot < ActiveRecord::Migration[4.2] - class Authentication < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Configuration < ActiveRecord::Base - serialize :settings, Hash - end - - class FileDepot < ActiveRecord::Base; end - - class MiqServer < ActiveRecord::Base; end - - class Zone < ActiveRecord::Base - serialize :settings, Hash - end - - def up - add_column :miq_servers, :log_file_depot_id, :bigint - add_column :zones, :log_file_depot_id, :bigint - - say_with_time("Moving log_depot configuration from settings to FileDepots") do - Zone.all.each do |zone| - move_log_settings_to_file_depot("Zone", zone.id, zone.settings) - zone.save - end - - Configuration.where(:typ => "vmdb").each do |config| - move_log_settings_to_file_depot("MiqServer", config.miq_server_id, config.settings) - config.save - end - end - end - - def down - remove_column :miq_servers, :log_file_depot_id - remove_column :zones, :log_file_depot_id - - # TODO: Down Migration? - end - - private - - def create_authentication(depot, settings) - Authentication.create!( - :authtype => "default", - :name => "FileDepot", - :userid => settings[:username], - :password => ManageIQ::Password.try_encrypt(settings[:password]), - :resource_id => depot.id, - :resource_type => "FileDepot", - :type => "AuthUseridPassword" - ) - end - - def create_depot(resource_type, resource_id, settings) - depot = FileDepot.create!( - :resource_type => resource_type, - :resource_id => resource_id, - :uri => settings[:uri], - ) - - self.class.const_get(resource_type).where(:id => resource_id).update_all(:log_file_depot_id => depot.id) - - depot - end - - def move_log_settings_to_file_depot(resource_type, resource_id, config) - settings = config.delete("log_depot") || config.delete(:log_depot) - return if settings.blank? - - settings.symbolize_keys! - depot = create_depot(resource_type, resource_id, settings) - create_authentication(depot, settings) - end -end diff --git a/db/migrate/20140410132430_subclass_file_depot_by_protocol.rb b/db/migrate/20140410132430_subclass_file_depot_by_protocol.rb deleted file mode 100644 index e55e3b5c3..000000000 --- a/db/migrate/20140410132430_subclass_file_depot_by_protocol.rb +++ /dev/null @@ -1,34 +0,0 @@ -class SubclassFileDepotByProtocol < ActiveRecord::Migration[4.2] - class FileDepot < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - add_column :file_depots, :type, :string - - say_with_time("Sub-classing all FileDepots") do - FileDepot.all.each do |fd| - new_type = type_from_uri(fd.uri.to_s) - new_type.blank? ? fd.destroy : fd.update(:type => new_type) - end - end - end - - def down - remove_column :file_depots, :type - end - - private - - PROTOCOL_TRANSLATIONS = { - 'ftp' => 'FileDepotFtp', - 'nfs' => 'FileDepotNfs', - 'smb' => 'FileDepotSmb', - } - - def type_from_uri(uri) - protocol = URI(uri).scheme - - PROTOCOL_TRANSLATIONS[protocol] - end -end diff --git a/db/migrate/20140415212812_add_hidden_column_to_product_features.rb b/db/migrate/20140415212812_add_hidden_column_to_product_features.rb deleted file mode 100644 index 4e86b6b7c..000000000 --- a/db/migrate/20140415212812_add_hidden_column_to_product_features.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddHiddenColumnToProductFeatures < ActiveRecord::Migration[4.2] - def change - add_column :miq_product_features, :hidden, :boolean - end -end diff --git a/db/migrate/20140421150958_create_miq_groups_users_join_table.rb b/db/migrate/20140421150958_create_miq_groups_users_join_table.rb deleted file mode 100644 index f3764eaa6..000000000 --- a/db/migrate/20140421150958_create_miq_groups_users_join_table.rb +++ /dev/null @@ -1,38 +0,0 @@ -class CreateMiqGroupsUsersJoinTable < ActiveRecord::Migration[4.2] - class MiqGroupsUsers < ActiveRecord::Base - self.primary_key = nil - end - - class User < ActiveRecord::Base - include ReservedMigrationMixin - include MigrationStubHelper # NOTE: Must be included after other mixins - end - - def up - create_table :miq_groups_users, :id => false do |t| - t.bigint :miq_group_id - t.bigint :user_id - end - - say_with_time("Migrate eligible_miq_group_ids from reserved column") do - User.includes(:reserved_rec).each do |u| - group_ids = u.reserved_hash_get(:eligible_miq_group_ids) - next if group_ids.nil? - - u.reserved_hash_set(:eligible_miq_group_ids, nil) - u.save! - - group_ids.each do |gid| - MiqGroupsUsers.create!(:miq_group_id => gid, :user_id => u.id) - end - end - end - - add_index :miq_groups_users, [:user_id, :miq_group_id], :unique => true - end - - def down - remove_index :miq_groups_users, [:user_id, :miq_group_id] - drop_table :miq_groups_users - end -end diff --git a/db/migrate/20140421192753_add_enabled_to_miq_ae_namespaces.rb b/db/migrate/20140421192753_add_enabled_to_miq_ae_namespaces.rb deleted file mode 100644 index 23c101239..000000000 --- a/db/migrate/20140421192753_add_enabled_to_miq_ae_namespaces.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddEnabledToMiqAeNamespaces < ActiveRecord::Migration[4.2] - def change - add_column :miq_ae_namespaces, :enabled, :boolean - end -end diff --git a/db/migrate/20140424173120_migrate_automate_to_customer_domain.rb b/db/migrate/20140424173120_migrate_automate_to_customer_domain.rb deleted file mode 100644 index 4e9b8b065..000000000 --- a/db/migrate/20140424173120_migrate_automate_to_customer_domain.rb +++ /dev/null @@ -1,65 +0,0 @@ -class MigrateAutomateToCustomerDomain < ActiveRecord::Migration[4.2] - class MiqAeNamespace < ActiveRecord::Base - def self.root_instances - where(:parent_id => nil).where(arel_table[:name].not_eq("$")) - end - - def self.all_domains - root_instances.where(arel_table[:priority].not_eq(nil)) - end - - def self.root_namespaces - root_instances.where(:priority => nil) - end - end - - class MiqAeClass < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - CUSTOMER_DOMAIN = "Customer" - - def up - say_with_time("Migrate Automate root namespaces to Customer domain") do - if MiqAeNamespace.root_namespaces.count > 0 - domain = MiqAeNamespace.create!(:name => CUSTOMER_DOMAIN, :priority => 1, :enabled => true, :updated_by => "system") - MiqAeNamespace.root_namespaces.update_all(:parent_id => domain.id) - - migrate_miq_ae_class - end - end - end - - def down - say_with_time("Migrate Automate Customer domain namespaces to root namespaces") do - domain = MiqAeNamespace.all_domains.where(:name => CUSTOMER_DOMAIN).first - if domain - MiqAeNamespace.where(:parent_id => domain.id).update_all(:parent_id => nil) - - revert_miq_ae_class - domain.destroy - end - end - end - - def inherited_miq_ae_classes(&_block) - MiqAeClass.where(MiqAeClass.arel_table[:inherits].not_eq(nil)).where("inherits NOT LIKE '$/%'") - end - - def migrate_miq_ae_class - domain_names = MiqAeNamespace.all_domains.where(MiqAeNamespace.arel_table[:name].not_eq("Customer")).pluck(:name) - - inherited_miq_ae_classes.each do |ae_class| - next if domain_names.include?(ae_class.inherits.split("/").first) - ae_class.update(:inherits => File.join(CUSTOMER_DOMAIN, ae_class.inherits)) - end - end - - def revert_miq_ae_class - inherited_miq_ae_classes.each do |ae_class| - if ae_class.inherits.starts_with?("#{CUSTOMER_DOMAIN}/") - ae_class.update(:inherits => ae_class.inherits.sub("#{CUSTOMER_DOMAIN}/", '')) - end - end - end -end diff --git a/db/migrate/20140428145436_add_validator_to_service_dialog_field.rb b/db/migrate/20140428145436_add_validator_to_service_dialog_field.rb deleted file mode 100644 index b733afbd8..000000000 --- a/db/migrate/20140428145436_add_validator_to_service_dialog_field.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddValidatorToServiceDialogField < ActiveRecord::Migration[4.2] - def change - add_column :dialog_fields, :validator_type, :string - add_column :dialog_fields, :validator_rule, :string - end -end diff --git a/db/migrate/20140428155842_add_reconfigurable_to_dialog_field.rb b/db/migrate/20140428155842_add_reconfigurable_to_dialog_field.rb deleted file mode 100644 index 500221d38..000000000 --- a/db/migrate/20140428155842_add_reconfigurable_to_dialog_field.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddReconfigurableToDialogField < ActiveRecord::Migration[4.2] - def change - add_column :dialog_fields, :reconfigurable, :boolean - end -end diff --git a/db/migrate/20140428162159_rename_miq_group_id_column_in_users.rb b/db/migrate/20140428162159_rename_miq_group_id_column_in_users.rb deleted file mode 100644 index 1867f03c7..000000000 --- a/db/migrate/20140428162159_rename_miq_group_id_column_in_users.rb +++ /dev/null @@ -1,13 +0,0 @@ -class RenameMiqGroupIdColumnInUsers < ActiveRecord::Migration[4.2] - def up - remove_index :users, :miq_group_id - rename_column :users, :miq_group_id, :current_group_id - add_index :users, :current_group_id - end - - def down - remove_index :users, :current_group_id - rename_column :users, :current_group_id, :miq_group_id - add_index :users, :miq_group_id - end -end diff --git a/db/migrate/20140519211930_add_user_current_group_to_miq_groups.rb b/db/migrate/20140519211930_add_user_current_group_to_miq_groups.rb deleted file mode 100644 index e9be74017..000000000 --- a/db/migrate/20140519211930_add_user_current_group_to_miq_groups.rb +++ /dev/null @@ -1,22 +0,0 @@ -class AddUserCurrentGroupToMiqGroups < ActiveRecord::Migration[4.2] - class User < ActiveRecord::Base - belongs_to :current_group, :class_name => "AddUserCurrentGroupToMiqGroups::MiqGroup" - has_and_belongs_to_many :miq_groups, :class_name => "AddUserCurrentGroupToMiqGroups::MiqGroup" - end - - class MiqGroup < ActiveRecord::Base; end - - def up - say_with_time("Migrating current_group into user's miq_groups") do - User.where("current_group_id IS NOT NULL").each do |u| - current = u.current_group - if current - u.miq_groups << u.current_group unless u.miq_groups.include?(current) - else - # Fixes an issue where existing databases could have orphaned current_group_ids - u.update(:current_group_id => nil) - end - end - end - end -end diff --git a/db/migrate/20140520202225_add_file_depot_id_to_log_file.rb b/db/migrate/20140520202225_add_file_depot_id_to_log_file.rb deleted file mode 100644 index fe8033a95..000000000 --- a/db/migrate/20140520202225_add_file_depot_id_to_log_file.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddFileDepotIdToLogFile < ActiveRecord::Migration[4.2] - def up - add_column :log_files, :file_depot_id, :bigint - end - - def down - remove_column :log_files, :file_depot_id - end -end diff --git a/db/migrate/20140522201901_add_local_file_to_log_file.rb b/db/migrate/20140522201901_add_local_file_to_log_file.rb deleted file mode 100644 index 5dcbd7b09..000000000 --- a/db/migrate/20140522201901_add_local_file_to_log_file.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddLocalFileToLogFile < ActiveRecord::Migration[4.2] - def up - add_column :log_files, :local_file, :string - end - - def down - remove_column :log_files, :local_file - end -end diff --git a/db/migrate/20140611194007_change_options_in_miq_alert_for_email_to.rb b/db/migrate/20140611194007_change_options_in_miq_alert_for_email_to.rb deleted file mode 100644 index 92b9cb4d6..000000000 --- a/db/migrate/20140611194007_change_options_in_miq_alert_for_email_to.rb +++ /dev/null @@ -1,19 +0,0 @@ -class ChangeOptionsInMiqAlertForEmailTo < ActiveRecord::Migration[4.2] - class MiqAlert < ActiveRecord::Base - serialize :options - end - - def up - say_with_time("Changing email-to list from string to array") do - email_to_path = [:notifications, :email, :to] - MiqAlert.all.each do |a| - value = a.options - email_to_str = value.fetch_path(email_to_path) - if email_to_str.kind_of? String - value.store_path(email_to_path, email_to_str.lines.collect(&:chomp)) - a.save! - end - end - end - end -end diff --git a/db/migrate/20140612181021_update_cloud_volume_and_cloud_volume_snapshot.rb b/db/migrate/20140612181021_update_cloud_volume_and_cloud_volume_snapshot.rb deleted file mode 100644 index 3b54d742f..000000000 --- a/db/migrate/20140612181021_update_cloud_volume_and_cloud_volume_snapshot.rb +++ /dev/null @@ -1,47 +0,0 @@ -class UpdateCloudVolumeAndCloudVolumeSnapshot < ActiveRecord::Migration[4.2] - def up - change_table :cloud_volumes do |t| - t.remove :vm_id - t.remove :device_name - - t.string :status - t.string :description - t.string :volume_type - t.boolean :bootable - t.datetime :creation_time - - t.belongs_to :cloud_tenant, :type => :bigint - end - - change_table :cloud_volume_snapshots do |t| - t.string :status - t.datetime :creation_time - t.integer :size, :limit => 8 - - t.belongs_to :cloud_tenant, :type => :bigint - end - end - - def down - change_table :cloud_volumes do |t| - t.belongs_to :vm, :type => :bigint - t.string :device_name - - t.remove :status - t.remove :description - t.remove :volume_type - t.remove :bootable - t.remove :creation_time - - t.remove :cloud_tenant_id - end - - change_table :cloud_volume_snapshots do |t| - t.remove :status - t.remove :creation_time - t.remove :size - - t.remove :cloud_tenant_id - end - end -end diff --git a/db/migrate/20140612212226_create_cloud_object_store_containers_and_cloud_object_store_objects.rb b/db/migrate/20140612212226_create_cloud_object_store_containers_and_cloud_object_store_objects.rb deleted file mode 100644 index 581430ccc..000000000 --- a/db/migrate/20140612212226_create_cloud_object_store_containers_and_cloud_object_store_objects.rb +++ /dev/null @@ -1,24 +0,0 @@ -class CreateCloudObjectStoreContainersAndCloudObjectStoreObjects < ActiveRecord::Migration[4.2] - def change - create_table :cloud_object_store_containers do |t| - t.string :ems_ref - t.string :key - t.integer :object_count - t.bigint :bytes - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - end - - create_table :cloud_object_store_objects do |t| - t.string :ems_ref - t.string :etag - t.string :key - t.string :content_type - t.bigint :content_length - t.datetime :last_modified - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - t.belongs_to :cloud_object_store_container, :type => :bigint - end - end -end diff --git a/db/migrate/20140613041358_add_backing_id_to_disks.rb b/db/migrate/20140613041358_add_backing_id_to_disks.rb deleted file mode 100644 index f21d162b4..000000000 --- a/db/migrate/20140613041358_add_backing_id_to_disks.rb +++ /dev/null @@ -1,15 +0,0 @@ -class AddBackingIdToDisks < ActiveRecord::Migration[4.2] - def up - change_table :disks do |t| - t.integer :backing_id, :limit => 8 - t.string :backing_type - end - end - - def down - change_table :disks do |t| - t.remove :backing_id - t.remove :backing_type - end - end -end diff --git a/db/migrate/20140620201430_create_cloud_resource_quotas.rb b/db/migrate/20140620201430_create_cloud_resource_quotas.rb deleted file mode 100644 index 8dd7bfdfb..000000000 --- a/db/migrate/20140620201430_create_cloud_resource_quotas.rb +++ /dev/null @@ -1,20 +0,0 @@ -class CreateCloudResourceQuotas < ActiveRecord::Migration[4.2] - def up - create_table :cloud_resource_quotas do |t| - t.string :ems_ref - t.string :service_name - t.string :name - t.integer :value - t.string :type - - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - - t.timestamps :null => true - end - end - - def down - drop_table :cloud_resource_quotas - end -end diff --git a/db/migrate/20140627175339_add_support_case_to_file_depot.rb b/db/migrate/20140627175339_add_support_case_to_file_depot.rb deleted file mode 100644 index 681758271..000000000 --- a/db/migrate/20140627175339_add_support_case_to_file_depot.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSupportCaseToFileDepot < ActiveRecord::Migration[4.2] - def change - add_column :file_depots, :support_case, :string - end -end diff --git a/db/migrate/20140715200621_set_default_for_pxe_server_customization_directory.rb b/db/migrate/20140715200621_set_default_for_pxe_server_customization_directory.rb deleted file mode 100644 index 1ed791fda..000000000 --- a/db/migrate/20140715200621_set_default_for_pxe_server_customization_directory.rb +++ /dev/null @@ -1,9 +0,0 @@ -class SetDefaultForPxeServerCustomizationDirectory < ActiveRecord::Migration[4.2] - class PxeServer < ActiveRecord::Base; end - - def up - say_with_time("Seting default value for PxeServer #customization_directory") do - PxeServer.where(:customization_directory => nil).update_all(:customization_directory => "") - end - end -end diff --git a/db/migrate/20140821203124_add_vm_raw_power_state.rb b/db/migrate/20140821203124_add_vm_raw_power_state.rb deleted file mode 100644 index e0ea45573..000000000 --- a/db/migrate/20140821203124_add_vm_raw_power_state.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddVmRawPowerState < ActiveRecord::Migration[4.2] - def up - add_column :vms, :raw_power_state, :string - end - - def down - remove_column :vms, :raw_power_state - end -end diff --git a/db/migrate/20140903194919_add_virtualization_type_to_hardware.rb b/db/migrate/20140903194919_add_virtualization_type_to_hardware.rb deleted file mode 100644 index 516f88feb..000000000 --- a/db/migrate/20140903194919_add_virtualization_type_to_hardware.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddVirtualizationTypeToHardware < ActiveRecord::Migration[4.2] - def change - add_column :hardwares, :virtualization_type, :string - end -end diff --git a/db/migrate/20140903195524_add_supports_hvm_to_flavor.rb b/db/migrate/20140903195524_add_supports_hvm_to_flavor.rb deleted file mode 100644 index 4333ee69c..000000000 --- a/db/migrate/20140903195524_add_supports_hvm_to_flavor.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddSupportsHvmToFlavor < ActiveRecord::Migration[4.2] - def change - add_column :flavors, :supports_hvm, :boolean - add_column :flavors, :supports_paravirtual, :boolean - end -end diff --git a/db/migrate/20140905020643_update_default_registration_channel_names.rb b/db/migrate/20140905020643_update_default_registration_channel_names.rb deleted file mode 100644 index a6aee93dc..000000000 --- a/db/migrate/20140905020643_update_default_registration_channel_names.rb +++ /dev/null @@ -1,12 +0,0 @@ -class UpdateDefaultRegistrationChannelNames < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base; end - - def up - say_with_time("Updating Default Registration Channel Names for v5.3") do - db = MiqDatabase.first - if db.try(:update_repo_name) == "cf-me-5.2-for-rhel-6-rpms" - db.update(:update_repo_name => "cf-me-5.3-for-rhel-6-rpms rhel-server-rhscl-6-rpms") - end - end - end -end diff --git a/db/migrate/20140908201058_add_block_storage_only_to_flavor.rb b/db/migrate/20140908201058_add_block_storage_only_to_flavor.rb deleted file mode 100644 index d66d6afd2..000000000 --- a/db/migrate/20140908201058_add_block_storage_only_to_flavor.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddBlockStorageOnlyToFlavor < ActiveRecord::Migration[4.2] - def change - add_column :flavors, :block_storage_based_only, :boolean - end -end diff --git a/db/migrate/20140908211826_add_root_device_type_to_hardware.rb b/db/migrate/20140908211826_add_root_device_type_to_hardware.rb deleted file mode 100644 index c083c0738..000000000 --- a/db/migrate/20140908211826_add_root_device_type_to_hardware.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddRootDeviceTypeToHardware < ActiveRecord::Migration[4.2] - def change - add_column :hardwares, :root_device_type, :string - end -end diff --git a/db/migrate/20140917145331_add_vm_publicly_available.rb b/db/migrate/20140917145331_add_vm_publicly_available.rb deleted file mode 100644 index 68fbadb73..000000000 --- a/db/migrate/20140917145331_add_vm_publicly_available.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddVmPubliclyAvailable < ActiveRecord::Migration[4.2] - def up - add_column :vms, :publicly_available, :boolean - end - - def down - remove_column :vms, :publicly_available - end -end diff --git a/db/migrate/20140918131740_add_template_multi_tenant_relationship.rb b/db/migrate/20140918131740_add_template_multi_tenant_relationship.rb deleted file mode 100644 index fc5e955a1..000000000 --- a/db/migrate/20140918131740_add_template_multi_tenant_relationship.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddTemplateMultiTenantRelationship < ActiveRecord::Migration[4.2] - def up - create_table :cloud_tenants_vms, :id => false do |t| - t.column :cloud_tenant_id, :bigint - t.column :vm_id, :bigint - end - end - - def down - drop_table :cloud_tenants_vms - end -end diff --git a/db/migrate/20140918140859_add_cloud_tenant_sti_column.rb b/db/migrate/20140918140859_add_cloud_tenant_sti_column.rb deleted file mode 100644 index e6061c7bc..000000000 --- a/db/migrate/20140918140859_add_cloud_tenant_sti_column.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AddCloudTenantStiColumn < ActiveRecord::Migration[4.2] - class CloudTenant < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - add_column :cloud_tenants, :type, :string - - say_with_time("Default cloud tenant type value to CloudTenantOpenstack") do - CloudTenant.update_all(:type => "CloudTenantOpenstack") - end - end - - def down - remove_column :cloud_tenants, :type - end -end diff --git a/db/migrate/20140918154013_add_provider_region_to_ext_management_systems.rb b/db/migrate/20140918154013_add_provider_region_to_ext_management_systems.rb deleted file mode 100644 index dc73b13d7..000000000 --- a/db/migrate/20140918154013_add_provider_region_to_ext_management_systems.rb +++ /dev/null @@ -1,22 +0,0 @@ -class AddProviderRegionToExtManagementSystems < ActiveRecord::Migration[4.2] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - add_column :ext_management_systems, :provider_region, :string - - say_with_time("Moving EmsAmazon regions from hostname to provider_region") do - ExtManagementSystem.where(:type => "EmsAmazon").update_all("provider_region = hostname") - ExtManagementSystem.where(:type => "EmsAmazon").update_all(:hostname => nil) - end - end - - def down - say_with_time("Moving EmsAmazon regions from provider_region to hostname") do - ExtManagementSystem.where(:type => "EmsAmazon").update_all("hostname = provider_region") - end - - remove_column :ext_management_systems, :provider_region - end -end diff --git a/db/migrate/20140922163020_remove_vdi_models.rb b/db/migrate/20140922163020_remove_vdi_models.rb deleted file mode 100644 index 576ee3784..000000000 --- a/db/migrate/20140922163020_remove_vdi_models.rb +++ /dev/null @@ -1,175 +0,0 @@ -class RemoveVdiModels < ActiveRecord::Migration[4.2] - def up - change_table "ems_events" do |t| - t.remove "vdi_endpoint_device_id" - t.remove "vdi_endpoint_device_name" - t.remove "vdi_controller_id" - t.remove "vdi_controller_name" - t.remove "vdi_user_id" - t.remove "vdi_user_name" - t.remove "vdi_desktop_id" - t.remove "vdi_desktop_name" - t.remove "vdi_desktop_pool_id" - t.remove "vdi_desktop_pool_name" - end - - drop_table "ext_management_systems_vdi_desktop_pools" - - remove_index "miq_proxies", "vdi_farm_id" - remove_column "ldap_users", "vdi_user_id" - remove_column "miq_proxies", "vdi_farm_id" - - drop_table "vdi_controllers" - - drop_table "vdi_desktop_pools" - - drop_table "vdi_desktop_pools_vdi_users" - - drop_table "vdi_desktops" - - drop_table "vdi_desktops_vdi_users" - drop_table "vdi_endpoint_devices" - drop_table "vdi_farms" - - drop_table "vdi_sessions" - drop_table "vdi_users" - - remove_column "vms", "vdi" - end - - def down - change_table "ems_events" do |t| - t.integer "vdi_endpoint_device_id", :limit => 8 - t.string "vdi_endpoint_device_name" - t.integer "vdi_controller_id", :limit => 8 - t.string "vdi_controller_name" - t.integer "vdi_user_id", :limit => 8 - t.string "vdi_user_name" - t.integer "vdi_desktop_id", :limit => 8 - t.string "vdi_desktop_name" - t.integer "vdi_desktop_pool_id", :limit => 8 - t.string "vdi_desktop_pool_name" - end - - create_table "ext_management_systems_vdi_desktop_pools", :id => false do |t| - t.bigint "ems_id" - t.bigint "vdi_desktop_pool_id" - end - - add_column "ldap_users", "vdi_user_id", "bigint" - add_column "miq_proxies", "vdi_farm_id", "bigint" - add_index "miq_proxies", ["vdi_farm_id"], :name => "index_miq_proxies_on_vdi_farm_id" - - create_table "vdi_controllers" do |t| - t.bigint "vdi_farm_id" - t.string "name" - t.string "version" - t.string "zone_preference" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "vdi_controllers", ["vdi_farm_id"], :name => "index_vdi_controllers_on_vdi_farm_id" - - create_table "vdi_desktop_pools" do |t| - t.bigint "vdi_farm_id" - t.string "name" - t.string "description" - t.string "vendor" - t.boolean "enabled" - t.string "uid_ems" - t.string "assignment_behavior" - t.string "hosting_vendor" - t.string "hosting_server" - t.string "hosting_ipaddress" - t.string "default_encryption_level" - t.string "default_color_depth" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "vdi_desktop_pools", ["vdi_farm_id"], :name => "index_vdi_desktop_pools_on_vdi_farm_id" - - create_table "vdi_desktop_pools_vdi_users", :id => false do |t| - t.bigint "vdi_desktop_pool_id" - t.bigint "vdi_user_id" - end - - add_index "vdi_desktop_pools_vdi_users", ["vdi_desktop_pool_id"], :name => "index_vdi_desktop_pools_vdi_users_on_vdi_desktop_pool_id" - add_index "vdi_desktop_pools_vdi_users", ["vdi_user_id"], :name => "index_vdi_desktop_pools_vdi_users_on_vdi_user_id" - - create_table "vdi_desktops" do |t| - t.bigint "vdi_desktop_pool_id" - t.bigint "vm_or_template_id" - t.string "name" - t.string "agent_version" - t.string "connection_state" - t.string "power_state" - t.string "assigned_username" - t.boolean "maintenance_mode" - t.string "vm_uid_ems" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "vdi_desktops", ["vdi_desktop_pool_id"], :name => "index_vdi_desktops_on_vdi_desktop_pool_id" - add_index "vdi_desktops", ["vm_or_template_id"], :name => "index_vdi_desktops_on_vm_id" - - create_table "vdi_desktops_vdi_users", :id => false do |t| - t.bigint "vdi_desktop_id" - t.bigint "vdi_user_id" - end - - create_table "vdi_endpoint_devices" do |t| - t.string "name" - t.string "ipaddress" - t.string "uid_ems" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "vdi_farms" do |t| - t.string "name" - t.string "vendor" - t.string "edition" - t.string "uid_ems" - t.string "license_server_name" - t.string "enable_session_reliability" - t.datetime "created_at" - t.datetime "updated_at" - t.bigint "zone_id" - t.string "type" - end - - create_table "vdi_sessions" do |t| - t.bigint "vdi_desktop_id" - t.bigint "vdi_controller_id" - t.bigint "vdi_user_id" - t.string "user_name" - t.string "state" - t.datetime "start_time" - t.string "encryption_level" - t.string "protocol" - t.string "horizontal_resolution" - t.string "vertical_resolution" - t.datetime "created_at" - t.datetime "updated_at" - t.bigint "vdi_endpoint_device_id" - t.string "uid_ems" - end - - add_index "vdi_sessions", ["vdi_controller_id"], :name => "index_vdi_sessions_on_vdi_controller_id" - add_index "vdi_sessions", ["vdi_desktop_id"], :name => "index_vdi_sessions_on_vdi_desktop_id" - add_index "vdi_sessions", ["vdi_endpoint_device_id"], :name => "index_vdi_sessions_on_vdi_endpoint_device_id" - add_index "vdi_sessions", ["vdi_user_id"], :name => "index_vdi_sessions_on_vdi_user_id" - - create_table "vdi_users" do |t| - t.string "uid_ems" - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_column "vms", "vdi", :boolean, :default => false, :null => false - end -end diff --git a/db/migrate/20141002214356_add_refresh_status_to_ext_management_system.rb b/db/migrate/20141002214356_add_refresh_status_to_ext_management_system.rb deleted file mode 100644 index bb3a6ddfb..000000000 --- a/db/migrate/20141002214356_add_refresh_status_to_ext_management_system.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddRefreshStatusToExtManagementSystem < ActiveRecord::Migration[4.2] - def change - add_column :ext_management_systems, :last_refresh_error, :text - add_column :ext_management_systems, :last_refresh_date, :timestamp - end -end diff --git a/db/migrate/20141015170920_remove_vdi_tab_from_miq_dialogs.rb b/db/migrate/20141015170920_remove_vdi_tab_from_miq_dialogs.rb deleted file mode 100644 index 17f0aa404..000000000 --- a/db/migrate/20141015170920_remove_vdi_tab_from_miq_dialogs.rb +++ /dev/null @@ -1,17 +0,0 @@ -class RemoveVdiTabFromMiqDialogs < ActiveRecord::Migration[4.2] - class MiqDialog < ActiveRecord::Base - serialize :content, Hash - end - - def up - say_with_time("Removing VDI tab from MiqDialog") do - MiqDialog.where(:dialog_type => 'MiqProvisionWorkflow').each do |dialog| - if dialog.content[:dialogs].present? && dialog.content[:dialogs].keys.include?(:vdi) - dialog.content[:dialogs].delete(:vdi) - dialog.content[:dialog_order].delete(:vdi) - dialog.save - end - end - end - end -end diff --git a/db/migrate/20141020195642_create_orchestration_stacks.rb b/db/migrate/20141020195642_create_orchestration_stacks.rb deleted file mode 100644 index dd74b0dc2..000000000 --- a/db/migrate/20141020195642_create_orchestration_stacks.rb +++ /dev/null @@ -1,70 +0,0 @@ -class CreateOrchestrationStacks < ActiveRecord::Migration[4.2] - def change - create_table :orchestration_templates do |t| - t.string :name - t.string :type - t.text :description - t.text :content - t.string :ems_ref - - t.timestamps :null => true - end - - add_index :orchestration_templates, :ems_ref, :unique => true - - create_table :orchestration_stacks do |t| - t.string :name - t.string :type - t.text :description - t.string :status - t.string :ems_ref - t.string :ancestry - - t.belongs_to :ems, :type => :bigint - t.belongs_to :orchestration_template, :type => :bigint - - t.timestamps :null => true - end - - add_index :orchestration_stacks, :orchestration_template_id - add_index :orchestration_stacks, :ancestry - - add_column :vms, :orchestration_stack_id, :bigint - add_column :security_groups, :orchestration_stack_id, :bigint - add_column :cloud_networks, :orchestration_stack_id, :bigint - - create_table :orchestration_stack_parameters do |t| - t.string :name - t.text :value - - t.belongs_to :stack, :type => :bigint - end - - add_index :orchestration_stack_parameters, :stack_id - - create_table :orchestration_stack_outputs do |t| - t.string :key - t.text :value - t.text :description - - t.belongs_to :stack, :type => :bigint - end - - add_index :orchestration_stack_outputs, :stack_id - - create_table :orchestration_stack_resources do |t| - t.string :name - t.text :description - t.text :logical_resource - t.text :physical_resource - t.string :resource_category - t.string :resource_status - t.text :resource_status_reason - t.timestamp :last_updated - - t.belongs_to :stack, :type => :bigint - end - - add_index :orchestration_stack_resources, :stack_id - end -end diff --git a/db/migrate/20141021103820_remove_miq_search_vdi_instances.rb b/db/migrate/20141021103820_remove_miq_search_vdi_instances.rb deleted file mode 100644 index c83620321..000000000 --- a/db/migrate/20141021103820_remove_miq_search_vdi_instances.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveMiqSearchVdiInstances < ActiveRecord::Migration[4.2] - class MiqSearch < ActiveRecord::Base; end - - def up - say_with_time("Removing VDI User references from MiqSearch") do - MiqSearch.where(:db => 'VdiUser').destroy_all - end - end -end diff --git a/db/migrate/20141026111520_remove_black_box_from_vms.rb b/db/migrate/20141026111520_remove_black_box_from_vms.rb deleted file mode 100644 index 55cc88b13..000000000 --- a/db/migrate/20141026111520_remove_black_box_from_vms.rb +++ /dev/null @@ -1,15 +0,0 @@ -class RemoveBlackBoxFromVms < ActiveRecord::Migration[4.2] - def up - change_table :vms do |t| - t.remove :blackbox_exists - t.remove :blackbox_validated - end - end - - def down - change_table :vms do |t| - t.boolean :blackbox_exists - t.boolean :blackbox_validated - end - end -end diff --git a/db/migrate/20141029000000_create_providers.rb b/db/migrate/20141029000000_create_providers.rb deleted file mode 100644 index 422e32905..000000000 --- a/db/migrate/20141029000000_create_providers.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateProviders < ActiveRecord::Migration[4.2] - def up - create_table :providers do |t| - t.string :type - t.string :name - t.string :url - t.integer :verify_ssl - t.string :guid, :limit => 36 - t.belongs_to :zone, :type => :bigint - t.timestamps :null => true - end - end - - def down - drop_table :providers - end -end diff --git a/db/migrate/20141029005602_create_configuration_managers.rb b/db/migrate/20141029005602_create_configuration_managers.rb deleted file mode 100644 index adc57ace0..000000000 --- a/db/migrate/20141029005602_create_configuration_managers.rb +++ /dev/null @@ -1,47 +0,0 @@ -class CreateConfigurationManagers < ActiveRecord::Migration[4.2] - def up - create_table :configuration_managers do |t| - t.string :type - t.belongs_to :provider, :type => :bigint - t.timestamps :null => true - end - add_index :configuration_managers, :provider_id - - create_table :configuration_profiles do |t| - t.string :type - t.string :name - t.string :description - t.belongs_to :operating_system_flavor, :type => :bigint - t.belongs_to :configuration_manager, :type => :bigint - t.belongs_to :customization_script_ptable, :type => :bigint - t.belongs_to :customization_script_medium, :type => :bigint - t.string :manager_ref - t.timestamps :null => true - end - - add_index :configuration_profiles, :operating_system_flavor_id - add_index :configuration_profiles, :configuration_manager_id - add_index :configuration_profiles, :customization_script_ptable_id - add_index :configuration_profiles, :customization_script_medium_id - add_index :configuration_profiles, :manager_ref - - create_table :configured_systems do |t| - t.string :type - t.string :hostname - t.belongs_to :operating_system_flavor, :type => :bigint - t.belongs_to :configuration_profile, :type => :bigint - t.belongs_to :configuration_manager, :type => :bigint - t.string :manager_ref - t.timestamps :null => true - end - add_index :configured_systems, :operating_system_flavor_id - add_index :configured_systems, [:configuration_manager_id, :type] - add_index :configured_systems, :manager_ref - end - - def down - drop_table :configured_systems - drop_table :configuration_profiles - drop_table :configuration_managers - end -end diff --git a/db/migrate/20141029005620_create_computer_systems.rb b/db/migrate/20141029005620_create_computer_systems.rb deleted file mode 100644 index ab3ae3f24..000000000 --- a/db/migrate/20141029005620_create_computer_systems.rb +++ /dev/null @@ -1,22 +0,0 @@ -class CreateComputerSystems < ActiveRecord::Migration[4.2] - def up - create_table :computer_systems do |t| - t.belongs_to :managed_entity, :type => :bigint, :polymorphic => true - t.timestamps :null => true - end - add_index :computer_systems, [:managed_entity_id, :managed_entity_type], - :name => :index_computer_systems_managed_entity - - add_column :hardwares, :computer_system_id, :bigint - add_index :hardwares, :computer_system_id - add_column :operating_systems, :computer_system_id, :bigint - add_index :operating_systems, :computer_system_id - end - - def down - remove_column :hardwares, :computer_system_id - remove_column :operating_systems, :computer_system_id - - drop_table :computer_systems - end -end diff --git a/db/migrate/20141029165319_create_provisioning_managers.rb b/db/migrate/20141029165319_create_provisioning_managers.rb deleted file mode 100644 index c76b44f44..000000000 --- a/db/migrate/20141029165319_create_provisioning_managers.rb +++ /dev/null @@ -1,47 +0,0 @@ -class CreateProvisioningManagers < ActiveRecord::Migration[4.2] - def up - create_table :customization_scripts do |t| - t.string :name - t.belongs_to :provisioning_manager, :type => :bigint - t.string :manager_ref - t.string :type - t.timestamps :null => true - end - add_index :customization_scripts, :manager_ref - add_index :customization_scripts, [:provisioning_manager_id, :type], - :name => :index_on_customization_script_provisioning_manager_id - - create_table :operating_system_flavors do |t| - t.string :name - t.string :description - t.belongs_to :provisioning_manager, :type => :bigint - t.string :manager_ref - t.timestamps :null => true - end - add_index :operating_system_flavors, :manager_ref - add_index :operating_system_flavors, :provisioning_manager_id - - create_table :customization_scripts_operating_system_flavors, :id => false do |t| - t.belongs_to :customization_script, :type => :bigint - t.belongs_to :operating_system_flavor, :type => :bigint - end - add_index :customization_scripts_operating_system_flavors, [:operating_system_flavor_id, :customization_script_id], - :name => :index_on_customization_scripts_operating_system_flavors_i1 - add_index :customization_scripts_operating_system_flavors, :customization_script_id, - :name => :index_on_customization_scripts_operating_system_flavors_i2 - - create_table :provisioning_managers do |t| - t.belongs_to :provider, :type => :bigint - t.string :type - t.timestamps :null => true - end - add_index :provisioning_managers, :provider_id - end - - def down - drop_table :provisioning_managers - drop_table :customization_scripts_operating_system_flavors - drop_table :operating_system_flavors - drop_table :customization_scripts - end -end diff --git a/db/migrate/20141117082419_add_dynamic_field_to_dialog_fields.rb b/db/migrate/20141117082419_add_dynamic_field_to_dialog_fields.rb deleted file mode 100644 index b034d9dcd..000000000 --- a/db/migrate/20141117082419_add_dynamic_field_to_dialog_fields.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddDynamicFieldToDialogFields < ActiveRecord::Migration[4.2] - def up - add_column :dialog_fields, :dynamic, :boolean - end - - def down - remove_column :dialog_fields, :dynamic - end -end diff --git a/db/migrate/20141121200053_create_endpoints.rb b/db/migrate/20141121200053_create_endpoints.rb deleted file mode 100644 index a96d0c3f3..000000000 --- a/db/migrate/20141121200053_create_endpoints.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateEndpoints < ActiveRecord::Migration[4.2] - def change - create_table :endpoints do |t| - t.string :role - t.string :ipaddress - t.string :hostname - t.integer :port - t.belongs_to :resource, :polymorphic => true, :type => :bigint - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20141121200153_migrate_ems_attributes_to_endpoints.rb b/db/migrate/20141121200153_migrate_ems_attributes_to_endpoints.rb deleted file mode 100644 index 3cf4704a9..000000000 --- a/db/migrate/20141121200153_migrate_ems_attributes_to_endpoints.rb +++ /dev/null @@ -1,43 +0,0 @@ -class MigrateEmsAttributesToEndpoints < ActiveRecord::Migration[4.2] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Endpoint < ActiveRecord::Base; end - - def up - say_with_time("Migrating EMS attributes to endpoints") do - ExtManagementSystem.all.each do |e| - Endpoint.create!( - :role => "default", - :ipaddress => e.ipaddress, - :hostname => e.hostname, - :port => e.port && e.port.to_i, - :resource_type => "ExtManagementSystem", - :resource_id => e.id, - ) - end - end - end - - def down - say_with_time("Migrating endpoints to EMS attributes") do - endpoints = Endpoint.where( - :role => "default", - :resource_type => "ExtManagementSystem", - ) - - endpoints.each do |endpoint| - ems = ExtManagementSystem.where(:id => endpoint.resource_id).first - - ems.update!( - :ipaddress => endpoint.ipaddress, - :hostname => endpoint.hostname, - :port => endpoint.port && endpoint.port.to_s - ) - end - - Endpoint.delete_all - end - end -end diff --git a/db/migrate/20141121200523_remove_endpoint_data_from_ems.rb b/db/migrate/20141121200523_remove_endpoint_data_from_ems.rb deleted file mode 100644 index ef0372b65..000000000 --- a/db/migrate/20141121200523_remove_endpoint_data_from_ems.rb +++ /dev/null @@ -1,13 +0,0 @@ -class RemoveEndpointDataFromEms < ActiveRecord::Migration[4.2] - def up - remove_column :ext_management_systems, :port - remove_column :ext_management_systems, :ipaddress - remove_column :ext_management_systems, :hostname - end - - def down - add_column :ext_management_systems, :port, :string - add_column :ext_management_systems, :ipaddress, :string - add_column :ext_management_systems, :hostname, :string - end -end diff --git a/db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb b/db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb deleted file mode 100644 index 06dc14461..000000000 --- a/db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb +++ /dev/null @@ -1,32 +0,0 @@ -class ConvertShowRefreshButtonAndLoadValuesOnInitToRealColumnsForDialogFields < ActiveRecord::Migration[4.2] - class DialogField < ActiveRecord::Base - serialize :options, Hash - self.inheritance_column = :_type_disabled - end - - def up - add_column :dialog_fields, :show_refresh_button, :boolean - add_column :dialog_fields, :load_values_on_init, :boolean - - say_with_time("Converting options[:show_refresh_button] and options[:load_values_on_init] to column fields") do - DialogField.all.each do |dialog_field| - dialog_field.show_refresh_button = dialog_field.options.delete(:show_refresh_button) - dialog_field.load_values_on_init = dialog_field.options.delete(:load_values_on_init) - dialog_field.save - end - end - end - - def down - say_with_time("Converting column fields show_refresh_button and load_values_on_init back to options") do - DialogField.all.each do |dialog_field| - dialog_field.options[:load_values_on_init] = dialog_field.load_values_on_init - dialog_field.options[:show_refresh_button] = dialog_field.show_refresh_button - dialog_field.save - end - end - - remove_column :dialog_fields, :load_values_on_init - remove_column :dialog_fields, :show_refresh_button - end -end diff --git a/db/migrate/20141202111010_add_ems_ref_to_cloudformation_stack.rb b/db/migrate/20141202111010_add_ems_ref_to_cloudformation_stack.rb deleted file mode 100644 index c47961fec..000000000 --- a/db/migrate/20141202111010_add_ems_ref_to_cloudformation_stack.rb +++ /dev/null @@ -1,15 +0,0 @@ -class AddEmsRefToCloudformationStack < ActiveRecord::Migration[4.2] - def up - change_column :orchestration_stacks, :ems_ref, :text - add_column :orchestration_stack_parameters, :ems_ref, :text - add_column :orchestration_stack_resources, :ems_ref, :text - add_column :orchestration_stack_outputs, :ems_ref, :text - end - - def down - change_column :orchestration_stacks, :ems_ref, :string - remove_column :orchestration_stack_parameters, :ems_ref - remove_column :orchestration_stack_resources, :ems_ref - remove_column :orchestration_stack_outputs, :ems_ref - end -end diff --git a/db/migrate/20141208194307_drop_miq_region_from_database_backups.rb b/db/migrate/20141208194307_drop_miq_region_from_database_backups.rb deleted file mode 100644 index 12e3851ea..000000000 --- a/db/migrate/20141208194307_drop_miq_region_from_database_backups.rb +++ /dev/null @@ -1,11 +0,0 @@ -class DropMiqRegionFromDatabaseBackups < ActiveRecord::Migration[4.2] - def up - remove_index :database_backups, :miq_region_id - remove_column :database_backups, :miq_region_id - end - - def down - add_column :database_backups, :miq_region_id, :bigint - add_index :database_backups, :miq_region_id - end -end diff --git a/db/migrate/20141219222843_remove_miq_worker_rows_without_model.rb b/db/migrate/20141219222843_remove_miq_worker_rows_without_model.rb deleted file mode 100644 index c222ea3b4..000000000 --- a/db/migrate/20141219222843_remove_miq_worker_rows_without_model.rb +++ /dev/null @@ -1,12 +0,0 @@ -class RemoveMiqWorkerRowsWithoutModel < ActiveRecord::Migration[4.2] - class MiqWorker < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time "Remove MiqWorker records where the model was removed" do - types = %w(MiqWorkerMonitor MiqStorageStatsCollectorWorker MiqPerfCollectorWorker MiqPerfProcessorWorker) - MiqWorker.where(:type => types).delete_all - end - end -end diff --git a/db/migrate/20150109142457_namespace_ems_classes.rb b/db/migrate/20150109142457_namespace_ems_classes.rb deleted file mode 100644 index f80be8acb..000000000 --- a/db/migrate/20150109142457_namespace_ems_classes.rb +++ /dev/null @@ -1,31 +0,0 @@ -class NamespaceEmsClasses < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - EmsCloud ManageIQ::Providers::CloudManager - HostCloud ManageIQ::Providers::CloudManager::Host - TemplateCloud ManageIQ::Providers::CloudManager::Template - VmCloud ManageIQ::Providers::CloudManager::Vm - - EmsInfra ManageIQ::Providers::InfraManager - HostInfra ManageIQ::Providers::InfraManager::Host - TemplateInfra ManageIQ::Providers::InfraManager::Template - VmInfra ManageIQ::Providers::InfraManager::Vm - - EmsVmware ManageIQ::Providers::Vmware::InfraManager - MiqEventCatcherVmware ManageIQ::Providers::Vmware::InfraManager::EventCatcher - EventCatcherVmware ManageIQ::Providers::Vmware::InfraManager::EventCatcher::Runner - HostVmware ManageIQ::Providers::Vmware::InfraManager::Host - HostVmwareEsx ManageIQ::Providers::Vmware::InfraManager::HostEsx - MiqEmsMetricsCollectorWorkerVmware ManageIQ::Providers::Vmware::InfraManager::MetricsCollectorWorker - EmsMetricsCollectorWorkerVmware ManageIQ::Providers::Vmware::InfraManager::MetricsCollectorWorker::Runner - MiqEmsRefreshWorkerVmware ManageIQ::Providers::Vmware::InfraManager::RefreshWorker - EmsRefreshWorkerVmware ManageIQ::Providers::Vmware::InfraManager::RefreshWorker::Runner - TemplateVmware ManageIQ::Providers::Vmware::InfraManager::Template - VmVmware ManageIQ::Providers::Vmware::InfraManager::Vm - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150111161446_create_nodes.rb b/db/migrate/20150111161446_create_nodes.rb deleted file mode 100644 index d8baafad5..000000000 --- a/db/migrate/20150111161446_create_nodes.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateNodes < ActiveRecord::Migration[4.2] - def up - create_table :container_nodes do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.string :resource_version - t.belongs_to :ems, :type => :bigint - end - add_index :container_nodes, :ems_id - end - - def down - remove_index :container_nodes, :ems_id - drop_table :container_nodes - end -end diff --git a/db/migrate/20150111161504_create_kubernetes_services.rb b/db/migrate/20150111161504_create_kubernetes_services.rb deleted file mode 100644 index 7c76acbf9..000000000 --- a/db/migrate/20150111161504_create_kubernetes_services.rb +++ /dev/null @@ -1,24 +0,0 @@ -class CreateKubernetesServices < ActiveRecord::Migration[4.2] - def up - create_table :container_services do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.string :resource_version - t.string :namespace - t.string :session_affinity - t.string :portal_ip - t.string :protocol - t.integer :container_port - t.integer :port - t.belongs_to :ems, :type => :bigint - end - - add_index :container_services, :ems_id - end - - def down - remove_index :container_services, :ems_id - drop_table :container_services - end -end diff --git a/db/migrate/20150128161824_create_container_groups.rb b/db/migrate/20150128161824_create_container_groups.rb deleted file mode 100644 index d53732587..000000000 --- a/db/migrate/20150128161824_create_container_groups.rb +++ /dev/null @@ -1,21 +0,0 @@ -class CreateContainerGroups < ActiveRecord::Migration[4.2] - def up - create_table :container_groups do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.string :namespace - t.string :resource_version - t.string :restart_policy - t.string :dns_policy - t.belongs_to :ems, :type => :bigint - end - - add_index :container_groups, :ems_id - end - - def down - remove_index :container_groups, :ems_id - drop_table :container_groups - end -end diff --git a/db/migrate/20150128195918_add_manager_error_reporting.rb b/db/migrate/20150128195918_add_manager_error_reporting.rb deleted file mode 100644 index a8b325174..000000000 --- a/db/migrate/20150128195918_add_manager_error_reporting.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddManagerErrorReporting < ActiveRecord::Migration[4.2] - def change - add_column :configuration_managers, :last_refresh_error, :text - add_column :configuration_managers, :last_refresh_date, :timestamp - add_column :provisioning_managers, :last_refresh_error, :text - add_column :provisioning_managers, :last_refresh_date, :timestamp - end -end diff --git a/db/migrate/20150131104420_remove_miq_proxy_models.rb b/db/migrate/20150131104420_remove_miq_proxy_models.rb deleted file mode 100644 index e8cb7e687..000000000 --- a/db/migrate/20150131104420_remove_miq_proxy_models.rb +++ /dev/null @@ -1,71 +0,0 @@ -class RemoveMiqProxyModels < ActiveRecord::Migration[4.2] - def up - remove_index "miq_proxies", "guid" - remove_index "miq_proxies", "host_id" - remove_index "miq_proxies", "vm_id" - drop_table "miq_proxies" - - drop_table "miq_proxies_product_updates" - - drop_table "product_updates" - - remove_index "proxy_tasks", "miq_proxy_id" - drop_table "proxy_tasks" - end - - def down - create_table "miq_proxies", :force => true do |t| - t.string "guid", :limit => 36 - t.string "name" - t.text "settings" - t.datetime "last_heartbeat" - t.string "version" - t.string "ws_port" - t.integer "host_id", :limit => 8 - t.integer "vm_id", :limit => 8 - t.datetime "created_on" - t.datetime "updated_on" - t.text "capabilities" - t.string "power_state" - t.string "upgrade_status" - t.string "upgrade_message" - t.text "remote_config" - t.string "upgrade_settings" - end - - add_index "miq_proxies", "guid" - add_index "miq_proxies", "host_id" - add_index "miq_proxies", "vm_id" - - create_table "miq_proxies_product_updates", :id => false, :force => true do |t| - t.integer "product_update_id", :limit => 8 - t.integer "miq_proxy_id", :limit => 8 - end - - create_table "product_updates", :force => true do |t| - t.string "name" - t.string "description" - t.string "md5" - t.string "version" - t.string "build" - t.string "component" - t.string "platform" - t.string "arch" - t.string "update_type" - t.string "vmdb_schema_version" - t.datetime "created_on" - t.datetime "updated_on" - end - - create_table "proxy_tasks", :force => true do |t| - t.integer "priority" - t.text "command" - t.string "state" - t.datetime "created_on" - t.datetime "updated_on" - t.integer "miq_proxy_id", :limit => 8 - end - - add_index "proxy_tasks", "miq_proxy_id" - end -end diff --git a/db/migrate/20150202212058_fix_indexes_on_ems_events.rb b/db/migrate/20150202212058_fix_indexes_on_ems_events.rb deleted file mode 100644 index c9a7f0f2c..000000000 --- a/db/migrate/20150202212058_fix_indexes_on_ems_events.rb +++ /dev/null @@ -1,19 +0,0 @@ -class FixIndexesOnEmsEvents < ActiveRecord::Migration[4.2] - def up - if find_index_by_name(:ems_events, "index_ems_events_on_vm_id") - rename_index :ems_events, "index_ems_events_on_vm_id", "index_ems_events_on_vm_or_template_id" - end - if find_index_by_name(:ems_events, "index_ems_events_on_dest_vm_id") - rename_index :ems_events, "index_ems_events_on_dest_vm_id", "index_ems_events_on_dest_vm_or_template_id" - end - end - - def down - rename_index :ems_events, "index_ems_events_on_vm_or_template_id", "index_ems_events_on_vm_id" - rename_index :ems_events, "index_ems_events_on_dest_vm_or_template_id", "index_ems_events_on_dest_vm_id" - end - - def find_index_by_name(table, name) - indexes(table).find { |i| i.name == name } - end -end diff --git a/db/migrate/20150202215346_create_container_definitions.rb b/db/migrate/20150202215346_create_container_definitions.rb deleted file mode 100644 index b5a413f9e..000000000 --- a/db/migrate/20150202215346_create_container_definitions.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateContainerDefinitions < ActiveRecord::Migration[4.2] - def up - create_table :container_definitions do |t| - t.string :ems_ref - t.string :name - t.string :image - t.string :image_pull_policy - t.string :memory - t.float :cpu_cores - t.belongs_to :container_group, :type => :bigint - end - end - - def down - drop_table :container_definitions - end -end diff --git a/db/migrate/20150202215414_create_containers.rb b/db/migrate/20150202215414_create_containers.rb deleted file mode 100644 index bc0f63406..000000000 --- a/db/migrate/20150202215414_create_containers.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateContainers < ActiveRecord::Migration[4.2] - def up - create_table :containers do |t| - t.string :ems_ref - t.integer :restart_count - t.string :state - t.string :name - t.string :image - t.string :container_id - t.belongs_to :container_group, :type => :bigint - end - end - - def down - drop_table :containers - end -end diff --git a/db/migrate/20150202215435_create_container_port_configs.rb b/db/migrate/20150202215435_create_container_port_configs.rb deleted file mode 100644 index bcfe47591..000000000 --- a/db/migrate/20150202215435_create_container_port_configs.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateContainerPortConfigs < ActiveRecord::Migration[4.2] - def up - create_table :container_port_configs do |t| - t.string :ems_ref - t.integer :port - t.integer :host_port - t.string :protocol - t.belongs_to :container_definition, :type => :bigint - end - end - - def down - drop_table :container_port_configs - end -end diff --git a/db/migrate/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves.rb b/db/migrate/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves.rb deleted file mode 100644 index aabbc221a..000000000 --- a/db/migrate/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves.rb +++ /dev/null @@ -1,27 +0,0 @@ -class MigrateMiqDatabaseRegistrationOrganizationDisplayNameOutOfReserves < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base - include ReservedMigrationMixin - include MigrationStubHelper # NOTE: Must be included after other mixins - end - - def up - add_column :miq_databases, :registration_organization_display_name, :string - - say_with_time("Migrate registration_organization_display_name from reserved table") do - MiqDatabase.includes(:reserved_rec).each do |db| - db.reserved_hash_migrate(:registration_organization_display_name) - end - end - end - - def down - say_with_time("Migrating registration_organization_display_name to Reserves table") do - MiqDatabase.includes(:reserved_rec).each do |d| - d.reserved_hash_set(:registration_organization_display_name, d.registration_organization_display_name) - d.save! - end - end - - remove_column :miq_databases, :registration_organization_display_name - end -end diff --git a/db/migrate/20150213135315_create_configured_system_last_checkin.rb b/db/migrate/20150213135315_create_configured_system_last_checkin.rb deleted file mode 100644 index b89f559ae..000000000 --- a/db/migrate/20150213135315_create_configured_system_last_checkin.rb +++ /dev/null @@ -1,6 +0,0 @@ -class CreateConfiguredSystemLastCheckin < ActiveRecord::Migration[4.2] - def change - add_column :configured_systems, :last_checkin, :timestamp - add_column :configured_systems, :build_state, :string - end -end diff --git a/db/migrate/20150224102026_create_host_hypervisor_hostname.rb b/db/migrate/20150224102026_create_host_hypervisor_hostname.rb deleted file mode 100644 index 3d0da0a2f..000000000 --- a/db/migrate/20150224102026_create_host_hypervisor_hostname.rb +++ /dev/null @@ -1,5 +0,0 @@ -class CreateHostHypervisorHostname < ActiveRecord::Migration[4.2] - def change - add_column :hosts, :hypervisor_hostname, :string - end -end diff --git a/db/migrate/20150224164512_add_loopback_to_memcache_server_opts_in_configuration.rb b/db/migrate/20150224164512_add_loopback_to_memcache_server_opts_in_configuration.rb deleted file mode 100644 index 230337830..000000000 --- a/db/migrate/20150224164512_add_loopback_to_memcache_server_opts_in_configuration.rb +++ /dev/null @@ -1,31 +0,0 @@ -class AddLoopbackToMemcacheServerOptsInConfiguration < ActiveRecord::Migration[4.2] - class Configuration < ActiveRecord::Base - serialize :settings, Hash - end - - def up - default_binding_address = "-l 127.0.0.1" - say_with_time "Update configuration for memcache loopback address" do - Configuration.where(:typ => "vmdb").each do |config| - options = config.settings.fetch_path("session", "memcache_server_opts") - next if options.present? - - config.settings.store_path("session", "memcache_server_opts", default_binding_address) - config.save - end - end - end - - def down - default_binding_address = "-l 127.0.0.1" - say_with_time "Update configuration for memcache loopback address" do - Configuration.where(:typ => "vmdb").each do |config| - options = config.settings.fetch_path("session", "memcache_server_opts") - next unless options == default_binding_address - - config.settings.store_path("session", "memcache_server_opts", "") - config.save - end - end - end -end diff --git a/db/migrate/20150224192447_add_provider_id_to_ems.rb b/db/migrate/20150224192447_add_provider_id_to_ems.rb deleted file mode 100644 index 2aaa3cf4f..000000000 --- a/db/migrate/20150224192447_add_provider_id_to_ems.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddProviderIdToEms < ActiveRecord::Migration[4.2] - def change - add_column :ext_management_systems, :provider_id, :bigint - end -end diff --git a/db/migrate/20150224192716_migrate_configuration_manager_to_ems.rb b/db/migrate/20150224192716_migrate_configuration_manager_to_ems.rb deleted file mode 100644 index 3b12f5258..000000000 --- a/db/migrate/20150224192716_migrate_configuration_manager_to_ems.rb +++ /dev/null @@ -1,72 +0,0 @@ -require 'securerandom' - -class MigrateConfigurationManagerToEms < ActiveRecord::Migration[4.2] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - before_create do - self.guid ||= SecureRandom.uuid - end - end - - class ConfigurationManager < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class ConfiguredSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class ConfigurationProfile < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time("Migrating configuration_managers to ext_management_systems") do - systems = ConfiguredSystem.all.group_by(&:configuration_manager_id) - profiles = ConfigurationProfile.all.group_by(&:configuration_manager_id) - - ConfigurationManager.all.each do |manager| - attrs = manager.attributes.except("id") - attrs["created_on"] = attrs.delete("created_at") - attrs["updated_on"] = attrs.delete("updated_at") - ems = ExtManagementSystem.create!(attrs) - - Array(systems.delete(manager.id)).each do |s| - s.update!(:configuration_manager_id => ems.id) - end - - Array(profiles.delete(manager.id)).each do |p| - p.update!(:configuration_manager_id => ems.id) - end - - manager.delete - end - end - end - - def down - say_with_time("Migrating ext_management_systems to configuration_managers") do - systems = ConfiguredSystem.all.group_by(&:configuration_manager_id) - profiles = ConfigurationProfile.all.group_by(&:configuration_manager_id) - - ExtManagementSystem.where(:type => "ConfigurationManagerForeman").each do |ems| - attrs = ems.attributes - attrs["created_at"] = attrs.delete("created_on") - attrs["updated_at"] = attrs.delete("updated_on") - attrs = attrs.slice(*ConfigurationManager.column_names).except("id") - manager = ConfigurationManager.create!(attrs) - - Array(systems.delete(ems.id)).each do |s| - s.update!(:configuration_manager_id => manager.id) - end - - Array(profiles.delete(ems.id)).each do |p| - p.update!(:configuration_manager_id => manager.id) - end - - ems.delete - end - end - end -end diff --git a/db/migrate/20150224192816_migrate_provisioning_manager_to_ems.rb b/db/migrate/20150224192816_migrate_provisioning_manager_to_ems.rb deleted file mode 100644 index 8b510d8e5..000000000 --- a/db/migrate/20150224192816_migrate_provisioning_manager_to_ems.rb +++ /dev/null @@ -1,70 +0,0 @@ -require 'securerandom' - -class MigrateProvisioningManagerToEms < ActiveRecord::Migration[4.2] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - before_create do - self.guid ||= SecureRandom.uuid - end - end - - class ProvisioningManager < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class OperatingSystemFlavor < ActiveRecord::Base; end - - class CustomizationScript < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time("Migrating provisioning_managers to ext_management_os_flavors") do - os_flavors = OperatingSystemFlavor.all.group_by(&:provisioning_manager_id) - scripts = CustomizationScript.all.group_by(&:provisioning_manager_id) - - ProvisioningManager.all.each do |manager| - attrs = manager.attributes.except("id") - attrs["created_on"] = attrs.delete("created_at") - attrs["updated_on"] = attrs.delete("updated_at") - ems = ExtManagementSystem.create!(attrs) - - Array(os_flavors.delete(manager.id)).each do |f| - f.update!(:provisioning_manager_id => ems.id) - end - - Array(scripts.delete(manager.id)).each do |s| - s.update!(:provisioning_manager_id => ems.id) - end - - manager.delete - end - end - end - - def down - say_with_time("Migrating ext_management_os_flavors to provisioning_managers") do - os_flavors = OperatingSystemFlavor.all.group_by(&:provisioning_manager_id) - scripts = CustomizationScript.all.group_by(&:provisioning_manager_id) - - ExtManagementSystem.where(:type => "ProvisioningManagerForeman").each do |ems| - attrs = ems.attributes - attrs["created_at"] = attrs.delete("created_on") - attrs["updated_at"] = attrs.delete("updated_on") - attrs = attrs.slice(*ProvisioningManager.column_names).except("id") - manager = ProvisioningManager.create!(attrs) - - Array(os_flavors.delete(ems.id)).each do |f| - f.update!(:provisioning_manager_id => manager.id) - end - - Array(scripts.delete(ems.id)).each do |s| - s.update!(:provisioning_manager_id => manager.id) - end - - ems.delete - end - end - end -end diff --git a/db/migrate/20150224193752_drop_configration_manager_and_provisioning_manager.rb b/db/migrate/20150224193752_drop_configration_manager_and_provisioning_manager.rb deleted file mode 100644 index 2d228171b..000000000 --- a/db/migrate/20150224193752_drop_configration_manager_and_provisioning_manager.rb +++ /dev/null @@ -1,33 +0,0 @@ -class DropConfigrationManagerAndProvisioningManager < ActiveRecord::Migration[4.2] - def up - remove_index :configuration_managers, :provider_id - drop_table :configuration_managers - - remove_index :provisioning_managers, :provider_id - drop_table :provisioning_managers - end - - def down - create_table :configuration_managers do |t| - t.string :type - t.bigint :provider_id - t.datetime :created_at - t.datetime :updated_at - t.text :last_refresh_error - t.datetime :last_refresh_date - end - - add_index :configuration_managers, :provider_id - - create_table :provisioning_managers do |t| - t.string :type - t.bigint :provider_id - t.datetime :created_at - t.datetime :updated_at - t.text :last_refresh_error - t.datetime :last_refresh_date - end - - add_index :provisioning_managers, :provider_id - end -end diff --git a/db/migrate/20150225160000_add_service_systemd_deps.rb b/db/migrate/20150225160000_add_service_systemd_deps.rb deleted file mode 100644 index 2321da899..000000000 --- a/db/migrate/20150225160000_add_service_systemd_deps.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddServiceSystemdDeps < ActiveRecord::Migration[4.2] - def change - add_column :system_services, :dependencies, :text - end -end diff --git a/db/migrate/20150227181349_add_configured_system_organization_location.rb b/db/migrate/20150227181349_add_configured_system_organization_location.rb deleted file mode 100644 index 9759d3143..000000000 --- a/db/migrate/20150227181349_add_configured_system_organization_location.rb +++ /dev/null @@ -1,44 +0,0 @@ -class AddConfiguredSystemOrganizationLocation < ActiveRecord::Migration[4.2] - def change - create_table :configuration_organizations do |t| - t.string :type - t.string :name - t.belongs_to :provisioning_manager, :type => :bigint - t.string :manager_ref - t.timestamps :null => true - end - add_index :configuration_organizations, :provisioning_manager_id - add_index :configuration_organizations, :manager_ref - - create_table :configuration_locations do |t| - t.string :type - t.string :name - t.belongs_to :provisioning_manager, :type => :bigint - t.string :manager_ref - t.timestamps :null => true - end - add_index :configuration_locations, :provisioning_manager_id - add_index :configuration_locations, :manager_ref - - add_column :configured_systems, :configuration_location_id, :bigint - add_column :configured_systems, :configuration_organization_id, :bigint - - create_table :configuration_locations_configuration_profiles, :id => false do |t| - t.belongs_to :configuration_location, :type => :bigint - t.belongs_to :configuration_profile, :type => :bigint - end - add_index :configuration_locations_configuration_profiles, :configuration_location_id, - :name => :index_configuration_locations_configuration_profiles_location - add_index :configuration_locations_configuration_profiles, :configuration_profile_id, - :name => :index_configuration_locations_configuration_profiles_profile - - create_table :configuration_organizations_configuration_profiles, :id => false do |t| - t.belongs_to :configuration_organization, :type => :bigint - t.belongs_to :configuration_profile, :type => :bigint - end - add_index :configuration_organizations_configuration_profiles, :configuration_organization_id, - :name => :index_configuration_organizations_configuration_profiles_org - add_index :configuration_organizations_configuration_profiles, :configuration_profile_id, - :name => :index_configuration_organizations_configuration_profiles_p - end -end diff --git a/db/migrate/20150311181430_add_draft_to_orchestration_templates.rb b/db/migrate/20150311181430_add_draft_to_orchestration_templates.rb deleted file mode 100644 index 1824f0aef..000000000 --- a/db/migrate/20150311181430_add_draft_to_orchestration_templates.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AddDraftToOrchestrationTemplates < ActiveRecord::Migration[4.2] - class OrchestrationTemplate < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def self.up - add_column :orchestration_templates, :draft, :boolean - - say_with_time("Update OrchestrationTemplate draft") do - OrchestrationTemplate.update_all(:draft => false) - end - end - - def self.down - remove_column :orchestration_templates, :draft - end -end diff --git a/db/migrate/20150311182221_orchestration_template_rename_ems_ref_to_md5_and_drop_unique.rb b/db/migrate/20150311182221_orchestration_template_rename_ems_ref_to_md5_and_drop_unique.rb deleted file mode 100644 index 7f44fe4f1..000000000 --- a/db/migrate/20150311182221_orchestration_template_rename_ems_ref_to_md5_and_drop_unique.rb +++ /dev/null @@ -1,13 +0,0 @@ -class OrchestrationTemplateRenameEmsRefToMd5AndDropUnique < ActiveRecord::Migration[4.2] - def up - remove_index :orchestration_templates, :ems_ref - rename_column :orchestration_templates, :ems_ref, :md5 - add_index :orchestration_templates, :md5 - end - - def down - remove_index :orchestration_templates, :md5 - rename_column :orchestration_templates, :md5, :ems_ref - add_index :orchestration_templates, :ems_ref, :unique => true - end -end diff --git a/db/migrate/20150312081342_add_read_only_to_dialog_fields.rb b/db/migrate/20150312081342_add_read_only_to_dialog_fields.rb deleted file mode 100644 index 80836e989..000000000 --- a/db/migrate/20150312081342_add_read_only_to_dialog_fields.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddReadOnlyToDialogFields < ActiveRecord::Migration[4.2] - def change - add_column :dialog_fields, :read_only, :boolean - end -end diff --git a/db/migrate/20150313110200_add_type_to_ems_clusters.rb b/db/migrate/20150313110200_add_type_to_ems_clusters.rb deleted file mode 100644 index 3832041e0..000000000 --- a/db/migrate/20150313110200_add_type_to_ems_clusters.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddTypeToEmsClusters < ActiveRecord::Migration[4.2] - def change - add_column :ems_clusters, :type, :string - end -end diff --git a/db/migrate/20150316175916_update_miq_database_default_update_repo_name.rb b/db/migrate/20150316175916_update_miq_database_default_update_repo_name.rb deleted file mode 100644 index 7b9a9a768..000000000 --- a/db/migrate/20150316175916_update_miq_database_default_update_repo_name.rb +++ /dev/null @@ -1,29 +0,0 @@ -class UpdateMiqDatabaseDefaultUpdateRepoName < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base; end - - REPO_NAME_HASH = { - "rhel-x86_64-server-6-cf-me-3" => "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1", - "rhel-x86_64-server-6-cf-me-3.1 rhel-x86_64-server-6-rhscl-1" => "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1", - "cf-me-5.3-for-rhel-6-rpms rhel-server-rhscl-6-rpms" => "cf-me-5.4-for-rhel-6-rpms rhel-server-rhscl-6-rpms", - } - - def up - say_with_time("Updating update_repo_name") do - update(REPO_NAME_HASH) - end - end - - def down - say_with_time("Updating update_repo_name") do - update(REPO_NAME_HASH.invert) - end - end - - def update(hash) - db = MiqDatabase.first - if db - new_repo = hash[db.update_repo_name] - db.update(:update_repo_name => new_repo) if new_repo - end - end -end diff --git a/db/migrate/20150319115040_create_replication_controllers.rb b/db/migrate/20150319115040_create_replication_controllers.rb deleted file mode 100644 index 01e868b44..000000000 --- a/db/migrate/20150319115040_create_replication_controllers.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateReplicationControllers < ActiveRecord::Migration[4.2] - def up - create_table :container_replication_controllers do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.belongs_to :ems, :type => :bigint - t.string :resource_version - t.string :namespace - t.integer :replicas - t.integer :current_replicas - end - end - - def down - drop_table :container_replication_controllers - end -end diff --git a/db/migrate/20150323003436_add_configured_system_attributes.rb b/db/migrate/20150323003436_add_configured_system_attributes.rb deleted file mode 100644 index 1d86212b5..000000000 --- a/db/migrate/20150323003436_add_configured_system_attributes.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddConfiguredSystemAttributes < ActiveRecord::Migration[4.2] - def change - add_column :configured_systems, :ipaddress, :string - add_column :configured_systems, :mac_address, :string - add_column :configured_systems, :ipmi_present, :boolean - add_column :configured_systems, :puppet_status, :string - add_column :configured_systems, :customization_script_ptable_id, :bigint - add_column :configured_systems, :customization_script_medium_id, :bigint - end -end diff --git a/db/migrate/20150323004436_add_locations_parent.rb b/db/migrate/20150323004436_add_locations_parent.rb deleted file mode 100644 index f455958f9..000000000 --- a/db/migrate/20150323004436_add_locations_parent.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddLocationsParent < ActiveRecord::Migration[4.2] - def change - add_column :configuration_locations, :parent_id, :bigint - add_column :configuration_locations, :parent_ref, :string - add_column :configuration_organizations, :parent_id, :bigint - add_column :configuration_organizations, :parent_ref, :string - add_column :configuration_profiles, :parent_id, :bigint - add_column :configuration_profiles, :parent_ref, :string - end -end diff --git a/db/migrate/20150323172109_add_availability_zone_id_to_host.rb b/db/migrate/20150323172109_add_availability_zone_id_to_host.rb deleted file mode 100644 index da7ead867..000000000 --- a/db/migrate/20150323172109_add_availability_zone_id_to_host.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddAvailabilityZoneIdToHost < ActiveRecord::Migration[4.2] - def change - add_column :hosts, :availability_zone_id, :bigint - add_index :hosts, :availability_zone_id - end -end diff --git a/db/migrate/20150324111111_add_retirement_requester_to_vms_and_services.rb b/db/migrate/20150324111111_add_retirement_requester_to_vms_and_services.rb deleted file mode 100644 index ab24f7316..000000000 --- a/db/migrate/20150324111111_add_retirement_requester_to_vms_and_services.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddRetirementRequesterToVmsAndServices < ActiveRecord::Migration[4.2] - def change - add_column :vms, :retirement_requester, :string - add_column :services, :retirement_requester, :string - end -end diff --git a/db/migrate/20150324143511_add_organization_title.rb b/db/migrate/20150324143511_add_organization_title.rb deleted file mode 100644 index ad8bb336e..000000000 --- a/db/migrate/20150324143511_add_organization_title.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddOrganizationTitle < ActiveRecord::Migration[4.2] - def change - add_column :configuration_organizations, :title, :string - add_column :configuration_locations, :title, :string - end -end diff --git a/db/migrate/20150324164033_create_configuration_tags.rb b/db/migrate/20150324164033_create_configuration_tags.rb deleted file mode 100644 index bf3486877..000000000 --- a/db/migrate/20150324164033_create_configuration_tags.rb +++ /dev/null @@ -1,31 +0,0 @@ -class CreateConfigurationTags < ActiveRecord::Migration[4.2] - def change - create_table :configuration_tags do |t| - t.string :type - t.string :manager_ref - t.string :name - t.belongs_to :manager, :type => :bigint - - t.timestamps :null => true - end - - create_table :configuration_profiles_configuration_tags, :id => false do |t| - t.belongs_to :configuration_profile, :type => :bigint - t.belongs_to :configuration_tag, :type => :bigint - end - - add_index :configuration_profiles_configuration_tags, :configuration_profile_id, - :name => :configuration_profiles_configuration_tags_profile_id - add_index :configuration_profiles_configuration_tags, :configuration_tag_id, - :name => :configuration_profiles_configuration_tags_tag_id - - create_table :configuration_tags_configured_systems, :id => false do |t| - t.belongs_to :configured_system, :type => :bigint - t.belongs_to :configuration_tag, :type => :bigint - end - add_index :configuration_tags_configured_systems, :configured_system_id, - :name => :configured_systems_configuration_system_id - add_index :configuration_tags_configured_systems, :configuration_tag_id, - :name => :configured_systems_configuration_tag_id - end -end diff --git a/db/migrate/20150326015341_add_container_group_node_relationship.rb b/db/migrate/20150326015341_add_container_group_node_relationship.rb deleted file mode 100644 index 2aa2cc87a..000000000 --- a/db/migrate/20150326015341_add_container_group_node_relationship.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContainerGroupNodeRelationship < ActiveRecord::Migration[4.2] - def change - add_column :container_groups, :container_node_id, :bigint - end -end diff --git a/db/migrate/20150326130147_create_container_groups_container_services.rb b/db/migrate/20150326130147_create_container_groups_container_services.rb deleted file mode 100644 index d0528f1ef..000000000 --- a/db/migrate/20150326130147_create_container_groups_container_services.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateContainerGroupsContainerServices < ActiveRecord::Migration[4.2] - def change - create_table :container_groups_container_services, :id => false do |t| - t.bigint :container_service_id - t.bigint :container_group_id - end - end -end diff --git a/db/migrate/20150326154800_add_application_install_time.rb b/db/migrate/20150326154800_add_application_install_time.rb deleted file mode 100644 index f1ec74edb..000000000 --- a/db/migrate/20150326154800_add_application_install_time.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddApplicationInstallTime < ActiveRecord::Migration[4.2] - def change - add_column :guest_applications, :install_time, :timestamp - end -end diff --git a/db/migrate/20150330214408_add_file_depot_id_to_miq_schedule.rb b/db/migrate/20150330214408_add_file_depot_id_to_miq_schedule.rb deleted file mode 100644 index f45f1db1b..000000000 --- a/db/migrate/20150330214408_add_file_depot_id_to_miq_schedule.rb +++ /dev/null @@ -1,39 +0,0 @@ -class AddFileDepotIdToMiqSchedule < ActiveRecord::Migration[4.2] - class MiqSchedule < ActiveRecord::Base - def file_depot - return @file_depot if defined?(@file_depot) - @file_depot = FileDepot.where(:id => file_depot_id).first - end - end - - class FileDepot < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - def resource - return @resource if defined?(@resource) - @resource = MiqSchedule.where(:id => resource_id).first - end - end - - def up - add_column :miq_schedules, :file_depot_id, :bigint - - say_with_time "Updating Schedules with file depots" do - FileDepot.where(:resource_type => "MiqSchedule").each { |depot| depot.resource.update(:file_depot_id => depot.id) if depot.resource } - end - - remove_column :file_depots, :resource_id - remove_column :file_depots, :resource_type - end - - def down - add_column :file_depots, :resource_id, :bigint - add_column :file_depots, :resource_type, :string - - say_with_time "Updating Schedules with file depots" do - MiqSchedule.all.each { |schedule| schedule.file_depot.update(:resource_type => "MiqSchedule", :resource_id => schedule.id) if schedule.file_depot } - end - - remove_column :miq_schedules, :file_depot_id - end -end diff --git a/db/migrate/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag.rb b/db/migrate/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag.rb deleted file mode 100644 index f2ebaf4fe..000000000 --- a/db/migrate/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag.rb +++ /dev/null @@ -1,25 +0,0 @@ -class ChangeDialogFieldDynamicListsToDialogFieldDropDownListWithDynamicFlag < ActiveRecord::Migration[4.2] - class DialogField < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time("Converting DialogFieldDynamicLists to DialogFieldDropDowns with the dynamic flag set to true") do - DialogField.where(:type => "DialogFieldDynamicList").each do |dialog_field_dynamic_list| - dialog_field_dynamic_list.type = "DialogFieldDropDownList" - dialog_field_dynamic_list.dynamic = true - dialog_field_dynamic_list.save - end - end - end - - def down - say_with_time("Converting DialogFieldDropDowns with dynamic flag true to DialogFieldDynamicLists") do - DialogField.where(:type => "DialogFieldDropDownList", :dynamic => true).each do |dialog_field_drop_down| - dialog_field_drop_down.type = "DialogFieldDynamicList" - dialog_field_drop_down.dynamic = false - dialog_field_drop_down.save - end - end - end -end diff --git a/db/migrate/20150401090146_add_systemd_and_openstack_related_columns_to_system_services.rb b/db/migrate/20150401090146_add_systemd_and_openstack_related_columns_to_system_services.rb deleted file mode 100644 index f8bd767f2..000000000 --- a/db/migrate/20150401090146_add_systemd_and_openstack_related_columns_to_system_services.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddSystemdAndOpenstackRelatedColumnsToSystemServices < ActiveRecord::Migration[4.2] - def change - add_column :system_services, :systemd_load, :string - add_column :system_services, :systemd_active, :string - add_column :system_services, :systemd_sub, :string - end -end diff --git a/db/migrate/20150402115247_add_container_port_config_names.rb b/db/migrate/20150402115247_add_container_port_config_names.rb deleted file mode 100644 index 56071504e..000000000 --- a/db/migrate/20150402115247_add_container_port_config_names.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContainerPortConfigNames < ActiveRecord::Migration[4.2] - def change - add_column :container_port_configs, :name, :string - end -end diff --git a/db/migrate/20150402133252_add_container_node_cross_provider_association.rb b/db/migrate/20150402133252_add_container_node_cross_provider_association.rb deleted file mode 100644 index 9321d4f46..000000000 --- a/db/migrate/20150402133252_add_container_node_cross_provider_association.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddContainerNodeCrossProviderAssociation < ActiveRecord::Migration[4.2] - def up - add_column :container_nodes, :lives_on_type, :string - add_column :container_nodes, :lives_on_id, :bigint - end - - def down - remove_column :container_nodes, :lives_on_type - remove_column :container_nodes, :lives_on_id - end -end diff --git a/db/migrate/20150402182026_container_metrics.rb b/db/migrate/20150402182026_container_metrics.rb deleted file mode 100644 index 750a6a583..000000000 --- a/db/migrate/20150402182026_container_metrics.rb +++ /dev/null @@ -1,7 +0,0 @@ -class ContainerMetrics < ActiveRecord::Migration[4.2] - def change - add_column :container_nodes, :last_perf_capture_on, :datetime - add_column :containers, :last_perf_capture_on, :datetime - add_column :container_groups, :last_perf_capture_on, :datetime - end -end diff --git a/db/migrate/20150405141637_remove_port_config_from_container_service.rb b/db/migrate/20150405141637_remove_port_config_from_container_service.rb deleted file mode 100644 index 898240519..000000000 --- a/db/migrate/20150405141637_remove_port_config_from_container_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -class RemovePortConfigFromContainerService < ActiveRecord::Migration[4.2] - class ContainerService < ActiveRecord::Base - has_many :container_service_port_configs, - :class_name => "RemovePortConfigFromContainerService::ContainerServicePortConfig" - end - - class ContainerServicePortConfig < ActiveRecord::Base - belongs_to :container_service, - :class_name => "RemovePortConfigFromContainerService::ContainerService" - end - - def up - create_table :container_service_port_configs do |t| - t.string :ems_ref - t.string :name - t.integer :port - t.string :target_port - t.string :protocol - t.belongs_to :container_service, :type => :bigint - end - - say_with_time("Moving container_service port records to container_service_port_config table") do - ContainerService.all.each do |service| - ContainerServicePortConfig.create!( - :ems_ref => "#{service.ems_ref}_#{service.port}_#{service.container_port}", - :port => service.port, - :protocol => service.protocol, - :target_port => service.container_port, - :container_service_id => service.id - ) - end - end - - remove_column :container_services, :port - remove_column :container_services, :protocol - remove_column :container_services, :container_port - end - - def down - add_column :container_services, :port, :integer - add_column :container_services, :protocol, :string - add_column :container_services, :container_port, :integer - - say_with_time("Moving container service port config records back to container service") do - ContainerService.all.each do |service| - port_config = service.container_service_port_configs.first - service.update!(:port => port_config.port, - :protocol => port_config.protocol, - :container_port => port_config.target_port) - end - end - - drop_table :container_service_port_configs - end -end diff --git a/db/migrate/20150406141646_remove_service_id_from_ems_events.rb b/db/migrate/20150406141646_remove_service_id_from_ems_events.rb deleted file mode 100644 index 8c8cea787..000000000 --- a/db/migrate/20150406141646_remove_service_id_from_ems_events.rb +++ /dev/null @@ -1,11 +0,0 @@ -class RemoveServiceIdFromEmsEvents < ActiveRecord::Migration[4.2] - def up - remove_index :ems_events, :service_id - remove_column :ems_events, :service_id - end - - def down - add_column :ems_events, :service_id, :bigint - add_index :ems_events, :service_id - end -end diff --git a/db/migrate/20150407144345_add_kerberos_to_ext_management_system.rb b/db/migrate/20150407144345_add_kerberos_to_ext_management_system.rb deleted file mode 100644 index 93003b5cc..000000000 --- a/db/migrate/20150407144345_add_kerberos_to_ext_management_system.rb +++ /dev/null @@ -1,32 +0,0 @@ -class AddKerberosToExtManagementSystem < ActiveRecord::Migration[4.2] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - include ReservedMigrationMixin - include MigrationStubHelper # NOTE: Must be included after other mixins - end - - def self.up - add_column :ext_management_systems, :security_protocol, :string - add_column :ext_management_systems, :realm, :string - - say_with_time("Migrate data from reserved table") do - ExtManagementSystem.includes(:reserved_rec).each do |e| - e.reserved_hash_migrate(:security_protocol, :realm) - end - end - end - - def down - say_with_time("Migrating security_protocol and realm to Reserves table") do - ExtManagementSystem.includes(:reserved_rec).each do |e| - e.reserved_hash_set(:security_protocol, e.security_protocol) - e.reserved_hash_set(:realm, e.realm) - e.save! - end - end - - remove_column :ext_management_systems, :security_protocol - remove_column :ext_management_systems, :realm - end -end diff --git a/db/migrate/20150409145038_add_host_service_group_to_system_services.rb b/db/migrate/20150409145038_add_host_service_group_to_system_services.rb deleted file mode 100644 index d07ae0347..000000000 --- a/db/migrate/20150409145038_add_host_service_group_to_system_services.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddHostServiceGroupToSystemServices < ActiveRecord::Migration[4.2] - def change - add_column :system_services, :host_service_group_id, :bigint - add_index :system_services, :host_service_group_id - end -end diff --git a/db/migrate/20150409145147_add_host_service_group_to_filesystems.rb b/db/migrate/20150409145147_add_host_service_group_to_filesystems.rb deleted file mode 100644 index 58172caab..000000000 --- a/db/migrate/20150409145147_add_host_service_group_to_filesystems.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddHostServiceGroupToFilesystems < ActiveRecord::Migration[4.2] - def change - add_column :filesystems, :host_service_group_id, :bigint - add_index :filesystems, :host_service_group_id - end -end diff --git a/db/migrate/20150409145739_create_host_service_groups.rb b/db/migrate/20150409145739_create_host_service_groups.rb deleted file mode 100644 index 30d619783..000000000 --- a/db/migrate/20150409145739_create_host_service_groups.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateHostServiceGroups < ActiveRecord::Migration[4.2] - def up - create_table :host_service_groups do |t| - t.string :name - t.string :type - t.belongs_to :host, :type => :bigint - end - end - - def down - drop_table :host_service_groups - end -end diff --git a/db/migrate/20150414094834_create_container_projects.rb b/db/migrate/20150414094834_create_container_projects.rb deleted file mode 100644 index bdfdb4538..000000000 --- a/db/migrate/20150414094834_create_container_projects.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateContainerProjects < ActiveRecord::Migration[4.2] - def up - create_table :container_projects do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.string :resource_version - t.string :display_name - t.belongs_to :ems, :type => :bigint - end - add_index :container_projects, :ems_id - end - - def down - remove_index :container_projects, :ems_id - drop_table :container_projects - end -end diff --git a/db/migrate/20150414183946_rename_container_id.rb b/db/migrate/20150414183946_rename_container_id.rb deleted file mode 100644 index 38525dd46..000000000 --- a/db/migrate/20150414183946_rename_container_id.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RenameContainerId < ActiveRecord::Migration[4.2] - def change - rename_column :containers, :container_id, :backing_ref - end -end diff --git a/db/migrate/20150414201314_update_foreman_raw_attributes.rb b/db/migrate/20150414201314_update_foreman_raw_attributes.rb deleted file mode 100644 index a00449171..000000000 --- a/db/migrate/20150414201314_update_foreman_raw_attributes.rb +++ /dev/null @@ -1,19 +0,0 @@ -class UpdateForemanRawAttributes < ActiveRecord::Migration[4.2] - def change - rename_column :configured_systems, :operating_system_flavor_id, :direct_operating_system_flavor_id - rename_column :configured_systems, :customization_script_medium_id, :direct_customization_script_medium_id - rename_column :configured_systems, :customization_script_ptable_id, :direct_customization_script_ptable_id - - remove_index :configuration_profiles, :column => :operating_system_flavor_id, :name => 'index_configuration_profiles_on_operating_system_flavor_id' - remove_index :configuration_profiles, :column => :customization_script_medium_id, :name => 'index_configuration_profiles_on_customization_script_medium_id' - remove_index :configuration_profiles, :column => :customization_script_ptable_id, :name => 'index_configuration_profiles_on_customization_script_ptable_id' - - rename_column :configuration_profiles, :operating_system_flavor_id, :direct_operating_system_flavor_id - rename_column :configuration_profiles, :customization_script_medium_id, :direct_customization_script_medium_id - rename_column :configuration_profiles, :customization_script_ptable_id, :direct_customization_script_ptable_id - - add_index :configuration_profiles, [:direct_operating_system_flavor_id], :name => 'index_configuration_profiles_on_operating_system_flavor_id' - add_index :configuration_profiles, [:direct_customization_script_medium_id], :name => 'index_configuration_profiles_on_customization_script_medium_id' - add_index :configuration_profiles, [:direct_customization_script_ptable_id], :name => 'index_configuration_profiles_on_customization_script_ptable_id' - end -end diff --git a/db/migrate/20150414204018_create_container_node_identities.rb b/db/migrate/20150414204018_create_container_node_identities.rb deleted file mode 100644 index 51cfc3049..000000000 --- a/db/migrate/20150414204018_create_container_node_identities.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateContainerNodeIdentities < ActiveRecord::Migration[4.2] - def change - # identity_infra is the node id assigned by the infrastructure - add_column :container_nodes, :identity_infra, :string - - # identity_machine is the machine id generated by systemd: - # http://www.freedesktop.org/software/systemd/man/machine-id.html - add_column :container_nodes, :identity_machine, :string - - # identity_system is the system uuid collected by the bios, in - # some infrastructure is injected by the hypervisor - add_column :container_nodes, :identity_system, :string - end -end diff --git a/db/migrate/20150415131224_create_container_routes.rb b/db/migrate/20150415131224_create_container_routes.rb deleted file mode 100644 index 979b65fcc..000000000 --- a/db/migrate/20150415131224_create_container_routes.rb +++ /dev/null @@ -1,21 +0,0 @@ -class CreateContainerRoutes < ActiveRecord::Migration[4.2] - def up - create_table :container_routes do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.string :resource_version - t.string :namespace - t.string :host_name - t.string :service_name - t.string :path - t.belongs_to :ems, :type => :bigint - end - add_index :container_routes, :ems_id - end - - def down - remove_index :container_routes, :ems_id - drop_table :container_routes - end -end diff --git a/db/migrate/20150417125852_add_container_events.rb b/db/migrate/20150417125852_add_container_events.rb deleted file mode 100644 index 62b2b391d..000000000 --- a/db/migrate/20150417125852_add_container_events.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddContainerEvents < ActiveRecord::Migration[4.2] - def change - add_column :ems_events, :container_node_id, :bigint - add_column :ems_events, :container_node_name, :string - add_column :ems_events, :container_group_id, :bigint - add_column :ems_events, :container_group_name, :string - add_column :ems_events, :container_namespace, :string - end -end diff --git a/db/migrate/20150417162811_update_foreman_derived_values.rb b/db/migrate/20150417162811_update_foreman_derived_values.rb deleted file mode 100644 index 802142dc6..000000000 --- a/db/migrate/20150417162811_update_foreman_derived_values.rb +++ /dev/null @@ -1,11 +0,0 @@ -class UpdateForemanDerivedValues < ActiveRecord::Migration[4.2] - def change - add_column :configured_systems, :operating_system_flavor_id, :bigint - add_column :configured_systems, :customization_script_medium_id, :bigint - add_column :configured_systems, :customization_script_ptable_id, :bigint - - add_column :configuration_profiles, :operating_system_flavor_id, :bigint - add_column :configuration_profiles, :customization_script_medium_id, :bigint - add_column :configuration_profiles, :customization_script_ptable_id, :bigint - end -end diff --git a/db/migrate/20150417210709_add_retirement_to_orchestration_stack.rb b/db/migrate/20150417210709_add_retirement_to_orchestration_stack.rb deleted file mode 100644 index 8ce421999..000000000 --- a/db/migrate/20150417210709_add_retirement_to_orchestration_stack.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddRetirementToOrchestrationStack < ActiveRecord::Migration[4.2] - def change - add_column :orchestration_stacks, :retired, :boolean - add_column :orchestration_stacks, :retires_on, :date - add_column :orchestration_stacks, :retirement_warn, :bigint - add_column :orchestration_stacks, :retirement_last_warn, :datetime - add_column :orchestration_stacks, :retirement_state, :string - add_column :orchestration_stacks, :retirement_requester, :string - end -end diff --git a/db/migrate/20150420201056_add_auto_refresh_fields_to_dialog_fields.rb b/db/migrate/20150420201056_add_auto_refresh_fields_to_dialog_fields.rb deleted file mode 100644 index 91c871a19..000000000 --- a/db/migrate/20150420201056_add_auto_refresh_fields_to_dialog_fields.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddAutoRefreshFieldsToDialogFields < ActiveRecord::Migration[4.2] - def change - add_column :dialog_fields, :auto_refresh, :boolean - add_column :dialog_fields, :trigger_auto_refresh, :boolean - end -end diff --git a/db/migrate/20150422162729_add_replicator_relationship.rb b/db/migrate/20150422162729_add_replicator_relationship.rb deleted file mode 100644 index 94f63bafe..000000000 --- a/db/migrate/20150422162729_add_replicator_relationship.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddReplicatorRelationship < ActiveRecord::Migration[4.2] - def change - add_column :container_groups, :container_replicator_id, :bigint - end -end diff --git a/db/migrate/20150426135513_add_image_id_to_containers.rb b/db/migrate/20150426135513_add_image_id_to_containers.rb deleted file mode 100644 index 38e3ebb33..000000000 --- a/db/migrate/20150426135513_add_image_id_to_containers.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddImageIdToContainers < ActiveRecord::Migration[4.2] - def up - add_column :containers, :image_ref, :string - end - - def down - remove_column :containers, :image_ref - end -end diff --git a/db/migrate/20150429214648_add_direct_configuration_tags.rb b/db/migrate/20150429214648_add_direct_configuration_tags.rb deleted file mode 100644 index f46e05f13..000000000 --- a/db/migrate/20150429214648_add_direct_configuration_tags.rb +++ /dev/null @@ -1,22 +0,0 @@ -class AddDirectConfigurationTags < ActiveRecord::Migration[4.2] - def change - create_table :direct_configuration_profiles_configuration_tags, :id => false do |t| - t.belongs_to :configuration_profile, :type => :bigint - t.belongs_to :configuration_tag, :type => :bigint - end - - add_index :configuration_profiles_configuration_tags, :configuration_profile_id, - :name => :index_direct_configuration_profiles_tags_profile_id - add_index :configuration_profiles_configuration_tags, :configuration_tag_id, - :name => :index_direct_configuration_profiles_tags_tag_id - - create_table :direct_configuration_tags_configured_systems, :id => false do |t| - t.belongs_to :configured_system, :type => :bigint - t.belongs_to :configuration_tag, :type => :bigint - end - add_index :direct_configuration_tags_configured_systems, :configured_system_id, - :name => :index_direct_configured_systems_tags_system_id - add_index :direct_configuration_tags_configured_systems, :configuration_tag_id, - :name => :index_direct_configured_systems_tag_tag_id - end -end diff --git a/db/migrate/20150501193927_default_provider_verify_ssl.rb b/db/migrate/20150501193927_default_provider_verify_ssl.rb deleted file mode 100644 index 79a3924a8..000000000 --- a/db/migrate/20150501193927_default_provider_verify_ssl.rb +++ /dev/null @@ -1,15 +0,0 @@ -class DefaultProviderVerifySsl < ActiveRecord::Migration[4.2] - class Provider < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time "Setting Provider verify_ssl values for nils" do - Provider.where(:verify_ssl => nil).update_all(:verify_ssl => OpenSSL::SSL::VERIFY_PEER) - end - end - - def down - # it was ambigious before, no need to set back to nil - end -end diff --git a/db/migrate/20150503094838_add_container_group_ip_to_container_groups.rb b/db/migrate/20150503094838_add_container_group_ip_to_container_groups.rb deleted file mode 100644 index bff0a6449..000000000 --- a/db/migrate/20150503094838_add_container_group_ip_to_container_groups.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddContainerGroupIpToContainerGroups < ActiveRecord::Migration[4.2] - def up - add_column :container_groups, :ipaddress, :string - end - - def down - remove_column :container_groups, :ipaddress - end -end diff --git a/db/migrate/20150504111111_add_cloud_subnet_required_to_flavor.rb b/db/migrate/20150504111111_add_cloud_subnet_required_to_flavor.rb deleted file mode 100644 index e91e65dfc..000000000 --- a/db/migrate/20150504111111_add_cloud_subnet_required_to_flavor.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCloudSubnetRequiredToFlavor < ActiveRecord::Migration[4.2] - def change - add_column :flavors, :cloud_subnet_required, :boolean - end -end diff --git a/db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb b/db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb deleted file mode 100644 index 712d5935d..000000000 --- a/db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddStatusReasonAndCloudTenantToOrchestrationStacks < ActiveRecord::Migration[4.2] - def change - add_column :orchestration_stacks, :status_reason, :text - add_column :orchestration_stacks, :cloud_tenant_id, :bigint - end -end diff --git a/db/migrate/20150507102612_create_container_node_conditions.rb b/db/migrate/20150507102612_create_container_node_conditions.rb deleted file mode 100644 index d9b17ae4e..000000000 --- a/db/migrate/20150507102612_create_container_node_conditions.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateContainerNodeConditions < ActiveRecord::Migration[4.2] - def up - create_table :container_node_conditions do |t| - t.belongs_to :container_node, :type => :bigint - t.string :name - t.string :status - t.timestamp :last_heartbeat_time - t.timestamp :last_transition_time - t.string :reason - t.string :message - end - end - - def down - drop_table :container_node_conditions - end -end diff --git a/db/migrate/20150514124529_rename_replication_controllers_to_container_replicators.rb b/db/migrate/20150514124529_rename_replication_controllers_to_container_replicators.rb deleted file mode 100644 index db508da46..000000000 --- a/db/migrate/20150514124529_rename_replication_controllers_to_container_replicators.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RenameReplicationControllersToContainerReplicators < ActiveRecord::Migration[4.2] - def self.up - rename_table :container_replication_controllers, :container_replicators - end - - def self.down - rename_table :container_replicators, :container_replication_controllers - end -end diff --git a/db/migrate/20150519123317_create_container_env_vars.rb b/db/migrate/20150519123317_create_container_env_vars.rb deleted file mode 100644 index b83724e65..000000000 --- a/db/migrate/20150519123317_create_container_env_vars.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateContainerEnvVars < ActiveRecord::Migration[4.2] - def up - create_table :container_env_vars do |t| - t.string :name - t.text :value - t.string :field_path - t.belongs_to :container_definition, :type => :bigint - end - end - - def down - drop_table :container_env_vars - end -end diff --git a/db/migrate/20150521104843_create_container_images.rb b/db/migrate/20150521104843_create_container_images.rb deleted file mode 100644 index 077d58efc..000000000 --- a/db/migrate/20150521104843_create_container_images.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateContainerImages < ActiveRecord::Migration[4.2] - def up - create_table :container_images do |t| - t.string :tag - t.string :name - t.string :image_ref - t.belongs_to :container_image_registry, :type => :bigint - t.belongs_to :ems, :type => :bigint - end - end - - def down - drop_table :container_images - end -end diff --git a/db/migrate/20150521132514_create_container_image_registries.rb b/db/migrate/20150521132514_create_container_image_registries.rb deleted file mode 100644 index b913eedf4..000000000 --- a/db/migrate/20150521132514_create_container_image_registries.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateContainerImageRegistries < ActiveRecord::Migration[4.2] - def up - create_table :container_image_registries do |t| - t.string :name # Never used but all entities are assumed to have a name. - t.string :host - t.string :port - t.belongs_to :ems, :type => :bigint - end - end - - def down - drop_table :container_image_registries - end -end diff --git a/db/migrate/20150521204814_add_container_relationship.rb b/db/migrate/20150521204814_add_container_relationship.rb deleted file mode 100644 index bdac0a8e9..000000000 --- a/db/migrate/20150521204814_add_container_relationship.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContainerRelationship < ActiveRecord::Migration[4.2] - def change - add_column :containers, :container_definition_id, :bigint - end -end diff --git a/db/migrate/20150522161336_add_container_entities_type.rb b/db/migrate/20150522161336_add_container_entities_type.rb deleted file mode 100644 index f13c6b5e6..000000000 --- a/db/migrate/20150522161336_add_container_entities_type.rb +++ /dev/null @@ -1,34 +0,0 @@ -class AddContainerEntitiesType < ActiveRecord::Migration[4.2] - class ContainerNode < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Container < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class ContainerGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - add_column :container_nodes, :type, :string - say_with_time("Update ContainerNodes type to ContainerNodeKubernetes") do - ContainerNode.update_all(:type => "ContainerNodeKubernetes") - end - add_column :containers, :type, :string - say_with_time("Update Containers type to ContainerKubernetes") do - Container.update_all(:type => "ContainerKubernetes") - end - add_column :container_groups, :type, :string - say_with_time("Update ContainerGroups type to ContainerGroupKubernetes") do - ContainerGroup.update_all(:type => "ContainerGroupKubernetes") - end - end - - def down - remove_column :container_nodes, :type - remove_column :containers, :type - remove_column :container_groups, :type - end -end diff --git a/db/migrate/20150526080322_add_container_node_versions_and_os_image.rb b/db/migrate/20150526080322_add_container_node_versions_and_os_image.rb deleted file mode 100644 index af0db9329..000000000 --- a/db/migrate/20150526080322_add_container_node_versions_and_os_image.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddContainerNodeVersionsAndOsImage < ActiveRecord::Migration[4.2] - def change - add_column :operating_systems, :kernel_version, :string - add_column :container_nodes, :kubernetes_kubelet_version, :string - add_column :container_nodes, :kubernetes_proxy_version, :string - add_column :container_nodes, :container_runtime_version, :string - end -end diff --git a/db/migrate/20150528113122_add_image_relation_to_container.rb b/db/migrate/20150528113122_add_image_relation_to_container.rb deleted file mode 100644 index f2e244a27..000000000 --- a/db/migrate/20150528113122_add_image_relation_to_container.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddImageRelationToContainer < ActiveRecord::Migration[4.2] - def up - add_column :containers, :container_image_id, :bigint - remove_column :containers, :image - remove_column :containers, :image_ref - end - - def down - remove_column :containers, :container_image_id - add_column :containers, :image, :string - add_column :containers, :image_ref, :string - end -end diff --git a/db/migrate/20150604154825_rename_container_node_conditions_to_container_conditions.rb b/db/migrate/20150604154825_rename_container_node_conditions_to_container_conditions.rb deleted file mode 100644 index 81c843a10..000000000 --- a/db/migrate/20150604154825_rename_container_node_conditions_to_container_conditions.rb +++ /dev/null @@ -1,23 +0,0 @@ -class RenameContainerNodeConditionsToContainerConditions < ActiveRecord::Migration[4.2] - class ContainerCondition < ActiveRecord::Base; end - - def up - rename_table :container_node_conditions, :container_conditions - rename_column :container_conditions, :container_node_id, :container_entity_id - add_column :container_conditions, :container_entity_type, :string - - say_with_time("Adding container_entity_type 'ContainerNode' to all existing node conditions") do - ContainerCondition.update_all(:container_entity_type => 'ContainerNode') - end - end - - def down - say_with_time("remove all container group conditions to leave only container node conditions") do - ContainerCondition.where(:container_entity_type => 'ContainerGroup').destroy_all - end - - remove_column :container_conditions, :container_entity_type - rename_column :container_conditions, :container_entity_id, :container_node_id - rename_table :container_conditions, :container_node_conditions - end -end diff --git a/db/migrate/20150610155632_add_image_to_guest_application.rb b/db/migrate/20150610155632_add_image_to_guest_application.rb deleted file mode 100644 index 94be231e2..000000000 --- a/db/migrate/20150610155632_add_image_to_guest_application.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddImageToGuestApplication < ActiveRecord::Migration[4.2] - def change - add_column :guest_applications, :container_image_id, :bigint - end -end diff --git a/db/migrate/20150610172646_add_container_project_relationship.rb b/db/migrate/20150610172646_add_container_project_relationship.rb deleted file mode 100644 index bffb23c4d..000000000 --- a/db/migrate/20150610172646_add_container_project_relationship.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddContainerProjectRelationship < ActiveRecord::Migration[4.2] - def change - add_column :container_groups, :container_project_id, :bigint - add_column :container_routes, :container_project_id, :bigint - add_column :container_services, :container_project_id, :bigint - add_column :container_replicators, :container_project_id, :bigint - remove_column :container_groups, :namespace, :string - remove_column :container_services, :namespace, :string - remove_column :container_replicators, :namespace, :string - remove_column :container_routes, :namespace, :string - end -end diff --git a/db/migrate/20150611083448_change_custom_attribute_value_type_to_text.rb b/db/migrate/20150611083448_change_custom_attribute_value_type_to_text.rb deleted file mode 100644 index 1e2efd99f..000000000 --- a/db/migrate/20150611083448_change_custom_attribute_value_type_to_text.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ChangeCustomAttributeValueTypeToText < ActiveRecord::Migration[4.2] - def up - change_column :custom_attributes, :value, :text - end - - def down - change_column :custom_attributes, :value, :string - end -end diff --git a/db/migrate/20150611094050_add_description_and_interpolated_value_to_custom_attribute.rb b/db/migrate/20150611094050_add_description_and_interpolated_value_to_custom_attribute.rb deleted file mode 100644 index 05613d6ea..000000000 --- a/db/migrate/20150611094050_add_description_and_interpolated_value_to_custom_attribute.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddDescriptionAndInterpolatedValueToCustomAttribute < ActiveRecord::Migration[4.2] - def change - add_column :custom_attributes, :description, :text - add_column :custom_attributes, :value_interpolated, :text - end -end diff --git a/db/migrate/20150625220141_fix_serialized_reports_for_rails_four.rb b/db/migrate/20150625220141_fix_serialized_reports_for_rails_four.rb deleted file mode 100644 index a6e371e1d..000000000 --- a/db/migrate/20150625220141_fix_serialized_reports_for_rails_four.rb +++ /dev/null @@ -1,162 +0,0 @@ -class FixSerializedReportsForRailsFour < ActiveRecord::Migration[4.2] - module Serializer - YAML_ATTRS = [:table, :sub_table, :filter_summary, :extras, :ids, :scoped_association, :html_title, :file_name, - :extras, :record_id, :tl_times, :user_categories, :trend_data, :performance, :include_for_find, - :report_run_time, :chart, :reserved] - - def serialize_report_to_hash(val, migration) - if val.include?("!ruby/object:MiqReport") - val.sub!(/MiqReport/, 'Hash') - elsif val.starts_with?('--- !') - migration.say "#{self.class} Id: #{id} is not an MiqReport object, skipping conversion" - return - else - raise "unexpected format of report attribute encountered, '#{val.inspect}'" - end - raw_hash = YAML.load(val) - # MiqReport was serialized as an Array with 1 element in miq_report_results - raw_hash = raw_hash.last if raw_hash.kind_of?(Array) - # - new_hash = YAML_ATTRS.each_with_object(raw_hash['attributes'].to_hash) { |k, h| h[k.to_s] = raw_hash[k.to_s] } - - YAML.dump(new_hash) - end - - def serialize_hash_to_report(val, from, migration) - if val.starts_with?('--- !') - migration.say "#{self.class} Id: #{id} is not a Hash, skipping conversion" - elsif val.starts_with?("---") - new_hash = {'attributes' => {}} - YAML.load(val).each do |k, v| - YAML_ATTRS.include?(k.to_sym) ? new_hash[k.to_s] = v : new_hash['attributes'][k.to_s] = v - end - - if from == :miq_report_result - # MiqReport was serialized as an Array with 1 element in miq_report_results - YAML.dump([new_hash]).sub(/---\n- attributes:/, "---\n- !ruby/object:MiqReport\n attributes:") - else - YAML.dump(new_hash).sub(/---/, "--- !ruby/object:MiqReport") - end - else - raise "unexpected format of report attribute encountered, '#{val.inspect}'" - end - end - end - - class MiqReportResult < ActiveRecord::Base - include Serializer - end - - class BinaryBlobPart < ActiveRecord::Base - def self.default_part_size - @default_part_size ||= 1.megabyte - end - - def inspect - # Clean up inspect so that we don't flood script/console - attrs = attribute_names.inject("{") { |s, n| s << "#{n.inspect}=>#{n == "data" ? "\"...\"" : read_attribute(n).inspect}, "; s } - attrs.chomp!(", ") - attrs << "}" - iv = instance_variables.inject(" ") { |s, v| s << "#{v}=#{v == "@attributes" ? attrs : instance_variable_get(v).inspect}, "; s } - iv.chomp!(", ") - iv.rstrip! - "#{to_s.chop}#{iv}>" - end - - def data - val = read_attribute(:data) - raise "size of #{self.class.name} id [#{id}] is incorrect" unless size.nil? || size == val.bytesize - raise "md5 of #{self.class.name} id [#{id}] is incorrect" unless md5.nil? || md5 == Digest::MD5.hexdigest(val) - val - end - - def data=(val) - raise ArgumentError, "data cannot be set to nil" if val.nil? - write_attribute(:data, val) - self.md5 = Digest::MD5.hexdigest(val) - self.size = val.bytesize - self - end - end - - class BinaryBlob < ActiveRecord::Base - has_many :binary_blob_parts, -> { order(:id) }, :class_name => 'FixSerializedReportsForRailsFour::BinaryBlobPart' - belongs_to :resource, :class_name => 'FixSerializedReportsForRailsFour::MiqReportResult' - - include Serializer - - def delete_binary - self.md5 = self.size = self.part_size = nil - binary_blob_parts.delete_all - self.save! - end - - def binary - data = binary_blob_parts.inject("") do |d, b| - d << b.data - d - end - raise "size of #{self.class.name} id [#{id}] is incorrect" unless size.nil? || size == data.bytesize - raise "md5 of #{self.class.name} id [#{id}] is incorrect" unless md5.nil? || md5 == Digest::MD5.hexdigest(data) - data - end - - def binary=(data) - data.force_encoding('ASCII-8BIT') - delete_binary unless parts == 0 - return self if data.bytesize == 0 - - self.part_size ||= BinaryBlobPart.default_part_size - self.md5 = Digest::MD5.hexdigest(data) - self.size = data.bytesize - - until data.bytesize == 0 - buf = data.slice!(0..self.part_size) - binary_blob_parts << BinaryBlobPart.new(:data => buf) - end - self.save! - - self - end - - def parts - binary_blob_parts.size - end - end - - def up - say_with_time("Converting MiqReportResult#report to a serialized hash") do - MiqReportResult.where('report IS NOT NULL').find_each do |rr| - val = rr.serialize_report_to_hash(rr.read_attribute(:report), self) - rr.update_attribute(:report, val) if val - end - end - - say_with_time("Converting BinaryBlob report results to a serialized hash") do - BinaryBlob.includes(:resource).where(:resource_type => 'MiqReportResult').find_each do |bb| - if bb.resource - val = bb.serialize_report_to_hash(bb.binary, self) - bb.binary = val if val - end - end - end - end - - def down - say_with_time("Converting MiqReportResult#report back to a serialized MiqReport") do - MiqReportResult.where('report IS NOT NULL').find_each do |rr| - val = rr.serialize_hash_to_report(rr.read_attribute(:report), :miq_report_result, self) - rr.update_attribute(:report, val) if val - end - end - - say_with_time("Converting BinaryBlob report results back to a serialized MiqReport") do - BinaryBlob.includes(:resource).where(:resource_type => 'MiqReportResult').find_each do |bb| - if bb.resource - val = bb.serialize_hash_to_report(bb.binary, :binary_blob, self) - bb.binary = val if val - end - end - end - end -end diff --git a/db/migrate/20150630025128_create_tenant.rb b/db/migrate/20150630025128_create_tenant.rb deleted file mode 100644 index c09ef73d1..000000000 --- a/db/migrate/20150630025128_create_tenant.rb +++ /dev/null @@ -1,23 +0,0 @@ -class CreateTenant < ActiveRecord::Migration[4.2] - def change - create_table :tenants do |t| - t.string :domain - t.string :subdomain - t.string :company_name - t.string :appliance_name - - t.string :login_text - t.string :logo_file_name - t.string :logo_content_type - t.integer :logo_file_size - t.datetime :logo_updated_at - t.string :login_logo_file_name - t.string :login_logo_content_type - t.integer :login_logo_file_size - t.datetime :login_logo_updated_at - end - - add_index :tenants, :domain - add_index :tenants, :subdomain - end -end diff --git a/db/migrate/20150630100251_namespace_ems_amazon.rb b/db/migrate/20150630100251_namespace_ems_amazon.rb deleted file mode 100644 index 42ee86e7b..000000000 --- a/db/migrate/20150630100251_namespace_ems_amazon.rb +++ /dev/null @@ -1,31 +0,0 @@ -class NamespaceEmsAmazon < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - AuthKeyPairCloud ManageIQ::Providers::CloudManager::AuthKeyPair - - EmsAmazon ManageIQ::Providers::Amazon::CloudManager - AvailabilityZoneAmazon ManageIQ::Providers::Amazon::CloudManager::AvailabilityZone - CloudVolumeAmazon ManageIQ::Providers::Amazon::CloudManager::CloudVolume - CloudVolumeSnapshotAmazon ManageIQ::Providers::Amazon::CloudManager::CloudVolumeSnapshot - MiqEventCatcherAmazon ManageIQ::Providers::Amazon::CloudManager::EventCatcher - EventCatcherAmazon ManageIQ::Providers::Amazon::CloudManager::EventCatcher::Runner - FlavorAmazon ManageIQ::Providers::Amazon::CloudManager::Flavor - FloatingIpAmazon ManageIQ::Providers::Amazon::CloudManager::FloatingIp - MiqEmsMetricsCollectorWorkerAmazon ManageIQ::Providers::Amazon::CloudManager::MetricsCollectorWorker - EmsMetricsCollectorWorkerAmazon ManageIQ::Providers::Amazon::CloudManager::MetricsCollectorWorker::Runner - OrchestrationStackAmazon ManageIQ::Providers::Amazon::CloudManager::OrchestrationStack - MiqEmsRefreshWorkerAmazon ManageIQ::Providers::Amazon::CloudManager::RefreshWorker - EmsRefreshWorkerAmazon ManageIQ::Providers::Amazon::CloudManager::RefreshWorker::Runner - SecurityGroupAmazon ManageIQ::Providers::Amazon::CloudManager::SecurityGroup - TemplateAmazon ManageIQ::Providers::Amazon::CloudManager::Template - VmAmazon ManageIQ::Providers::Amazon::CloudManager::Vm - - ServiceOrchestration::OptionConverterAmazon - ManageIQ::Providers::Amazon::CloudManager::OrchestrationServiceOptionConverter - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150701142710_associate_tenant_vm.rb b/db/migrate/20150701142710_associate_tenant_vm.rb deleted file mode 100644 index 28ca90374..000000000 --- a/db/migrate/20150701142710_associate_tenant_vm.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AssociateTenantVm < ActiveRecord::Migration[4.2] - def change - add_column :providers, :tenant_owner_id, :bigint - add_column :vms, :tenant_owner_id, :bigint - add_column :ext_management_systems, :tenant_owner_id, :bigint - add_column :miq_groups, :tenant_owner_id, :bigint - end -end diff --git a/db/migrate/20150701191241_add_shared_to_cloud_network.rb b/db/migrate/20150701191241_add_shared_to_cloud_network.rb deleted file mode 100644 index ff235d4dd..000000000 --- a/db/migrate/20150701191241_add_shared_to_cloud_network.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSharedToCloudNetwork < ActiveRecord::Migration[4.2] - def change - add_column :cloud_networks, :shared, :boolean - end -end diff --git a/db/migrate/20150708120923_create_tenant_resources.rb b/db/migrate/20150708120923_create_tenant_resources.rb deleted file mode 100644 index a9d24a360..000000000 --- a/db/migrate/20150708120923_create_tenant_resources.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTenantResources < ActiveRecord::Migration[4.2] - def change - create_table :tenant_resources do |t| - t.belongs_to :tenant, :type => :bigint - t.belongs_to :resource, :type => :bigint, :polymorphic => true - end - end -end diff --git a/db/migrate/20150710081302_create_network_ports_and_routers.rb b/db/migrate/20150710081302_create_network_ports_and_routers.rb deleted file mode 100644 index 51ede46aa..000000000 --- a/db/migrate/20150710081302_create_network_ports_and_routers.rb +++ /dev/null @@ -1,52 +0,0 @@ -class CreateNetworkPortsAndRouters < ActiveRecord::Migration[4.2] - def change - create_table :network_ports do |t| - t.string :type - t.string :name - t.string :ems_ref - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_network, :type => :bigint - t.belongs_to :cloud_subnet, :type => :bigint - t.string :mac_address - t.string :status - t.boolean :admin_state_up - t.string :device_owner - t.string :device_ref - t.integer :device_id, :type => :bigint - t.string :device_type - t.belongs_to :cloud_tenant, :type => :bigint - t.string :binding_host_id - t.string :binding_virtual_interface_type - t.text :extra_attributes - end - - add_index :network_ports, :ems_id - add_index :network_ports, :cloud_network_id - add_index :network_ports, :cloud_subnet_id - add_index :network_ports, [:device_id, :device_type] - add_index :network_ports, :cloud_tenant_id - - create_table :network_ports_security_groups, :id => false do |t| - t.belongs_to :network_port, :type => :bigint - t.belongs_to :security_group, :type => :bigint - end - - add_index :network_ports_security_groups, [:network_port_id, :security_group_id], :unique => true, :name => "index_network_ports_security_groups" - - create_table :network_routers do |t| - t.string :type - t.string :name - t.string :ems_ref - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_network, :type => :bigint - t.string :admin_state_up - t.belongs_to :cloud_tenant, :type => :bigint - t.string :status - t.text :extra_attributes - end - - add_index :network_routers, :ems_id - add_index :network_routers, :cloud_tenant_id - add_index :network_routers, :cloud_network_id - end -end diff --git a/db/migrate/20150710110003_add_missing_fields_and_indexes_to_floating_ips.rb b/db/migrate/20150710110003_add_missing_fields_and_indexes_to_floating_ips.rb deleted file mode 100644 index 68aff70e0..000000000 --- a/db/migrate/20150710110003_add_missing_fields_and_indexes_to_floating_ips.rb +++ /dev/null @@ -1,14 +0,0 @@ -class AddMissingFieldsAndIndexesToFloatingIps < ActiveRecord::Migration[4.2] - def change - add_column :floating_ips, :network_router_id, :bigint - add_column :floating_ips, :network_port_id, :bigint - add_column :floating_ips, :cloud_network_id, :bigint - add_column :floating_ips, :fixed_ip_address, :string - - add_index :floating_ips, :ems_id - add_index :floating_ips, :cloud_tenant_id - add_index :floating_ips, :network_router_id - add_index :floating_ips, :network_port_id - add_index :floating_ips, :cloud_network_id - end -end diff --git a/db/migrate/20150710110243_add_missing_fields_and_indexes_to_cloud_networks.rb b/db/migrate/20150710110243_add_missing_fields_and_indexes_to_cloud_networks.rb deleted file mode 100644 index 5606210d2..000000000 --- a/db/migrate/20150710110243_add_missing_fields_and_indexes_to_cloud_networks.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddMissingFieldsAndIndexesToCloudNetworks < ActiveRecord::Migration[4.2] - def change - add_column :cloud_networks, :provider_physical_network, :string - add_column :cloud_networks, :provider_network_type, :string - add_column :cloud_networks, :provider_segmentation_id, :string - add_column :cloud_networks, :vlan_transparent, :boolean - add_column :cloud_networks, :extra_attributes, :text - - add_index :cloud_networks, :ems_id - add_index :cloud_networks, :cloud_tenant_id - end -end diff --git a/db/migrate/20150710110244_add_sti_to_cloud_networks.rb b/db/migrate/20150710110244_add_sti_to_cloud_networks.rb deleted file mode 100644 index 757c4bb13..000000000 --- a/db/migrate/20150710110244_add_sti_to_cloud_networks.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStiToCloudNetworks < ActiveRecord::Migration[4.2] - def change - add_column :cloud_networks, :type, :string - end -end diff --git a/db/migrate/20150710110707_add_missing_fields_and_indexes_to_cloud_subnets.rb b/db/migrate/20150710110707_add_missing_fields_and_indexes_to_cloud_subnets.rb deleted file mode 100644 index 8fb0e27ff..000000000 --- a/db/migrate/20150710110707_add_missing_fields_and_indexes_to_cloud_subnets.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddMissingFieldsAndIndexesToCloudSubnets < ActiveRecord::Migration[4.2] - def change - add_column :cloud_subnets, :cloud_tenant_id, :bigint - add_column :cloud_subnets, :dns_nameservers, :string - add_column :cloud_subnets, :ipv6_router_advertisement_mode, :string - add_column :cloud_subnets, :ipv6_address_mode, :string - add_column :cloud_subnets, :extra_attributes, :text - - add_index :cloud_subnets, :ems_id - add_index :cloud_subnets, :cloud_tenant_id - add_index :cloud_subnets, :cloud_network_id - end -end diff --git a/db/migrate/20150710110708_add_sti_to_cloud_subnets.rb b/db/migrate/20150710110708_add_sti_to_cloud_subnets.rb deleted file mode 100644 index a895f913d..000000000 --- a/db/migrate/20150710110708_add_sti_to_cloud_subnets.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStiToCloudSubnets < ActiveRecord::Migration[4.2] - def change - add_column :cloud_subnets, :type, :string - end -end diff --git a/db/migrate/20150710120646_add_missing_fields_and_indexes_to_security_groups.rb b/db/migrate/20150710120646_add_missing_fields_and_indexes_to_security_groups.rb deleted file mode 100644 index 1f789c99b..000000000 --- a/db/migrate/20150710120646_add_missing_fields_and_indexes_to_security_groups.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddMissingFieldsAndIndexesToSecurityGroups < ActiveRecord::Migration[4.2] - def change - add_index :security_groups, :ems_id - add_index :security_groups, :cloud_tenant_id - add_index :security_groups, :cloud_network_id - add_index :security_groups, :orchestration_stack_id - end -end diff --git a/db/migrate/20150714042229_add_routes_to_services.rb b/db/migrate/20150714042229_add_routes_to_services.rb deleted file mode 100644 index 2c608a6f3..000000000 --- a/db/migrate/20150714042229_add_routes_to_services.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddRoutesToServices < ActiveRecord::Migration[4.2] - def change - add_column :container_routes, :container_service_id, :bigint - remove_column :container_routes, :service_name, :string - end -end diff --git a/db/migrate/20150714053019_namespace_ems_redhat.rb b/db/migrate/20150714053019_namespace_ems_redhat.rb deleted file mode 100644 index 849d6746d..000000000 --- a/db/migrate/20150714053019_namespace_ems_redhat.rb +++ /dev/null @@ -1,26 +0,0 @@ -class NamespaceEmsRedhat < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - EmsRedhat ManageIQ::Providers::Redhat::CloudManager - AvailabilityZoneRedhat ManageIQ::Providers::Redhat::CloudManager::AvailabilityZone - CloudVolumeRedhat ManageIQ::Providers::Redhat::CloudManager::CloudVolume - CloudVolumeSnapshotRedhat ManageIQ::Providers::Redhat::CloudManager::CloudVolumeSnapshot - MiqEventCatcherRedhat ManageIQ::Providers::Redhat::CloudManager::EventCatcher - EventCatcherRedhat ManageIQ::Providers::Redhat::CloudManager::EventCatcher::Runner - FlavorRedhat ManageIQ::Providers::Redhat::CloudManager::Flavor - FloatingIpRedhat ManageIQ::Providers::Redhat::CloudManager::FloatingIp - MiqEmsMetricsCollectorWorkerRedhat ManageIQ::Providers::Redhat::CloudManager::MetricsCollectorWorker - EmsMetricsCollectorWorkerRedhat ManageIQ::Providers::Redhat::CloudManager::MetricsCollectorWorker::Runner - OrchestrationStackRedhat ManageIQ::Providers::Redhat::CloudManager::OrchestrationStack - MiqEmsRefreshWorkerRedhat ManageIQ::Providers::Redhat::CloudManager::RefreshWorker - EmsRefreshWorkerRedhat ManageIQ::Providers::Redhat::CloudManager::RefreshWorker::Runner - SecurityGroupRedhat ManageIQ::Providers::Redhat::CloudManager::SecurityGroup - TemplateRedhat ManageIQ::Providers::Redhat::CloudManager::Template - VmRedhat ManageIQ::Providers::Redhat::CloudManager::Vm - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150714143821_remove_ui_tasks_and_ui_task_sets.rb b/db/migrate/20150714143821_remove_ui_tasks_and_ui_task_sets.rb deleted file mode 100644 index cd4d829be..000000000 --- a/db/migrate/20150714143821_remove_ui_tasks_and_ui_task_sets.rb +++ /dev/null @@ -1,40 +0,0 @@ -class RemoveUiTasksAndUiTaskSets < ActiveRecord::Migration[4.2] - class MiqSet < ActiveRecord::Base; end - - class Relationship < ActiveRecord::Base; end - - def up - remove_index :ui_tasks, [:area, :typ, :task] - drop_table :ui_tasks - - remove_index :users, :ui_task_set_id - remove_column :users, :ui_task_set_id - - remove_index :miq_groups, :ui_task_set_id - remove_column :miq_groups, :ui_task_set_id - - say_with_time "Removing UiTaskSets" do - MiqSet.where(:set_type => "UiTaskSet").delete_all - Relationship.where(:resource_type => ["UiTask", "UiTaskSet"]).delete_all - end - end - - def down - create_table :ui_tasks do |t| - t.string :name - t.string :area - t.string :typ - t.string :task - t.datetime :created_on - t.datetime :updated_on - end - - add_index :ui_tasks, [:area, :typ, :task] - - add_column :users, :ui_task_set_id, :bigint - add_index :users, :ui_task_set_id - - add_column :miq_groups, :ui_task_set_id, :bigint - add_index :miq_groups, :ui_task_set_id - end -end diff --git a/db/migrate/20150716021334_fix_redhat_namespace.rb b/db/migrate/20150716021334_fix_redhat_namespace.rb deleted file mode 100644 index aca057376..000000000 --- a/db/migrate/20150716021334_fix_redhat_namespace.rb +++ /dev/null @@ -1,30 +0,0 @@ -class FixRedhatNamespace < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - ManageIQ::Providers::Redhat::CloudManager - ManageIQ::Providers::Redhat::InfraManager - ManageIQ::Providers::Redhat::CloudManager::EventCatcher - ManageIQ::Providers::Redhat::InfraManager::EventCatcher - ManageIQ::Providers::Redhat::CloudManager::EventCatcher::Runner - ManageIQ::Providers::Redhat::InfraManager::EventCatcher::Runner - ManageIQ::Providers::Redhat::CloudManager::MetricsCollectorWorker - ManageIQ::Providers::Redhat::InfraManager::MetricsCollectorWorker - ManageIQ::Providers::Redhat::CloudManager::MetricsCollectorWorker::Runner - ManageIQ::Providers::Redhat::InfraManager::MetricsCollectorWorker::Runner - ManageIQ::Providers::Redhat::CloudManager::RefreshWorker - ManageIQ::Providers::Redhat::InfraManager::RefreshWorker - ManageIQ::Providers::Redhat::CloudManager::RefreshWorker::Runner - ManageIQ::Providers::Redhat::InfraManager::RefreshWorker::Runner - ManageIQ::Providers::Redhat::CloudManager::Template - ManageIQ::Providers::Redhat::InfraManager::Template - ManageIQ::Providers::Redhat::CloudManager::Vm - ManageIQ::Providers::Redhat::InfraManager::Vm - - HostRedhat ManageIQ::Providers::Redhat::InfraManager::Host - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150719123908_add_container_state.rb b/db/migrate/20150719123908_add_container_state.rb deleted file mode 100644 index df78161bf..000000000 --- a/db/migrate/20150719123908_add_container_state.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AddContainerState < ActiveRecord::Migration[4.2] - def change - add_column :containers, :reason, :string - add_column :containers, :started_at, :datetime - add_column :containers, :finished_at, :datetime - add_column :containers, :exit_code, :integer - add_column :containers, :signal, :integer - add_column :containers, :message, :string - add_column :containers, :last_state, :string - add_column :containers, :last_reason, :string - add_column :containers, :last_started_at, :datetime - add_column :containers, :last_finished_at, :datetime - add_column :containers, :last_exit_code, :integer - add_column :containers, :last_signal, :integer - add_column :containers, :last_message, :string - end -end diff --git a/db/migrate/20150724030353_namespace_ems_foreman.rb b/db/migrate/20150724030353_namespace_ems_foreman.rb deleted file mode 100644 index aa5ea0139..000000000 --- a/db/migrate/20150724030353_namespace_ems_foreman.rb +++ /dev/null @@ -1,20 +0,0 @@ -class NamespaceEmsForeman < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - ConfigurationManager ManageIQ::Providers::ConfigurationManager - ProvisioningManager ManageIQ::Providers::ProvisioningManager - - ProviderForeman ManageIQ::Providers::Foreman::Provider - ConfigurationManagerForeman ManageIQ::Providers::Foreman::ConfigurationManager - ConfigurationProfileForeman ManageIQ::Providers::Foreman::ConfigurationManager::ConfigurationProfile - ConfiguredSystemForeman ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem - MiqProvisionConfiguredSystemForemanWorkflow ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow - MiqProvisionTaskConfiguredSystemForeman ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionTask - ProvisioningManagerForeman ManageIQ::Providers::Foreman::ProvisioningManager - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150726144643_remove_container_group_id_from_containers.rb b/db/migrate/20150726144643_remove_container_group_id_from_containers.rb deleted file mode 100644 index b220b14e4..000000000 --- a/db/migrate/20150726144643_remove_container_group_id_from_containers.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveContainerGroupIdFromContainers < ActiveRecord::Migration[4.2] - def change - remove_column :containers, :container_group_id, :bigint - end -end diff --git a/db/migrate/20150730135121_add_container_group_phase.rb b/db/migrate/20150730135121_add_container_group_phase.rb deleted file mode 100644 index dbb951ff1..000000000 --- a/db/migrate/20150730135121_add_container_group_phase.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddContainerGroupPhase < ActiveRecord::Migration[4.2] - def change - add_column :container_groups, :phase, :string - add_column :container_groups, :message, :string - add_column :container_groups, :reason, :string - end -end diff --git a/db/migrate/20150731025210_namespace_ems_openstack.rb b/db/migrate/20150731025210_namespace_ems_openstack.rb deleted file mode 100644 index f32a7b188..000000000 --- a/db/migrate/20150731025210_namespace_ems_openstack.rb +++ /dev/null @@ -1,47 +0,0 @@ -class NamespaceEmsOpenstack < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - ProviderOpenstack ManageIQ::Providers::Openstack::Provider - - EmsOpenstack ManageIQ::Providers::Openstack::CloudManager - AuthKeyPairOpenstack ManageIQ::Providers::Openstack::CloudManager::AuthKeyPair - AvailabilityZoneOpenstack ManageIQ::Providers::Openstack::CloudManager::AvailabilityZone - CloudResourceQuotaOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudResourceQuota - CloudTenantOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudTenant - CloudVolumeOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudVolume - CloudVolumeSnapshotOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudVolumeSnapshot - MiqEventCatcherOpenstack ManageIQ::Providers::Openstack::CloudManager::EventCatcher - EventCatcherOpenstack ManageIQ::Providers::Openstack::CloudManager::EventCatcher::Runner - FlavorOpenstack ManageIQ::Providers::Openstack::CloudManager::Flavor - FloatingIpOpenstack ManageIQ::Providers::Openstack::CloudManager::FloatingIp - MiqEmsMetricsCollectorWorkerOpenstack ManageIQ::Providers::Openstack::CloudManager::MetricsCollectorWorker - EmsMetricsCollectorWorkerOpenstack ManageIQ::Providers::Openstack::CloudManager::MetricsCollectorWorker::Runner - OrchestrationStackOpenstack ManageIQ::Providers::Openstack::CloudManager::OrchestrationStack - MiqEmsRefreshWorkerOpenstack ManageIQ::Providers::Openstack::CloudManager::RefreshWorker - EmsRefreshWorkerOpenstack ManageIQ::Providers::Openstack::CloudManager::RefreshWorker::Runner - SecurityGroupOpenstack ManageIQ::Providers::Openstack::CloudManager::SecurityGroup - TemplateOpenstack ManageIQ::Providers::Openstack::CloudManager::Template - VmOpenstack ManageIQ::Providers::Openstack::CloudManager::Vm - - ServiceOrchestration::OptionConverterOpenstack - ManageIQ::Providers::Openstack::CloudManager::OrchestrationServiceOptionConverter - - EmsOpenstackInfra ManageIQ::Providers::Openstack::InfraManager - AuthKeyPairOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::AuthKeyPair - EmsClusterOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::EmsCluster - MiqEventCatcherOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::EventCatcher - EventCatcherOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::EventCatcher::Runner - HostOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::Host - HostServiceGroupOpenstack ManageIQ::Providers::Openstack::InfraManager::HostServiceGroup - MiqEmsMetricsCollectorWorkerOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::MetricsCollectorWorker - EmsMetricsCollectorWorkerOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::MetricsCollectorWorker::Runner - OrchestrationStackOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::OrchestrationStack - MiqEmsRefreshWorkerOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::RefreshWorker - EmsRefreshWorkerOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::RefreshWorker::Runner - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150804194147_create_blacklisted_events.rb b/db/migrate/20150804194147_create_blacklisted_events.rb deleted file mode 100644 index 3594ab4ec..000000000 --- a/db/migrate/20150804194147_create_blacklisted_events.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateBlacklistedEvents < ActiveRecord::Migration[4.2] - def change - create_table :blacklisted_events do |t| - t.string :event_name - t.string :provider_model - t.bigint :ems_id - t.boolean :system - t.boolean :enabled - t.timestamps :null => true - end - end -end diff --git a/db/migrate/20150806190149_rename_miq_event_table_to_miq_event_definition.rb b/db/migrate/20150806190149_rename_miq_event_table_to_miq_event_definition.rb deleted file mode 100644 index 357c90273..000000000 --- a/db/migrate/20150806190149_rename_miq_event_table_to_miq_event_definition.rb +++ /dev/null @@ -1,43 +0,0 @@ -class RenameMiqEventTableToMiqEventDefinition < ActiveRecord::Migration[4.2] - include MigrationHelper - - class MiqSet < ActiveRecord::Base; end - - class Relationship < ActiveRecord::Base; end - - class MiqEvent < ActiveRecord::Base; end - - class MiqEventDefinition < ActiveRecord::Base; end - - def up - rename_table :miq_events, :miq_event_definitions - - say_with_time("Renaming MiqEventSet to MiqEventDefinitionSet in 'miq_sets'") do - MiqSet.where(:set_type => 'MiqEventSet').update_all(:set_type => 'MiqEventDefinitionSet') - end - - say_with_time("Renaming MiqEventSet to MiqEventDefinitionSet in 'relationships'") do - Relationship.where(:resource_type => 'MiqEventSet').update_all(:resource_type => "MiqEventDefinitionSet") - end - - say_with_time("Renaming MiqEvent to MiqEventDefinition in 'relationships'") do - Relationship.where(:resource_type => 'MiqEvent').update_all(:resource_type => "MiqEventDefinition") - end - end - - def down - rename_table :miq_event_definitions, :miq_events - - say_with_time("Renaming MiqEventDefinitionSet to MiqEventSet in 'miq_sets'") do - MiqSet.where(:set_type => 'MiqEventDefinitionSet').update_all(:set_type => 'MiqEventSet') - end - - say_with_time("Renaming MiqEventDefinitionSet to MiqEventSet in 'relationships'") do - Relationship.where(:resource_type => 'MiqEventDefinitionSet').update_all(:resource_type => "MiqEventSet") - end - - say_with_time("Renaming MiqEventDefinition to MiqEvent in 'relationships'") do - Relationship.where(:resource_type => 'MiqEventDefinition').update_all(:resource_type => "MiqEvent") - end - end -end diff --git a/db/migrate/20150806190349_rename_columns_starting_with_miq_event.rb b/db/migrate/20150806190349_rename_columns_starting_with_miq_event.rb deleted file mode 100644 index 2d55485ab..000000000 --- a/db/migrate/20150806190349_rename_columns_starting_with_miq_event.rb +++ /dev/null @@ -1,7 +0,0 @@ -class RenameColumnsStartingWithMiqEvent < ActiveRecord::Migration[4.2] - def change - rename_column :miq_policy_contents, :miq_event_id, :miq_event_definition_id - rename_column :policy_events, :miq_event_id, :miq_event_definition_id - rename_column :policy_events, :miq_event_description, :miq_event_definition_description - end -end diff --git a/db/migrate/20150806194147_migrate_filtered_events_to_blacklisted_events.rb b/db/migrate/20150806194147_migrate_filtered_events_to_blacklisted_events.rb deleted file mode 100644 index 7af63ef2f..000000000 --- a/db/migrate/20150806194147_migrate_filtered_events_to_blacklisted_events.rb +++ /dev/null @@ -1,68 +0,0 @@ -class MigrateFilteredEventsToBlacklistedEvents < ActiveRecord::Migration[4.2] - class Configuration < ActiveRecord::Base - serialize :settings - end - - class BlacklistedEvent < ActiveRecord::Base; end - - def up - say_with_time('Migrating filtered events from Configuration to BlacklistedEvent') do - events = [] - Configuration.where(:typ => 'event_handling').each do |config| - filtered_events = config.settings.fetch_path('filtered_events') - next unless filtered_events - - events << filtered_events.each_with_object([]) { |(k, v), ary| ary << k.to_s if v.nil? } - - config.settings.delete_path('filtered_events') - config.save - end - - user_adds = events.flatten.uniq - default_blacklisted_event_names - user_adds.each do |e| - BlacklistedEvent.create!(PROVIDER_NAMES.collect { |p| {:event_name => e, :provider_model => p} }) - end - end - end - - private - - PROVIDER_NAMES = %w( - ManageIQ::Providers::Openstack::CloudManager - ManageIQ::Providers::Amazon::CloudManager - ManageIQ::Providers::Redhat::InfraManager - ManageIQ::Providers::Vmware::InfraManager - ) - - def default_blacklisted_event_names - %w( - scheduler.run_instance.start - scheduler.run_instance.scheduled - scheduler.run_instance.end - ConfigurationSnapshotDeliveryCompleted - ConfigurationSnapshotDeliveryStarted - ConfigurationSnapshotDeliveryFailed - UNASSIGNED - USER_REMOVE_VG - USER_REMOVE_VG_FAILED - USER_VDC_LOGIN - USER_VDC_LOGOUT - USER_VDC_LOGIN_FAILED - AlarmActionTriggeredEvent - AlarmCreatedEvent - AlarmEmailCompletedEvent - AlarmEmailFailedEvent - AlarmReconfiguredEvent - AlarmRemovedEvent - AlarmScriptCompleteEvent - AlarmScriptFailedEvent - AlarmSnmpCompletedEvent - AlarmSnmpFailedEvent - AlarmStatusChangedEvent - AlreadyAuthenticatedSessionEvent - EventEx - UserLoginSessionEvent - UserLogoutSessionEvent - ) - end -end diff --git a/db/migrate/20150806211453_rename_ems_event_table_to_event_stream.rb b/db/migrate/20150806211453_rename_ems_event_table_to_event_stream.rb deleted file mode 100644 index 8c0e31685..000000000 --- a/db/migrate/20150806211453_rename_ems_event_table_to_event_stream.rb +++ /dev/null @@ -1,42 +0,0 @@ -class RenameEmsEventTableToEventStream < ActiveRecord::Migration[4.2] - disable_ddl_transaction! - include MigrationHelper - - BATCH_SIZE = 25_000 - - class EventStream < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class EmsEvent < ActiveRecord::Base; end - - def up - rename_table :ems_events, :event_streams - - add_column :event_streams, :type, :string - say_with_time("Updating Type in EventStreams") do - base_relation = EventStream.where(:type => nil) - say_batch_started(base_relation.size) - - loop do - count = base_relation.limit(BATCH_SIZE).update_all(:type => 'EmsEvent') - break if count == 0 - say_batch_processed(count) - end - end - - change_table :event_streams do |t| - t.references :target, :polymorphic => true, :type => :bigint - end - end - - def down - remove_column :event_streams, :type - - change_table :event_streams do |t| - t.remove_references :target, :polymorphic => true - end - - rename_table :event_streams, :ems_events - end -end diff --git a/db/migrate/20150807165254_namespace_ems_container.rb b/db/migrate/20150807165254_namespace_ems_container.rb deleted file mode 100644 index f1e8971d3..000000000 --- a/db/migrate/20150807165254_namespace_ems_container.rb +++ /dev/null @@ -1,24 +0,0 @@ -class NamespaceEmsContainer < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - EmsKubernetes ManageIQ::Providers::Kubernetes::ContainerManager - ContainerKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::Container - ContainerGroupKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::ContainerGroup - ContainerNodeKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::ContainerNode - MiqEventCatcherKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::EventCatcher - EventCatcherKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::EventCatcher::Runner - MiqEmsRefreshWorkerKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::RefreshWorker - EmsRefreshWorkerKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::RefreshWorker::Runner - - EmsOpenshift ManageIQ::Providers::Openshift::ContainerManager - MiqEventCatcherOpenshift ManageIQ::Providers::Openshift::ContainerManager::EventCatcher - EventCatcherOpenshift ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner - MiqEmsRefreshWorkerOpenshift ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker - EmsRefreshWorkerOpenshift ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker::Runner - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150810015500_add_tenant_hierarchy.rb b/db/migrate/20150810015500_add_tenant_hierarchy.rb deleted file mode 100644 index 60bffe6ea..000000000 --- a/db/migrate/20150810015500_add_tenant_hierarchy.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddTenantHierarchy < ActiveRecord::Migration[4.2] - def change - add_column :tenants, :ancestry, :string - add_index :tenants, :ancestry - end -end diff --git a/db/migrate/20150813115025_create_container_resource_quota.rb b/db/migrate/20150813115025_create_container_resource_quota.rb deleted file mode 100644 index ffa424e12..000000000 --- a/db/migrate/20150813115025_create_container_resource_quota.rb +++ /dev/null @@ -1,20 +0,0 @@ -class CreateContainerResourceQuota < ActiveRecord::Migration[4.2] - def change - create_table :container_quotas do |t| - t.string :name - t.datetime :creation_timestamp - t.string :resource_version - t.string :ems_ref - t.belongs_to :container_project, :type => :bigint - t.belongs_to :ems, :type => :bigint - end - - create_table :container_quota_items do |t| - t.string :resource - t.string :quota_desired - t.string :quota_enforced - t.string :quota_observed - t.belongs_to :container_quota, :type => :bigint - end - end -end diff --git a/db/migrate/20150814210507_rename_tenant_company_name.rb b/db/migrate/20150814210507_rename_tenant_company_name.rb deleted file mode 100644 index e59127ed4..000000000 --- a/db/migrate/20150814210507_rename_tenant_company_name.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RenameTenantCompanyName < ActiveRecord::Migration[4.2] - def change - rename_column :tenants, :company_name, :name - end -end diff --git a/db/migrate/20150815051916_namespace_ems_microsoft.rb b/db/migrate/20150815051916_namespace_ems_microsoft.rb deleted file mode 100644 index 03349d52d..000000000 --- a/db/migrate/20150815051916_namespace_ems_microsoft.rb +++ /dev/null @@ -1,16 +0,0 @@ -class NamespaceEmsMicrosoft < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - EmsMicrosoft ManageIQ::Providers::Microsoft::InfraManager - HostMicrosoft ManageIQ::Providers::Microsoft::InfraManager::Host - MiqEmsRefreshWorkerMicrosoft ManageIQ::Providers::Microsoft::InfraManager::RefreshWorker - EmsRefreshWorkerMicrosoft ManageIQ::Providers::Microsoft::InfraManager::RefreshWorker::Runner - TemplateMicrosoft ManageIQ::Providers::Microsoft::InfraManager::Template - VmMicrosoft ManageIQ::Providers::Microsoft::InfraManager::Vm - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150815052719_fix_foreman_provider_type.rb b/db/migrate/20150815052719_fix_foreman_provider_type.rb deleted file mode 100644 index 3870a2c0b..000000000 --- a/db/migrate/20150815052719_fix_foreman_provider_type.rb +++ /dev/null @@ -1,11 +0,0 @@ -class FixForemanProviderType < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - ProviderForeman ManageIQ::Providers::Foreman::Provider - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150817213409_clear_tenant_seed.rb b/db/migrate/20150817213409_clear_tenant_seed.rb deleted file mode 100644 index f399eb735..000000000 --- a/db/migrate/20150817213409_clear_tenant_seed.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ClearTenantSeed < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base; end - - def up - say_with_time("Setting root tenant to default to settings") do - Tenant.update_all(:name => nil) - end - end -end diff --git a/db/migrate/20150818181426_add_divisible_to_tenants.rb b/db/migrate/20150818181426_add_divisible_to_tenants.rb deleted file mode 100644 index b89fb785f..000000000 --- a/db/migrate/20150818181426_add_divisible_to_tenants.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDivisibleToTenants < ActiveRecord::Migration[4.2] - def change - add_column :tenants, :divisible, :boolean - end -end diff --git a/db/migrate/20150818181427_update_tenant_divisible_on_existing_rows.rb b/db/migrate/20150818181427_update_tenant_divisible_on_existing_rows.rb deleted file mode 100644 index 2420cf67d..000000000 --- a/db/migrate/20150818181427_update_tenant_divisible_on_existing_rows.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UpdateTenantDivisibleOnExistingRows < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base; end - - def up - say_with_time("marking root tenant divisible") do - Tenant.where(:divisible => nil).update_all(:divisible => true) - end - end -end diff --git a/db/migrate/20150818184658_create_tenant_quota.rb b/db/migrate/20150818184658_create_tenant_quota.rb deleted file mode 100644 index 3207d25df..000000000 --- a/db/migrate/20150818184658_create_tenant_quota.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateTenantQuota < ActiveRecord::Migration[4.2] - def change - create_table :tenant_quotas do |t| - t.belongs_to :tenant, :type => :bigint - - t.string :name - t.string :unit - t.float :value - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20150819121823_drop_tenant_resources.rb b/db/migrate/20150819121823_drop_tenant_resources.rb deleted file mode 100644 index 9f58a199b..000000000 --- a/db/migrate/20150819121823_drop_tenant_resources.rb +++ /dev/null @@ -1,12 +0,0 @@ -class DropTenantResources < ActiveRecord::Migration[4.2] - def up - drop_table :tenant_resources - end - - def down - create_table :tenant_resources do |t| - t.belongs_to :tenant, :type => :bigint - t.belongs_to :resource, :type => :bigint, :polymorphic => true - end - end -end diff --git a/db/migrate/20150819125202_add_tenant_description.rb b/db/migrate/20150819125202_add_tenant_description.rb deleted file mode 100644 index bb74291ce..000000000 --- a/db/migrate/20150819125202_add_tenant_description.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddTenantDescription < ActiveRecord::Migration[4.2] - def change - add_column :tenants, :description, :text - end -end diff --git a/db/migrate/20150819144149_add_container_entity_events.rb b/db/migrate/20150819144149_add_container_entity_events.rb deleted file mode 100644 index bb637916c..000000000 --- a/db/migrate/20150819144149_add_container_entity_events.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddContainerEntityEvents < ActiveRecord::Migration[4.2] - def change - add_column :event_streams, :container_id, :bigint - add_column :event_streams, :container_name, :string - end -end diff --git a/db/migrate/20150819154348_drop_tenant_appliance_name.rb b/db/migrate/20150819154348_drop_tenant_appliance_name.rb deleted file mode 100644 index 4ce49d970..000000000 --- a/db/migrate/20150819154348_drop_tenant_appliance_name.rb +++ /dev/null @@ -1,9 +0,0 @@ -class DropTenantApplianceName < ActiveRecord::Migration[4.2] - def up - remove_column :tenants, :appliance_name - end - - def down - add_column :tenants, :appliance_name, :string - end -end diff --git a/db/migrate/20150820110215_create_container_limit_range.rb b/db/migrate/20150820110215_create_container_limit_range.rb deleted file mode 100644 index e3a214f42..000000000 --- a/db/migrate/20150820110215_create_container_limit_range.rb +++ /dev/null @@ -1,23 +0,0 @@ -class CreateContainerLimitRange < ActiveRecord::Migration[4.2] - def change - create_table :container_limits do |t| - t.string :name - t.datetime :creation_timestamp - t.string :resource_version - t.string :ems_ref - t.belongs_to :container_project, :type => :bigint - t.belongs_to :ems, :type => :bigint - end - - create_table :container_limit_items do |t| - t.string :item_type - t.string :resource - t.string :max - t.string :min - t.string :default - t.string :default_request - t.string :max_limit_request_ratio - t.belongs_to :container_limit, :type => :bigint - end - end -end diff --git a/db/migrate/20150822102141_fix_more_foreman_types.rb b/db/migrate/20150822102141_fix_more_foreman_types.rb deleted file mode 100644 index 88fb50899..000000000 --- a/db/migrate/20150822102141_fix_more_foreman_types.rb +++ /dev/null @@ -1,12 +0,0 @@ -class FixMoreForemanTypes < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - ConfigurationProfileForeman ManageIQ::Providers::Foreman::ConfigurationManager::ConfigurationProfile - ConfiguredSystemForeman ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150823120001_namespace_ems_openstack_availability_zones_null.rb b/db/migrate/20150823120001_namespace_ems_openstack_availability_zones_null.rb deleted file mode 100644 index 462d3a268..000000000 --- a/db/migrate/20150823120001_namespace_ems_openstack_availability_zones_null.rb +++ /dev/null @@ -1,18 +0,0 @@ -class NamespaceEmsOpenstackAvailabilityZonesNull < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - AvailabilityZoneOpenstackNull ManageIQ::Providers::Openstack::CloudManager::AvailabilityZoneNull - )] - - def change - # Fix issues where future migrations could be named incorrectly due to the - # bad naming of this particular migration - bad = Pathname.glob(Rails.root.join("db/migrate/20151435*")).first - raise ActiveRecord::IllegalMigrationNameError.new(bad) if bad - - return if previously_migrated_as?("20151435234622") - - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150824120000_add_tenant_override_settings.rb b/db/migrate/20150824120000_add_tenant_override_settings.rb deleted file mode 100644 index 1dd25c1f7..000000000 --- a/db/migrate/20150824120000_add_tenant_override_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddTenantOverrideSettings < ActiveRecord::Migration[4.2] - include MigrationHelper - - def change - return if previously_migrated_as?("20151435234633") - add_column :tenants, :use_config_for_attributes, :boolean - end -end diff --git a/db/migrate/20150824130000_update_tenant_override_settings.rb b/db/migrate/20150824130000_update_tenant_override_settings.rb deleted file mode 100644 index 5de0ab97e..000000000 --- a/db/migrate/20150824130000_update_tenant_override_settings.rb +++ /dev/null @@ -1,12 +0,0 @@ -class UpdateTenantOverrideSettings < ActiveRecord::Migration[4.2] - include MigrationHelper - - class Tenant < ActiveRecord::Base; end - - def up - return if previously_migrated_as?("20151435234634") - say_with_time "updating root_tenant to load from configurations" do - Tenant.where(:ancestry => nil).update_all(:use_config_for_attributes => true) - end - end -end diff --git a/db/migrate/20150825120000_add_service_catalog_tenant.rb b/db/migrate/20150825120000_add_service_catalog_tenant.rb deleted file mode 100644 index a79b5232e..000000000 --- a/db/migrate/20150825120000_add_service_catalog_tenant.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddServiceCatalogTenant < ActiveRecord::Migration[4.2] - include MigrationHelper - - def change - return if previously_migrated_as?("20151435234623") - add_column :service_template_catalogs, :tenant_id, :bigint - add_column :service_templates, :tenant_id, :bigint - end -end diff --git a/db/migrate/20150827120000_add_tenant_id_to_miq_ae_namespaces.rb b/db/migrate/20150827120000_add_tenant_id_to_miq_ae_namespaces.rb deleted file mode 100644 index ddd8019c2..000000000 --- a/db/migrate/20150827120000_add_tenant_id_to_miq_ae_namespaces.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddTenantIdToMiqAeNamespaces < ActiveRecord::Migration[4.2] - include MigrationHelper - - def change - return if previously_migrated_as?("20151435234624") - add_column :miq_ae_namespaces, :tenant_id, :bigint - end -end diff --git a/db/migrate/20150831123700_rename_tenant_owner_id.rb b/db/migrate/20150831123700_rename_tenant_owner_id.rb deleted file mode 100644 index 180cef0f3..000000000 --- a/db/migrate/20150831123700_rename_tenant_owner_id.rb +++ /dev/null @@ -1,8 +0,0 @@ -class RenameTenantOwnerId < ActiveRecord::Migration[4.2] - def change - rename_column :ext_management_systems, :tenant_owner_id, :tenant_id - rename_column :miq_groups, :tenant_owner_id, :tenant_id - rename_column :providers, :tenant_owner_id, :tenant_id - rename_column :vms, :tenant_owner_id, :tenant_id - end -end diff --git a/db/migrate/20150903073337_add_container_node_max_container_group.rb b/db/migrate/20150903073337_add_container_node_max_container_group.rb deleted file mode 100644 index 5aefc5a77..000000000 --- a/db/migrate/20150903073337_add_container_node_max_container_group.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContainerNodeMaxContainerGroup < ActiveRecord::Migration[4.2] - def change - add_column :container_nodes, :max_container_groups, :int - end -end diff --git a/db/migrate/20150903162623_assign_tenant.rb b/db/migrate/20150903162623_assign_tenant.rb deleted file mode 100644 index fabfeff02..000000000 --- a/db/migrate/20150903162623_assign_tenant.rb +++ /dev/null @@ -1,46 +0,0 @@ -class AssignTenant < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base - # seed and return the current root_tenant - def self.root_tenant - create_with( - :name => "My Company", - :description => "Tenant for My Company", - :divisible => true, - :use_config_for_attributes => true, - ).find_or_create_by(:ancestry => nil) - end - end - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class MiqAeNamespace < ActiveRecord::Base; end - - class MiqGroup < ActiveRecord::Base; end - - class Provider < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class TenantQuota < ActiveRecord::Base; end - - class Vm < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def change - models = [ExtManagementSystem, MiqAeNamespace, MiqGroup, - Provider, TenantQuota, Vm] - - # only create a root tenant if there are records in the db - return unless MiqGroup.exists? - - say_with_time "assigning tenant to models" do - root_tenant = Tenant.root_tenant - models.each do |model| - model.where(:tenant_id => nil).update_all(:tenant_id => root_tenant.id) - end - end - end -end diff --git a/db/migrate/20150904132351_add_scan_columns_to_container_images.rb b/db/migrate/20150904132351_add_scan_columns_to_container_images.rb deleted file mode 100644 index 11f69bc7a..000000000 --- a/db/migrate/20150904132351_add_scan_columns_to_container_images.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddScanColumnsToContainerImages < ActiveRecord::Migration[4.2] - def change - add_column :container_images, :last_sync_on, :datetime - add_column :container_images, :last_scan_attempt_on, :datetime - end -end diff --git a/db/migrate/20150904181202_miq_groups_add_ldap_role.rb b/db/migrate/20150904181202_miq_groups_add_ldap_role.rb deleted file mode 100644 index 3ceb46089..000000000 --- a/db/migrate/20150904181202_miq_groups_add_ldap_role.rb +++ /dev/null @@ -1,17 +0,0 @@ -class MiqGroupsAddLdapRole < ActiveRecord::Migration[4.2] - class MiqUserRole < ActiveRecord::Base; end - - class MiqGroup < ActiveRecord::Base; end - - def up - say_with_time "migrating old ldap groups" do - MiqGroup.where(:group_type => "ldap").each do |g| - role_id = MiqUserRole.find_by(:name => "EvmRole-#{g.description.split("-").last}").try(:id) - g.update( - :group_type => "system", - :miq_user_role_id => role_id - ) - end - end - end -end diff --git a/db/migrate/20150906123643_create_security_context.rb b/db/migrate/20150906123643_create_security_context.rb deleted file mode 100644 index e4432f758..000000000 --- a/db/migrate/20150906123643_create_security_context.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateSecurityContext < ActiveRecord::Migration[4.2] - def change - create_table :security_contexts do |t| - t.references :resource, :polymorphic => true, :type => :bigint - t.string :se_linux_user - t.string :se_linux_role - t.string :se_linux_type - t.string :se_linux_level - end - end -end diff --git a/db/migrate/20150906123956_add_container_definition_security_contexts.rb b/db/migrate/20150906123956_add_container_definition_security_contexts.rb deleted file mode 100644 index 203d414b9..000000000 --- a/db/migrate/20150906123956_add_container_definition_security_contexts.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddContainerDefinitionSecurityContexts < ActiveRecord::Migration[4.2] - def change - add_column :container_definitions, :privileged, :boolean - add_column :container_definitions, :run_as_user, :bigint - add_column :container_definitions, :run_as_non_root, :boolean - add_column :container_definitions, :capabilities_add, :string - add_column :container_definitions, :capabilities_drop, :string - end -end diff --git a/db/migrate/20150906234626_add_service_type.rb b/db/migrate/20150906234626_add_service_type.rb deleted file mode 100644 index 1877c8078..000000000 --- a/db/migrate/20150906234626_add_service_type.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddServiceType < ActiveRecord::Migration[4.2] - def change - add_column :container_services, :service_type, :string - end -end diff --git a/db/migrate/20150906234635_add_node_port.rb b/db/migrate/20150906234635_add_node_port.rb deleted file mode 100644 index 218743424..000000000 --- a/db/migrate/20150906234635_add_node_port.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNodePort < ActiveRecord::Migration[4.2] - def change - add_column :container_service_port_configs, :node_port, :integer - end -end diff --git a/db/migrate/20150907095639_add_container_image_digest.rb b/db/migrate/20150907095639_add_container_image_digest.rb deleted file mode 100644 index 115d84f8d..000000000 --- a/db/migrate/20150907095639_add_container_image_digest.rb +++ /dev/null @@ -1,22 +0,0 @@ -class AddContainerImageDigest < ActiveRecord::Migration[4.2] - # https://github.com/docker/distribution/blob/v2.1.1/digest/digester.go#L15-L17 - SUPPORTED_DIGESTS = 'sha256', 'sha384', 'sha512' - - class ContainerImage < ActiveRecord::Base; end - - def up - add_column :container_images, :digest, :string - SUPPORTED_DIGESTS.each do |digest| - say_with_time("Update container images with digest #{digest}") do - ContainerImage.where("tag LIKE '#{digest}:%'").update_all('digest = tag, tag = NULL') - end - end - end - - def down - say_with_time("Update container images tags from digests") do - ContainerImage.where("digest IS NOT NULL").update_all('tag = digest') - end - remove_column :container_images, :digest - end -end diff --git a/db/migrate/20150907120454_create_container_volumes.rb b/db/migrate/20150907120454_create_container_volumes.rb deleted file mode 100644 index 337e3723d..000000000 --- a/db/migrate/20150907120454_create_container_volumes.rb +++ /dev/null @@ -1,36 +0,0 @@ -class CreateContainerVolumes < ActiveRecord::Migration[4.2] - def up - create_table :container_volumes do |t| - # prefixes are used to specify the volume source kind - # the 'common' prefix is used when an entry is shard by some different kinds - t.belongs_to :container_group, :type => :bigint - t.string :type - t.string :name - t.string :empty_dir_medium_type - t.string :gce_pd_name - t.string :git_repository - t.string :git_revision - t.string :nfs_server - t.string :iscsi_target_portal - t.string :iscsi_iqn - t.integer :iscsi_lun - t.string :glusterfs_endpoint_name - t.string :claim_name - t.string :rbd_ceph_monitors - t.string :rbd_image - t.string :rbd_pool - t.string :rbd_rados_user - t.string :rbd_keyring - t.string :common_path - t.string :common_fs_type - t.string :common_read_only - t.string :common_volume_id - t.string :common_partition - t.string :common_secret - end - end - - def down - drop_table :container_volumes - end -end diff --git a/db/migrate/20150907163347_confirm_all_class_renames.rb b/db/migrate/20150907163347_confirm_all_class_renames.rb deleted file mode 100644 index abbf62e2e..000000000 --- a/db/migrate/20150907163347_confirm_all_class_renames.rb +++ /dev/null @@ -1,135 +0,0 @@ -class ConfirmAllClassRenames < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - MiqEvent MiqEventDefinition - MiqEventSet MiqEventDefinitionSet - - MiqEventCatcher ManageIQ::Providers::BaseManager::EventCatcher - MiqEmsMetricsCollectorWorker ManageIQ::Providers::BaseManager::MetricsCollectorWorker - MiqEmsRefreshWorker ManageIQ::Providers::BaseManager::RefreshWorker - EmsRefresh::Refreshers::BaseRefresher ManageIQ::Providers::BaseManager::Refresher - EmsCloud ManageIQ::Providers::CloudManager - AuthKeyPairCloud ManageIQ::Providers::CloudManager::AuthKeyPair - MiqProvisionCloud ManageIQ::Providers::CloudManager::Provision - MiqProvisionCloudWorkflow ManageIQ::Providers::CloudManager::ProvisionWorkflow - EmsRefresh::Parsers::Cloud ManageIQ::Providers::CloudManager::RefreshParser - TemplateCloud ManageIQ::Providers::CloudManager::Template - VmCloud ManageIQ::Providers::CloudManager::Vm - ConfigurationManager ManageIQ::Providers::ConfigurationManager - EmsContainer ManageIQ::Providers::ContainerManager - EmsInfra ManageIQ::Providers::InfraManager - MiqProvisionInfraWorkflow ManageIQ::Providers::InfraManager::ProvisionWorkflow - TemplateInfra ManageIQ::Providers::InfraManager::Template - VmInfra ManageIQ::Providers::InfraManager::Vm - ProvisioningManager ManageIQ::Providers::ProvisioningManager - - EmsAmazon ManageIQ::Providers::Amazon::CloudManager - AuthKeyPairAmazon ManageIQ::Providers::Amazon::CloudManager::AuthKeyPair - AvailabilityZoneAmazon ManageIQ::Providers::Amazon::CloudManager::AvailabilityZone - CloudVolumeAmazon ManageIQ::Providers::Amazon::CloudManager::CloudVolume - CloudVolumeSnapshotAmazon ManageIQ::Providers::Amazon::CloudManager::CloudVolumeSnapshot - MiqEventCatcherAmazon ManageIQ::Providers::Amazon::CloudManager::EventCatcher - FlavorAmazon ManageIQ::Providers::Amazon::CloudManager::Flavor - FloatingIpAmazon ManageIQ::Providers::Amazon::CloudManager::FloatingIp - MiqEmsMetricsCollectorWorkerAmazon ManageIQ::Providers::Amazon::CloudManager::MetricsCollectorWorker - ServiceOrchestration::OptionConverterAmazon ManageIQ::Providers::Amazon::CloudManager::OrchestrationServiceOptionConverter - OrchestrationStackAmazon ManageIQ::Providers::Amazon::CloudManager::OrchestrationStack - MiqProvisionAmazon ManageIQ::Providers::Amazon::CloudManager::Provision - MiqProvisionAmazonWorkflow ManageIQ::Providers::Amazon::CloudManager::ProvisionWorkflow - EmsRefresh::Parsers::Ec2 ManageIQ::Providers::Amazon::CloudManager::RefreshParser - MiqEmsRefreshWorkerAmazon ManageIQ::Providers::Amazon::CloudManager::RefreshWorker - EmsRefresh::Refreshers::Ec2Refresher ManageIQ::Providers::Amazon::CloudManager::Refresher - SecurityGroupAmazon ManageIQ::Providers::Amazon::CloudManager::SecurityGroup - TemplateAmazon ManageIQ::Providers::Amazon::CloudManager::Template - VmAmazon ManageIQ::Providers::Amazon::CloudManager::Vm - ConfigurationManagerForeman ManageIQ::Providers::Foreman::ConfigurationManager - ConfigurationProfileForeman ManageIQ::Providers::Foreman::ConfigurationManager::ConfigurationProfile - ConfiguredSystemForeman ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem - MiqProvisionTaskConfiguredSystemForeman ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionTask - MiqProvisionConfiguredSystemForemanWorkflow ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow - MiqEmsRefreshWorkerForemanConfiguration ManageIQ::Providers::Foreman::ConfigurationManager::RefreshWorker - EmsRefresh::Refreshers::ForemanConfigurationRefresher ManageIQ::Providers::Foreman::ConfigurationManager::Refresher - ProviderForeman ManageIQ::Providers::Foreman::Provider - ProvisioningManagerForeman ManageIQ::Providers::Foreman::ProvisioningManager - EmsRefresh::Parsers::Foreman ManageIQ::Providers::Foreman::ProvisioningManager::RefreshParser - MiqEmsRefreshWorkerForemanProvisioning ManageIQ::Providers::Foreman::ProvisioningManager::RefreshWorker - EmsRefresh::Refreshers::ForemanProvisioningRefresher ManageIQ::Providers::Foreman::ProvisioningManager::Refresher - EmsKubernetes ManageIQ::Providers::Kubernetes::ContainerManager - MiqEventCatcherKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::EventCatcher - EmsRefresh::Parsers::Kubernetes ManageIQ::Providers::Kubernetes::ContainerManager::RefreshParser - MiqEmsRefreshWorkerKubernetes ManageIQ::Providers::Kubernetes::ContainerManager::RefreshWorker - EmsRefresh::Refreshers::KubernetesRefresher ManageIQ::Providers::Kubernetes::ContainerManager::Refresher - EmsMicrosoft ManageIQ::Providers::Microsoft::InfraManager - HostMicrosoft ManageIQ::Providers::Microsoft::InfraManager::Host - EmsMicrosoft::Powershell ManageIQ::Providers::Microsoft::InfraManager::Powershell - EmsRefresh::Parsers::Scvmm ManageIQ::Providers::Microsoft::InfraManager::RefreshParser - MiqEmsRefreshWorkerMicrosoft ManageIQ::Providers::Microsoft::InfraManager::RefreshWorker - EmsRefresh::Refreshers::ScvmmRefresher ManageIQ::Providers::Microsoft::InfraManager::Refresher - TemplateMicrosoft ManageIQ::Providers::Microsoft::InfraManager::Template - VmMicrosoft ManageIQ::Providers::Microsoft::InfraManager::Vm - EmsOpenstack ManageIQ::Providers::Openstack::CloudManager - AvailabilityZoneOpenstack ManageIQ::Providers::Openstack::CloudManager::AvailabilityZone - AvailabilityZoneOpenstackNull ManageIQ::Providers::Openstack::CloudManager::AvailabilityZoneNull - CloudResourceQuotaOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudResourceQuota - CloudTenantOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudTenant - CloudVolumeOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudVolume - CloudVolumeSnapshotOpenstack ManageIQ::Providers::Openstack::CloudManager::CloudVolumeSnapshot - MiqEventCatcherOpenstack ManageIQ::Providers::Openstack::CloudManager::EventCatcher - FlavorOpenstack ManageIQ::Providers::Openstack::CloudManager::Flavor - FloatingIpOpenstack ManageIQ::Providers::Openstack::CloudManager::FloatingIp - MiqEmsMetricsCollectorWorkerOpenstack ManageIQ::Providers::Openstack::CloudManager::MetricsCollectorWorker - ServiceOrchestration::OptionConverterOpenstack ManageIQ::Providers::Openstack::CloudManager::OrchestrationServiceOptionConverter - OrchestrationStackOpenstack ManageIQ::Providers::Openstack::CloudManager::OrchestrationStack - MiqProvisionOpenstack ManageIQ::Providers::Openstack::CloudManager::Provision - MiqProvisionOpenstackWorkflow ManageIQ::Providers::Openstack::CloudManager::ProvisionWorkflow - EmsRefresh::Parsers::Openstack ManageIQ::Providers::Openstack::CloudManager::RefreshParser - MiqEmsRefreshWorkerOpenstack ManageIQ::Providers::Openstack::CloudManager::RefreshWorker - EmsRefresh::Refreshers::OpenstackRefresher ManageIQ::Providers::Openstack::CloudManager::Refresher - SecurityGroupOpenstack ManageIQ::Providers::Openstack::CloudManager::SecurityGroup - TemplateOpenstack ManageIQ::Providers::Openstack::CloudManager::Template - VmOpenstack ManageIQ::Providers::Openstack::CloudManager::Vm - VmOpenstack::RemoteConsole ManageIQ::Providers::Openstack::CloudManager::Vm::RemoteConsole - EmsOpenstackInfra ManageIQ::Providers::Openstack::InfraManager - AuthKeyPairOpenstack ManageIQ::Providers::Openstack::InfraManager::AuthKeyPair - MiqEventCatcherOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::EventCatcher - HostOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::Host - MiqEmsMetricsCollectorWorkerOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::MetricsCollectorWorker - OrchestrationStackOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::OrchestrationStack - EmsRefresh::Parsers::OpenstackInfra ManageIQ::Providers::Openstack::InfraManager::RefreshParser - MiqEmsRefreshWorkerOpenstackInfra ManageIQ::Providers::Openstack::InfraManager::RefreshWorker - EmsRefresh::Refreshers::OpenstackInfraRefresher ManageIQ::Providers::Openstack::InfraManager::Refresher - ProviderOpenstack ManageIQ::Providers::Openstack::Provider - EmsRedhat ManageIQ::Providers::Redhat::InfraManager - MiqEventCatcherRedhat ManageIQ::Providers::Redhat::InfraManager::EventCatcher - HostRedhat ManageIQ::Providers::Redhat::InfraManager::Host - MiqEmsMetricsCollectorWorkerRedhat ManageIQ::Providers::Redhat::InfraManager::MetricsCollectorWorker - MiqProvisionRedhat ManageIQ::Providers::Redhat::InfraManager::Provision - MiqProvisionRedhatViaIso ManageIQ::Providers::Redhat::InfraManager::ProvisionViaIso - MiqProvisionRedhatViaPxe ManageIQ::Providers::Redhat::InfraManager::ProvisionViaPxe - MiqProvisionRedhatWorkflow ManageIQ::Providers::Redhat::InfraManager::ProvisionWorkflow - MiqEmsRefreshWorkerRedhat ManageIQ::Providers::Redhat::InfraManager::RefreshWorker - EmsRefresh::Refreshers::RhevmRefresher ManageIQ::Providers::Redhat::InfraManager::Refresher - TemplateRedhat ManageIQ::Providers::Redhat::InfraManager::Template - VmRedhat ManageIQ::Providers::Redhat::InfraManager::Vm - VmRedhat::RemoteConsole ManageIQ::Providers::Redhat::InfraManager::Vm::RemoteConsole - EmsVmware ManageIQ::Providers::Vmware::InfraManager - MiqEventCatcherVmware ManageIQ::Providers::Vmware::InfraManager::EventCatcher - HostVmware ManageIQ::Providers::Vmware::InfraManager::Host - HostVmwareEsx ManageIQ::Providers::Vmware::InfraManager::HostEsx - MiqEmsMetricsCollectorWorkerVmware ManageIQ::Providers::Vmware::InfraManager::MetricsCollectorWorker - MiqProvisionVmware ManageIQ::Providers::Vmware::InfraManager::Provision - MiqProvisionVmwareViaPxe ManageIQ::Providers::Vmware::InfraManager::ProvisionViaPxe - MiqProvisionVmwareWorkflow ManageIQ::Providers::Vmware::InfraManager::ProvisionWorkflow - EmsRefresh::Parsers::Vc ManageIQ::Providers::Vmware::InfraManager::RefreshParser - EmsRefresh::Parsers::Vc::Filter ManageIQ::Providers::Vmware::InfraManager::RefreshParser::Filter - MiqEmsRefreshWorkerVmware ManageIQ::Providers::Vmware::InfraManager::RefreshWorker - EmsRefresh::Refreshers::VcRefresher ManageIQ::Providers::Vmware::InfraManager::Refresher - TemplateVmware ManageIQ::Providers::Vmware::InfraManager::Template - VmVmware ManageIQ::Providers::Vmware::InfraManager::Vm - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150907234623_add_container_command.rb b/db/migrate/20150907234623_add_container_command.rb deleted file mode 100644 index 59256eebd..000000000 --- a/db/migrate/20150907234623_add_container_command.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContainerCommand < ActiveRecord::Migration[4.2] - def change - add_column :container_definitions, :command, :text - end -end diff --git a/db/migrate/20150909023532_namespace_ems_azure.rb b/db/migrate/20150909023532_namespace_ems_azure.rb deleted file mode 100644 index 5175777f0..000000000 --- a/db/migrate/20150909023532_namespace_ems_azure.rb +++ /dev/null @@ -1,17 +0,0 @@ -class NamespaceEmsAzure < ActiveRecord::Migration[4.2] - include MigrationHelper - - NAME_MAP = Hash[*%w( - EmsAzure ManageIQ::Providers::Azure::CloudManager - AvailabilityZoneAzure ManageIQ::Providers::Azure::CloudManager::AvailabilityZone - FlavorAzure ManageIQ::Providers::Azure::CloudManager::Flavor - EmsRefresh::Parsers::Azure ManageIQ::Providers::Azure::CloudManager::RefreshParser - MiqEmsRefreshWorkerAzure ManageIQ::Providers::Azure::CloudManager::RefreshWorker - EmsRefresh::Refreshers::AzureRefresher ManageIQ::Providers::Azure::CloudManager::Refresher - VmAzure ManageIQ::Providers::Azure::CloudManager::Vm - )] - - def change - rename_class_references(NAME_MAP) - end -end diff --git a/db/migrate/20150910153517_add_full_name_to_custom_attributes.rb b/db/migrate/20150910153517_add_full_name_to_custom_attributes.rb deleted file mode 100644 index 738d50eb2..000000000 --- a/db/migrate/20150910153517_add_full_name_to_custom_attributes.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddFullNameToCustomAttributes < ActiveRecord::Migration[4.2] - def change - add_column :custom_attributes, :unique_name, :text - end -end diff --git a/db/migrate/20150911152048_add_disk_info_to_flavors.rb b/db/migrate/20150911152048_add_disk_info_to_flavors.rb deleted file mode 100644 index 0887724e7..000000000 --- a/db/migrate/20150911152048_add_disk_info_to_flavors.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddDiskInfoToFlavors < ActiveRecord::Migration[4.2] - def change - add_column :flavors, :disk_size, :bigint - add_column :flavors, :disk_count, :integer - end -end diff --git a/db/migrate/20150914202922_correct_user_created_role_feature_sets.rb b/db/migrate/20150914202922_correct_user_created_role_feature_sets.rb deleted file mode 100644 index 48a869aac..000000000 --- a/db/migrate/20150914202922_correct_user_created_role_feature_sets.rb +++ /dev/null @@ -1,38 +0,0 @@ -class CorrectUserCreatedRoleFeatureSets < ActiveRecord::Migration[4.2] - class MiqUserRole < ActiveRecord::Base - has_and_belongs_to_many :miq_product_features, :join_table => :miq_roles_features, :class_name => "CorrectUserCreatedRoleFeatureSets::MiqProductFeature" - end - - class MiqProductFeature < ActiveRecord::Base; end - - def up - say_with_time "Correcting user created role feature sets" do - vm_cloud_explorer = MiqProductFeature.find_by(:identifier => "vm_cloud_explorer") - vm_infra_explorer = MiqProductFeature.find_by(:identifier => "vm_infra_explorer") - instances = MiqProductFeature.find_by(:identifier => "instance") - images = MiqProductFeature.find_by(:identifier => "image") - vms = MiqProductFeature.find_by(:identifier => "vm") - templates = MiqProductFeature.find_by(:identifier => "miq_template") - - affected_user_roles.each do |user_role| - if user_role.miq_product_features.include?(vm_cloud_explorer) - user_role.miq_product_features << instances - user_role.miq_product_features << images - end - - if user_role.miq_product_features.include?(vm_infra_explorer) - user_role.miq_product_features << vms - user_role.miq_product_features << templates - end - - user_role.save! - end - end - end - - def affected_user_roles - MiqUserRole - .includes(:miq_product_features) - .where(:read_only => false, :miq_product_features => {:identifier => %w(vm_cloud_explorer vm_infra_explorer)}) - end -end diff --git a/db/migrate/20150914203523_add_warn_value_to.rb b/db/migrate/20150914203523_add_warn_value_to.rb deleted file mode 100644 index 716349b25..000000000 --- a/db/migrate/20150914203523_add_warn_value_to.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddWarnValueTo < ActiveRecord::Migration[4.2] - def change - add_column :tenant_quotas, :warn_value, :float - end -end diff --git a/db/migrate/20150915000737_add_tenant_id_to_miq_request.rb b/db/migrate/20150915000737_add_tenant_id_to_miq_request.rb deleted file mode 100644 index f34ddbc12..000000000 --- a/db/migrate/20150915000737_add_tenant_id_to_miq_request.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddTenantIdToMiqRequest < ActiveRecord::Migration[4.2] - def change - add_column :miq_requests, :tenant_id, :bigint - add_column :miq_request_tasks, :tenant_id, :bigint - add_column :services, :tenant_id, :bigint - end -end diff --git a/db/migrate/20150915001329_assign_tenant_to_miq_request.rb b/db/migrate/20150915001329_assign_tenant_to_miq_request.rb deleted file mode 100644 index c9c71278f..000000000 --- a/db/migrate/20150915001329_assign_tenant_to_miq_request.rb +++ /dev/null @@ -1,62 +0,0 @@ -class AssignTenantToMiqRequest < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base - # seed and return the current root_tenant - def self.root_tenant - create_with( - :name => "My Company", - :description => "Tenant for My Company", - :divisible => true, - :use_config_for_attributes => true, - ).find_or_create_by(:ancestry => nil) - end - end - - class MiqAeNamespace < ActiveRecord::Base; end - - class MiqGroup < ActiveRecord::Base; end - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Provider < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Vm < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class MiqRequest < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class MiqRequestTask < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Service < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class ServiceTemplate < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class ServiceTemplateCatalog < ActiveRecord::Base; end - - def up - models = [ExtManagementSystem, MiqAeNamespace, MiqGroup, Provider, Vm, - MiqRequest, MiqRequestTask, Service, ServiceTemplate, ServiceTemplateCatalog] - - # only create a root tenant if there are records in the db - return unless MiqGroup.exists? - - say_with_time "assigning tenant to models" do - root_tenant = Tenant.root_tenant - models.each do |model| - model.where(:tenant_id => nil).update_all(:tenant_id => root_tenant.id) - end - end - end -end diff --git a/db/migrate/20150921204114_add_vmware_ro_datastores_to_hosts_storages.rb b/db/migrate/20150921204114_add_vmware_ro_datastores_to_hosts_storages.rb deleted file mode 100644 index e2b3d48af..000000000 --- a/db/migrate/20150921204114_add_vmware_ro_datastores_to_hosts_storages.rb +++ /dev/null @@ -1,37 +0,0 @@ -class AddVmwareRoDatastoresToHostsStorages < ActiveRecord::Migration[4.2] - class HostsStorage < ActiveRecord::Base; end - - def up - rename_table :hosts_storages, :host_storages - add_column :host_storages, :read_only, :boolean - - # Find the sequence_start value for our region, if the region is - # 0 then start at 1 - seq_start_value = anonymous_class_with_id_regions.rails_sequence_start - seq_start_value = 1 if seq_start_value == 0 - - # add_column ... :primary_key was adding ids to all existing rows before - # the sequence_start could be set, so we have to create the sequence and - # the primary keys manually - say_with_time("Add host_storages primary_key") do - # Add an auto-increment sequence to be used by the primary key column - connection.execute "CREATE SEQUENCE host_storages_id_seq START #{seq_start_value}" - - # Add a primary key column named id and use the previously created sequence - # This will automatically fill in new primary keys for all existing rows - # in the host_storages table - connection.execute "ALTER TABLE host_storages ADD COLUMN id BIGINT PRIMARY KEY "\ - "NOT NULL DEFAULT NEXTVAL('host_storages_id_seq')" - - # Now update the sequence to be owned by the pkey column so that when it - # gets deleted the sequence also is deleted - connection.execute "ALTER SEQUENCE host_storages_id_seq OWNED BY host_storages.id" - end - end - - def down - remove_column :host_storages, :id - remove_column :host_storages, :read_only - rename_table :host_storages, :hosts_storages - end -end diff --git a/db/migrate/20150924195523_enhance_flavors_for_cloud_disk_info.rb b/db/migrate/20150924195523_enhance_flavors_for_cloud_disk_info.rb deleted file mode 100644 index 288719c33..000000000 --- a/db/migrate/20150924195523_enhance_flavors_for_cloud_disk_info.rb +++ /dev/null @@ -1,8 +0,0 @@ -class EnhanceFlavorsForCloudDiskInfo < ActiveRecord::Migration[4.2] - def change - add_column :flavors, :root_disk_size, :bigint - add_column :flavors, :swap_disk_size, :bigint - rename_column :flavors, :disk_size, :ephemeral_disk_size - rename_column :flavors, :disk_count, :ephemeral_disk_count - end -end diff --git a/db/migrate/20150930083543_add_status_to_floating_ips.rb b/db/migrate/20150930083543_add_status_to_floating_ips.rb deleted file mode 100644 index 93996ed91..000000000 --- a/db/migrate/20150930083543_add_status_to_floating_ips.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStatusToFloatingIps < ActiveRecord::Migration[4.2] - def change - add_column :floating_ips, :status, :string - end -end diff --git a/db/migrate/20150930201117_change_cloud_tenant_description_to_text.rb b/db/migrate/20150930201117_change_cloud_tenant_description_to_text.rb deleted file mode 100644 index e0aadfdc1..000000000 --- a/db/migrate/20150930201117_change_cloud_tenant_description_to_text.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ChangeCloudTenantDescriptionToText < ActiveRecord::Migration[4.2] - def up - change_column :cloud_tenants, :description, :text - end - - def down - change_column :cloud_tenants, :description, :string - end -end diff --git a/db/migrate/20151001110220_add_resource_group_to_orchestration_stack.rb b/db/migrate/20151001110220_add_resource_group_to_orchestration_stack.rb deleted file mode 100644 index ad558b300..000000000 --- a/db/migrate/20151001110220_add_resource_group_to_orchestration_stack.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddResourceGroupToOrchestrationStack < ActiveRecord::Migration[4.2] - def change - add_column :orchestration_stacks, :resource_group, :string - end -end diff --git a/db/migrate/20151001193521_rename_hardware_columns.rb b/db/migrate/20151001193521_rename_hardware_columns.rb deleted file mode 100644 index 77704f161..000000000 --- a/db/migrate/20151001193521_rename_hardware_columns.rb +++ /dev/null @@ -1,8 +0,0 @@ -class RenameHardwareColumns < ActiveRecord::Migration[4.2] - def change - rename_column :hardwares, :cores_per_socket, :cpu_cores_per_socket - rename_column :hardwares, :numvcpus, :cpu_sockets - rename_column :hardwares, :logical_cpus, :cpu_total_cores - rename_column :hardwares, :memory_cpu, :memory_mb - end -end diff --git a/db/migrate/20151005082821_change_device_id_to_bigint_in_network_ports.rb b/db/migrate/20151005082821_change_device_id_to_bigint_in_network_ports.rb deleted file mode 100644 index 1659f8ba0..000000000 --- a/db/migrate/20151005082821_change_device_id_to_bigint_in_network_ports.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ChangeDeviceIdToBigintInNetworkPorts < ActiveRecord::Migration[4.2] - def up - change_column :network_ports, :device_id, :bigint - end - - def down - change_column :network_ports, :device_id, :integer - end -end diff --git a/db/migrate/20151008114043_create_chargeback_rate_detail_measure.rb b/db/migrate/20151008114043_create_chargeback_rate_detail_measure.rb deleted file mode 100644 index 33ce4d298..000000000 --- a/db/migrate/20151008114043_create_chargeback_rate_detail_measure.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateChargebackRateDetailMeasure < ActiveRecord::Migration[4.2] - def change - create_table :chargeback_rate_detail_measures do |t| - t.string :name - t.string :units - t.string :units_display - t.integer :step - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20151008114125_add_measure_ref_to_chargeback_rate_detail.rb b/db/migrate/20151008114125_add_measure_ref_to_chargeback_rate_detail.rb deleted file mode 100644 index 3b4992570..000000000 --- a/db/migrate/20151008114125_add_measure_ref_to_chargeback_rate_detail.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddMeasureRefToChargebackRateDetail < ActiveRecord::Migration[4.2] - def change - add_column :chargeback_rate_details, :chargeback_rate_detail_measure_id, :bigint - end -end diff --git a/db/migrate/20151009174934_create_chargeback_rate_detail_currencies.rb b/db/migrate/20151009174934_create_chargeback_rate_detail_currencies.rb deleted file mode 100644 index 7a137948b..000000000 --- a/db/migrate/20151009174934_create_chargeback_rate_detail_currencies.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateChargebackRateDetailCurrencies < ActiveRecord::Migration[4.2] - def change - create_table :chargeback_rate_detail_currencies do |t| - t.string :code - t.string :name - t.string :full_name - t.string :symbol - t.string :unicode_hex - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20151012072007_create_container_component_statuses.rb b/db/migrate/20151012072007_create_container_component_statuses.rb deleted file mode 100644 index 9ad78f65c..000000000 --- a/db/migrate/20151012072007_create_container_component_statuses.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateContainerComponentStatuses < ActiveRecord::Migration[4.2] - def up - create_table :container_component_statuses do |t| - t.belongs_to :ems, :type => :bigint - t.string :name - t.string :condition - t.string :status - t.string :message - t.string :error - end - end - - def down - drop_table :container_component_statuses - end -end diff --git a/db/migrate/20151013104702_add_currencies_ref_to_chargeback_rate_detail.rb b/db/migrate/20151013104702_add_currencies_ref_to_chargeback_rate_detail.rb deleted file mode 100644 index c1f585ea1..000000000 --- a/db/migrate/20151013104702_add_currencies_ref_to_chargeback_rate_detail.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCurrenciesRefToChargebackRateDetail < ActiveRecord::Migration[4.2] - def change - add_column :chargeback_rate_details, :chargeback_rate_detail_currency_id, :bigint - end -end diff --git a/db/migrate/20151018090641_create_persistent_volume_claim.rb b/db/migrate/20151018090641_create_persistent_volume_claim.rb deleted file mode 100644 index 9b7f378bf..000000000 --- a/db/migrate/20151018090641_create_persistent_volume_claim.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreatePersistentVolumeClaim < ActiveRecord::Migration[4.2] - def change - create_table :persistent_volume_claims do |t| - t.belongs_to :ems, :type => :bigint - t.string :ems_ref - t.string :name - t.timestamp :ems_created_on - t.string :resource_version - t.text :desired_access_modes, :array => true, :default => [] - t.string :phase - t.text :actual_access_modes, :array => true, :default => [] - t.text :capacity - - t.timestamps - end - end -end diff --git a/db/migrate/20151019184531_create_resource_groups.rb b/db/migrate/20151019184531_create_resource_groups.rb deleted file mode 100644 index e30b4c992..000000000 --- a/db/migrate/20151019184531_create_resource_groups.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateResourceGroups < ActiveRecord::Migration[4.2] - def up - create_table :resource_groups do |t| - t.string :name - t.string :ems_ref - t.bigint :ems_id - t.string :type - t.timestamps :null => false - end - end - - def down - drop_table :resource_groups - end -end diff --git a/db/migrate/20151019194111_tenant_cfg_not_nil.rb b/db/migrate/20151019194111_tenant_cfg_not_nil.rb deleted file mode 100644 index 63afc21d2..000000000 --- a/db/migrate/20151019194111_tenant_cfg_not_nil.rb +++ /dev/null @@ -1,9 +0,0 @@ -class TenantCfgNotNil < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base; end - - def up - say_with_time "Set default for use_config_for_attributes on Tenants" do - Tenant.where(:use_config_for_attributes => nil).update_all(:use_config_for_attributes => false) - end - end -end diff --git a/db/migrate/20151020222634_add_watermark_reporting_fields_to_metric_and_metric_rollup.rb b/db/migrate/20151020222634_add_watermark_reporting_fields_to_metric_and_metric_rollup.rb deleted file mode 100644 index fcd06e16c..000000000 --- a/db/migrate/20151020222634_add_watermark_reporting_fields_to_metric_and_metric_rollup.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddWatermarkReportingFieldsToMetricAndMetricRollup < ActiveRecord::Migration[4.2] - def change - add_column :metrics, :derived_host_sockets, :integer - add_column :metrics, :derived_host_count_total, :integer - add_column :metrics, :derived_vm_count_total, :integer - add_column :metric_rollups, :derived_host_sockets, :integer - add_column :metric_rollups, :derived_host_count_total, :integer - add_column :metric_rollups, :derived_vm_count_total, :integer - end -end diff --git a/db/migrate/20151021093644_set_correct_sti_type_on_cloud_network.rb b/db/migrate/20151021093644_set_correct_sti_type_on_cloud_network.rb deleted file mode 100644 index e163f54fb..000000000 --- a/db/migrate/20151021093644_set_correct_sti_type_on_cloud_network.rb +++ /dev/null @@ -1,38 +0,0 @@ -class SetCorrectStiTypeOnCloudNetwork < ActiveRecord::Migration[4.2] - CLOUD_TEMPLATE_CLASS = "ManageIQ::Providers::Openstack::CloudManager::Template".freeze - CLOUD_PUBLIC_CLASS = "ManageIQ::Providers::Openstack::CloudManager::CloudNetwork::Public".freeze - CLOUD_PRIVATE_CLASS = "ManageIQ::Providers::Openstack::CloudManager::CloudNetwork::Private".freeze - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class BaseManager < ExtManagementSystem; end - - class CloudManager < BaseManager; end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - belongs_to :ext_management_system, - :foreign_key => :ems_id, :class_name => "SetCorrectStiTypeOnCloudNetwork::BaseManager" - end - - def up - CloudNetwork.update_all(:type => CLOUD_TEMPLATE_CLASS) - - CloudNetwork.joins(:ext_management_system) - .where(:cloud_networks => {:external_facing => true}, - :ext_management_systems => {:type => 'ManageIQ::Providers::Openstack::CloudManager'}) - .update_all(:type => CLOUD_PUBLIC_CLASS) - - CloudNetwork.joins(:ext_management_system) - .where.not(:cloud_networks => {:external_facing => true}) - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Openstack::InfraManager'}) - .update_all(:type => CLOUD_PRIVATE_CLASS) - end - - def down - CloudNetwork.update_all(:type => nil) - end -end diff --git a/db/migrate/20151021095831_set_correct_sti_type_on_cloud_subnet.rb b/db/migrate/20151021095831_set_correct_sti_type_on_cloud_subnet.rb deleted file mode 100644 index 005b794eb..000000000 --- a/db/migrate/20151021095831_set_correct_sti_type_on_cloud_subnet.rb +++ /dev/null @@ -1,26 +0,0 @@ -class SetCorrectStiTypeOnCloudSubnet < ActiveRecord::Migration[4.2] - CLOUD_SUBNET = "ManageIQ::Providers::Openstack::CloudManager::CloudSubnet".freeze - CLOUD_PUBLIC_CLASS = "ManageIQ::Providers::Openstack::CloudManager::CloudNetwork::Public".freeze - CLOUD_PRIVATE_CLASS = "ManageIQ::Providers::Openstack::CloudManager::CloudNetwork::Private".freeze - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - belongs_to :cloud_network - end - - def up - CloudSubnet.update_all(:type => "CloudSubnet") - - CloudSubnet.joins(:cloud_network).where(:cloud_networks => {:type => [CLOUD_PUBLIC_CLASS, CLOUD_PRIVATE_CLASS]}) - .update_all(:type => CLOUD_SUBNET) - end - - def down - CloudSubnet.update_all(:type => nil) - end -end diff --git a/db/migrate/20151021104529_add_persistent_volumes_to_container_volumes.rb b/db/migrate/20151021104529_add_persistent_volumes_to_container_volumes.rb deleted file mode 100644 index b67f16dd6..000000000 --- a/db/migrate/20151021104529_add_persistent_volumes_to_container_volumes.rb +++ /dev/null @@ -1,39 +0,0 @@ -class AddPersistentVolumesToContainerVolumes < ActiveRecord::Migration[4.2] - class ContainerVolume < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - add_column :container_volumes, :ems_ref, :string - add_column :container_volumes, :creation_timestamp, :timestamp - add_column :container_volumes, :resource_version, :string - add_column :container_volumes, :capacity, :string - add_column :container_volumes, :access_modes, :string - add_column :container_volumes, :reclaim_policy, :string - add_column :container_volumes, :status_phase, :string - add_column :container_volumes, :status_message, :string - add_column :container_volumes, :status_reason, :string - add_column :container_volumes, :parent_type, :string - say_with_time("Update ContainerVolume parent_type to ContainerGroup") do - ContainerVolume.update_all(:parent_type => "ContainerGroup") - end - rename_column :container_volumes, :container_group_id, :parent_id - end - - def down - remove_column :container_volumes, :ems_ref, :string - remove_column :container_volumes, :creation_timestamp, :timestamp - remove_column :container_volumes, :resource_version, :string - remove_column :container_volumes, :capacity, :string - remove_column :container_volumes, :access_modes, :string - remove_column :container_volumes, :reclaim_policy, :string - remove_column :container_volumes, :status_phase, :string - remove_column :container_volumes, :status_message, :string - remove_column :container_volumes, :status_reason, :string - say_with_time("Deleting ContainerVolumes not belonging to ContainerGroups") do - ContainerVolume.where("parent_type != 'ContainerGroup'").delete_all - end - remove_column :container_volumes, :parent_type, :string - rename_column :container_volumes, :parent_id, :container_group_id - end -end diff --git a/db/migrate/20151021143818_add_replicator_entity_events.rb b/db/migrate/20151021143818_add_replicator_entity_events.rb deleted file mode 100644 index 478447091..000000000 --- a/db/migrate/20151021143818_add_replicator_entity_events.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddReplicatorEntityEvents < ActiveRecord::Migration[4.2] - def change - add_column :event_streams, :container_replicator_id, :bigint - add_column :event_streams, :container_replicator_name, :string - end -end diff --git a/db/migrate/20151021151216_add_resource_group_id_to_vms.rb b/db/migrate/20151021151216_add_resource_group_id_to_vms.rb deleted file mode 100644 index 90c1fe389..000000000 --- a/db/migrate/20151021151216_add_resource_group_id_to_vms.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddResourceGroupIdToVms < ActiveRecord::Migration[4.2] - def up - add_column :vms, :resource_group_id, :bigint - end - - def down - remove_column :vms, :resource_group_id - end -end diff --git a/db/migrate/20151021174044_add_tenant_default_group.rb b/db/migrate/20151021174044_add_tenant_default_group.rb deleted file mode 100644 index 55b63ecb7..000000000 --- a/db/migrate/20151021174044_add_tenant_default_group.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddTenantDefaultGroup < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base; end - - def change - add_column :tenants, :default_miq_group_id, :bigint - Tenant.reset_column_information - end -end diff --git a/db/migrate/20151021174140_assign_tenant_default_group.rb b/db/migrate/20151021174140_assign_tenant_default_group.rb deleted file mode 100644 index 00800c59c..000000000 --- a/db/migrate/20151021174140_assign_tenant_default_group.rb +++ /dev/null @@ -1,44 +0,0 @@ -class AssignTenantDefaultGroup < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base - def add_default_miq_group - tenant_group = ::AssignTenantDefaultGroup::MiqGroup.create_tenant_group(self) - update!(:default_miq_group_id => tenant_group.id) - end - - def root? - ancestry.nil? - end - end - - class MiqUserRole < ActiveRecord::Base - DEFAULT_TENANT_ROLE_NAME = "EvmRole-tenant_administrator" - - # if there is no role, that is ok - # MiqGroup.seed will populate - - def self.default_tenant_role - @default_role ||= find_by(:name => DEFAULT_TENANT_ROLE_NAME) - end - end - - class MiqGroup < ActiveRecord::Base - TENANT_GROUP = "tenant" - - def self.create_tenant_group(tenant) - role = ::AssignTenantDefaultGroup::MiqUserRole.default_tenant_role - create_with( - :description => "Tenant #{tenant.name} #{tenant.id} access", - :group_type => TENANT_GROUP, - :sequence => 1, - :guid => SecureRandom.uuid, - :miq_user_role_id => role.try(:id) - ).find_or_create_by!(:tenant_id => tenant.id) - end - end - - def up - say_with_time "adding default tenant groups" do - Tenant.where(:default_miq_group_id => nil).each(&:add_default_miq_group) - end - end -end diff --git a/db/migrate/20151022141745_remove_license_required_from_server_roles.rb b/db/migrate/20151022141745_remove_license_required_from_server_roles.rb deleted file mode 100644 index 3ac3ed0e3..000000000 --- a/db/migrate/20151022141745_remove_license_required_from_server_roles.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveLicenseRequiredFromServerRoles < ActiveRecord::Migration[4.2] - def up - remove_column :server_roles, :license_required - end - - def down - add_column :server_roles, :license_required, :string - end -end diff --git a/db/migrate/20151026170631_set_miq_groups_group_type.rb b/db/migrate/20151026170631_set_miq_groups_group_type.rb deleted file mode 100644 index 2323e7402..000000000 --- a/db/migrate/20151026170631_set_miq_groups_group_type.rb +++ /dev/null @@ -1,17 +0,0 @@ -class SetMiqGroupsGroupType < ActiveRecord::Migration[4.2] - class MiqGroup < ActiveRecord::Base - USER_GROUP = "user" - end - - def up - say_with_time "defaulting groups to user groups" do - MiqGroup.where(:group_type => nil).update_all(:group_type => MiqGroup::USER_GROUP) - end - end - - def down - say_with_time "rolling back user group changes" do - MiqGroup.where(:group_type => MiqGroup::USER_GROUP).update_all(:group_type => nil) - end - end -end diff --git a/db/migrate/20151026220722_assign_vm_group.rb b/db/migrate/20151026220722_assign_vm_group.rb deleted file mode 100644 index 709db6ce3..000000000 --- a/db/migrate/20151026220722_assign_vm_group.rb +++ /dev/null @@ -1,30 +0,0 @@ -class AssignVmGroup < ActiveRecord::Migration[4.2] - class Tenant < ActiveRecord::Base - def self.root_tenant - where(:ancestry => nil).first - end - end - - class VmOrTemplate < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - self.table_name = 'vms' - end - - class Service < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - group_id = Tenant.root_tenant.try(:default_miq_group_id) - - return unless group_id - - say_with_time "assign default vm groups" do - VmOrTemplate.where(:miq_group_id => nil).update_all(:miq_group_id => group_id) - end - - say_with_time "assign default service miq_groups" do - Service.where(:miq_group_id => nil).update_all(:miq_group_id => group_id) - end - end -end diff --git a/db/migrate/20151030201919_fix_miq_group_sequences.rb b/db/migrate/20151030201919_fix_miq_group_sequences.rb deleted file mode 100644 index ff655cc91..000000000 --- a/db/migrate/20151030201919_fix_miq_group_sequences.rb +++ /dev/null @@ -1,15 +0,0 @@ -class FixMiqGroupSequences < ActiveRecord::Migration[4.2] - class MiqGroup < ActiveRecord::Base; end - - def up - say_with_time("Update MiqGroup missing sequences") do - MiqGroup.where(:sequence => nil).update_all(:sequence => 1) - end - - say_with_time("Update MiqGroup missing guids") do - MiqGroup.where(:guid => nil).each do |g| - g.update(:guid => SecureRandom.uuid) - end - end - end -end diff --git a/db/migrate/20151104115400_create_chargeback_tiers.rb b/db/migrate/20151104115400_create_chargeback_tiers.rb deleted file mode 100644 index d64394fca..000000000 --- a/db/migrate/20151104115400_create_chargeback_tiers.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateChargebackTiers < ActiveRecord::Migration[4.2] - def change - create_table :chargeback_tiers do |t| - t.bigint :chargeback_rate_detail_id - t.float :start - t.float :finish - t.float :fixed_rate - t.float :variable_rate - end - end -end diff --git a/db/migrate/20151104120951_transfer_rate_value_to_tiers.rb b/db/migrate/20151104120951_transfer_rate_value_to_tiers.rb deleted file mode 100644 index b7e16be64..000000000 --- a/db/migrate/20151104120951_transfer_rate_value_to_tiers.rb +++ /dev/null @@ -1,21 +0,0 @@ -class TransferRateValueToTiers < ActiveRecord::Migration[4.2] - class ChargebackRateDetail < ActiveRecord::Base - has_many :chargeback_tiers - end - class ChargebackTier < ActiveRecord::Base - belongs_to :chargeback_rate_detail - end - - def change - ChargebackRateDetail.reset_column_information - ChargebackRateDetail.all.to_a.each do |detail| - if detail.respond_to?(:rate) - ChargebackTier.create(:chargeback_rate_detail_id => detail.id, - :start => 0, - :finish => Float::INFINITY, - :fixed_rate => 0.0, - :variable_rate => detail.rate) - end - end - end -end diff --git a/db/migrate/20151106164333_add_project_to_ext_management_system.rb b/db/migrate/20151106164333_add_project_to_ext_management_system.rb deleted file mode 100644 index 75a8c151d..000000000 --- a/db/migrate/20151106164333_add_project_to_ext_management_system.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddProjectToExtManagementSystem < ActiveRecord::Migration[4.2] - def change - add_column :ext_management_systems, :project, :string - end -end diff --git a/db/migrate/20151109203749_add_service_account_to_authentication.rb b/db/migrate/20151109203749_add_service_account_to_authentication.rb deleted file mode 100644 index b9058ab0d..000000000 --- a/db/migrate/20151109203749_add_service_account_to_authentication.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddServiceAccountToAuthentication < ActiveRecord::Migration[4.2] - def change - add_column :authentications, :service_account, :string - end -end diff --git a/db/migrate/20151111165020_rename_miq_search_db.rb b/db/migrate/20151111165020_rename_miq_search_db.rb deleted file mode 100644 index f9b9e8c75..000000000 --- a/db/migrate/20151111165020_rename_miq_search_db.rb +++ /dev/null @@ -1,18 +0,0 @@ -class RenameMiqSearchDb < ActiveRecord::Migration[4.2] - class MiqSearch < ActiveRecord::Base; end - - NAME_HASH = Hash[*%w( - TemplateInfra ManageIQ::Providers::InfraManager::Template - VmInfra ManageIQ::Providers::InfraManager::Vm - TemplateCloud ManageIQ::Providers::CloudManager::Template - VmCloud ManageIQ::Providers::CloudManager::Vm - )] - - def up - say_with_time("Rename MiqSearch db values") do - MiqSearch.all.each do |search| - search.update!(:db => NAME_HASH[search.db]) if NAME_HASH.key?(search.db) - end - end - end -end diff --git a/db/migrate/20151119202643_update_default_update_repo_names.rb b/db/migrate/20151119202643_update_default_update_repo_names.rb deleted file mode 100644 index c1f006e9d..000000000 --- a/db/migrate/20151119202643_update_default_update_repo_names.rb +++ /dev/null @@ -1,28 +0,0 @@ -class UpdateDefaultUpdateRepoNames < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base; end - - REPO_NAME_HASH = { - "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1" => "", - "cf-me-5.4-for-rhel-6-rpms rhel-server-rhscl-6-rpms" => "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms" - } - - def up - say_with_time("Updating update_repo_name") do - update(REPO_NAME_HASH) - end - end - - def down - say_with_time("Updating update_repo_name") do - update(REPO_NAME_HASH.invert) - end - end - - def update(hash) - db = MiqDatabase.first - if db - new_repo = hash[db.update_repo_name] - db.update(:update_repo_name => new_repo) if new_repo - end - end -end diff --git a/db/migrate/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template.rb b/db/migrate/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template.rb deleted file mode 100644 index 76e97a69f..000000000 --- a/db/migrate/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template.rb +++ /dev/null @@ -1,25 +0,0 @@ -class SetCorrectStiTypeOnOpenstackInfraMiqTemplate < ActiveRecord::Migration[4.2] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Vm < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - # Set OpenStack Infra specific STI types for miq_template under that provider - Vm.joins('join ext_management_systems on vms.ems_id = ext_management_systems.id'). - where(vms: { type: 'ManageIQ::Providers::Openstack::CloudManager::Template'}, - ext_management_systems: { type: 'ManageIQ::Providers::Openstack::InfraManager'}). - update_all("type = 'ManageIQ::Providers::Openstack::InfraManager::Template'") - end - - def down - # Set back Openstack cloud specific STI types for miq_template under infra that provider - Vm.joins('join ext_management_systems on vms.ems_id = ext_management_systems.id'). - where(vms: { type: 'ManageIQ::Providers::Openstack::InfraManager::Template'}, - ext_management_systems: { type: 'ManageIQ::Providers::Openstack::InfraManager'}). - update_all("type = 'ManageIQ::Providers::Openstack::CloudManager::Template'") - end -end diff --git a/db/migrate/20151125155213_create_middleware_servers.rb b/db/migrate/20151125155213_create_middleware_servers.rb deleted file mode 100644 index 1983588ee..000000000 --- a/db/migrate/20151125155213_create_middleware_servers.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateMiddlewareServers < ActiveRecord::Migration[4.2] - def change - create_table :middleware_servers do |t| - t.string :name # server name generated from id - t.string :feed # feed - t.string :ems_ref # path - t.string :nativeid # id - t.string :type_path - t.string :hostname - t.string :product - t.text :properties - t.bigint :ems_id - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20151204143045_set_correct_sti_type_on_openstack_cloud_volume.rb b/db/migrate/20151204143045_set_correct_sti_type_on_openstack_cloud_volume.rb deleted file mode 100644 index 8a1c44b38..000000000 --- a/db/migrate/20151204143045_set_correct_sti_type_on_openstack_cloud_volume.rb +++ /dev/null @@ -1,25 +0,0 @@ -class SetCorrectStiTypeOnOpenstackCloudVolume < ActiveRecord::Migration[4.2] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudVolume < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - # Set OpenStack Infra specific STI types for miq_template under that provider - CloudVolume.joins('join ext_management_systems on cloud_volumes.ems_id = ext_management_systems.id') - .where(:cloud_volumes => {:type => nil}, - :ext_management_systems => {:type => 'ManageIQ::Providers::Openstack::CloudManager'}) - .update_all("type = 'ManageIQ::Providers::Openstack::CloudManager::CloudVolume'") - end - - def down - # Set back Openstack cloud specific STI types for miq_template under infra that provider - CloudVolume.joins('join ext_management_systems on cloud_volumes.ems_id = ext_management_systems.id') - .where(:cloud_volumes => {:type => 'ManageIQ::Providers::Openstack::CloudManager::CloudVolume'}, - :ext_management_systems => {:type => 'ManageIQ::Providers::Openstack::CloudManager'}) - .update_all("type = NULL") - end -end diff --git a/db/migrate/20151208150956_fix_host_storage_replication_on_upgrade.rb b/db/migrate/20151208150956_fix_host_storage_replication_on_upgrade.rb deleted file mode 100644 index 0755a4958..000000000 --- a/db/migrate/20151208150956_fix_host_storage_replication_on_upgrade.rb +++ /dev/null @@ -1,17 +0,0 @@ -class FixHostStorageReplicationOnUpgrade < ActiveRecord::Migration[4.2] - include MigrationHelper - - class MiqRegion < ActiveRecord::Base; end - - class HostsStorage < ActiveRecord::Base - self.table_name = "host_storages" - end - - def up - HostsStorage.delete_all if on_replication_target? - end - - def on_replication_target? - MiqRegion.select(:region).distinct.count > 1 - end -end diff --git a/db/migrate/20151209141840_create_middleware_deployments.rb b/db/migrate/20151209141840_create_middleware_deployments.rb deleted file mode 100644 index d5d4f78bf..000000000 --- a/db/migrate/20151209141840_create_middleware_deployments.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateMiddlewareDeployments < ActiveRecord::Migration[4.2] - def change - create_table :middleware_deployments do |t| - t.string :name # name of the deployment - t.string :ems_ref # path - t.string :nativeid - t.bigint :server_id - t.bigint :ems_id - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20151210154747_add_container_image_registry_to_container_service.rb b/db/migrate/20151210154747_add_container_image_registry_to_container_service.rb deleted file mode 100644 index 902b06355..000000000 --- a/db/migrate/20151210154747_add_container_image_registry_to_container_service.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContainerImageRegistryToContainerService < ActiveRecord::Migration[4.2] - def change - add_column :container_services, :container_image_registry_id, :bigint - end -end diff --git a/db/migrate/20151216095054_create_container_builds.rb b/db/migrate/20151216095054_create_container_builds.rb deleted file mode 100644 index 955706ae6..000000000 --- a/db/migrate/20151216095054_create_container_builds.rb +++ /dev/null @@ -1,49 +0,0 @@ -class CreateContainerBuilds < ActiveRecord::Migration[4.2] - def change - create_table :container_builds do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.string :resource_version - t.string :namespace - t.string :service_account - - t.string :build_source_type - t.string :source_binary - t.string :source_dockerfile - t.string :source_git - t.string :source_context_dir - t.string :source_secret - - t.string :output_name - - t.bigint :completion_deadline_seconds - - t.belongs_to :container_project, :type => :bigint - t.belongs_to :ems, :type => :bigint - end - add_index :container_builds, :ems_id - - create_table :container_build_pods do |t| - t.string :ems_ref - t.string :name - t.timestamp :creation_timestamp - t.string :resource_version - t.string :namespace - - t.string :message - t.string :phase - t.string :reason - t.string :output_docker_image_reference - t.string :completion_timestamp - t.string :start_timestamp - t.bigint :duration - - t.belongs_to :container_build, :type => :bigint - t.belongs_to :ems, :type => :bigint - end - add_index :container_build_pods, :ems_id - - add_column :container_groups, :container_build_pod_id, :bigint - end -end diff --git a/db/migrate/20151221134925_remove_sat5_repo_config.rb b/db/migrate/20151221134925_remove_sat5_repo_config.rb deleted file mode 100644 index 6096974a6..000000000 --- a/db/migrate/20151221134925_remove_sat5_repo_config.rb +++ /dev/null @@ -1,32 +0,0 @@ -class RemoveSat5RepoConfig < ActiveRecord::Migration[4.2] - class MiqDatabase < ActiveRecord::Base; end - - class Authentication < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time("Removing Sat5 update configuration") do - return unless (db = MiqDatabase.first) - - new_repos = "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms" - - if db.registration_type == "rhn_satellite" - db.update( - :registration_type => nil, - :registration_organization => nil, - :registration_server => nil, - :registration_http_proxy_server => nil, - :update_repo_name => new_repos, - :registration_organization_display_name => nil - ) - - Authentication.where( - :resource_type => 'MiqDatabase', - :resource_id => db.id, - :authtype => [:registration_http_proxy, :registration] - ).destroy_all - end - end - end -end diff --git a/db/migrate/20151222103510_add_verify_ssl_to_endpoints.rb b/db/migrate/20151222103510_add_verify_ssl_to_endpoints.rb deleted file mode 100644 index fc5458f8a..000000000 --- a/db/migrate/20151222103510_add_verify_ssl_to_endpoints.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddVerifySslToEndpoints < ActiveRecord::Migration[4.2] - def change - add_column :endpoints, :verify_ssl, :integer - end -end diff --git a/db/migrate/20151222103721_migrate_provider_attributes_to_endpoints.rb b/db/migrate/20151222103721_migrate_provider_attributes_to_endpoints.rb deleted file mode 100644 index 50acca3e2..000000000 --- a/db/migrate/20151222103721_migrate_provider_attributes_to_endpoints.rb +++ /dev/null @@ -1,44 +0,0 @@ -class MigrateProviderAttributesToEndpoints < ActiveRecord::Migration[4.2] - class Provider < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Endpoint < ActiveRecord::Base; end - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - say_with_time("Migrating Provider attributes to Endpoints") do - ExtManagementSystem.all.each do |ems| - next if ems.provider_id.nil? - provider = Provider.where(:id => ems.provider_id).first - endpoint = Endpoint.where( - :resource_type => "ExtManagementSystem", - :resource_id => ems.id).first_or_create - - endpoint.update!(:verify_ssl => provider.verify_ssl) - end - end - end - - def down - say_with_time("Migrating Endpoints to Provider attributes") do - endpoints = Endpoint.where( - :role => "default", - :resource_type => "ExtManagementSystem", - ) - - endpoints.each do |endpoint| - next if endpoint.verify_ssl.nil? - ems = ExtManagementSystem.where(:id => endpoint.resource_id).first - provider = Provider.where(:id => ems.provider_id).first - provider.update!( - :verify_ssl => endpoint.verify_ssl) - end - - Endpoint.delete_all - end - end -end diff --git a/db/migrate/20151222105242_remove_endpoint_data_from_provider.rb b/db/migrate/20151222105242_remove_endpoint_data_from_provider.rb deleted file mode 100644 index 59cafd0fd..000000000 --- a/db/migrate/20151222105242_remove_endpoint_data_from_provider.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveEndpointDataFromProvider < ActiveRecord::Migration[4.2] - def up - remove_column :providers, :verify_ssl - end - - def down - add_column :providers, :verify_ssl, :integer - end -end diff --git a/db/migrate/20151222152212_remove_vm_discover_row_from_miq_event_definitions.rb b/db/migrate/20151222152212_remove_vm_discover_row_from_miq_event_definitions.rb deleted file mode 100644 index 1d90aa956..000000000 --- a/db/migrate/20151222152212_remove_vm_discover_row_from_miq_event_definitions.rb +++ /dev/null @@ -1,14 +0,0 @@ -class RemoveVmDiscoverRowFromMiqEventDefinitions < ActiveRecord::Migration[4.2] - class Relationship < ActiveRecord::Base; end - - class MiqEventDefinition < ActiveRecord::Base; end - - def up - say_with_time("Remove event definition vm_discover") do - MiqEventDefinition.where(:name => 'vm_discover').each do |eventdef| - Relationship.where(:resource_type => 'MiqEventDefinition', :resource_id => eventdef.id).delete_all - eventdef.delete - end - end - end -end diff --git a/db/migrate/20160105170524_remove_miq_worker_command_line.rb b/db/migrate/20160105170524_remove_miq_worker_command_line.rb deleted file mode 100644 index cdadc8a4c..000000000 --- a/db/migrate/20160105170524_remove_miq_worker_command_line.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveMiqWorkerCommandLine < ActiveRecord::Migration[4.2] - def up - remove_column :miq_workers, :command_line - end - - def down - add_column :miq_workers, :command_line, :string, :limit => 512 - end -end diff --git a/db/migrate/20160108214044_add_miq_workers_miq_servers_proportional_set_size.rb b/db/migrate/20160108214044_add_miq_workers_miq_servers_proportional_set_size.rb deleted file mode 100644 index 60bf7daf6..000000000 --- a/db/migrate/20160108214044_add_miq_workers_miq_servers_proportional_set_size.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddMiqWorkersMiqServersProportionalSetSize < ActiveRecord::Migration[4.2] - def change - add_column :miq_servers, :proportional_set_size, :decimal, :precision => 20, :scale => 0 - add_column :miq_workers, :proportional_set_size, :decimal, :precision => 20, :scale => 0 - end -end diff --git a/db/migrate/20160110104053_add_claim_ref_to_container_volumes.rb b/db/migrate/20160110104053_add_claim_ref_to_container_volumes.rb deleted file mode 100644 index 664636f94..000000000 --- a/db/migrate/20160110104053_add_claim_ref_to_container_volumes.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddClaimRefToContainerVolumes < ActiveRecord::Migration[4.2] - def change - change_table :container_volumes do |t| - t.belongs_to :persistent_volume_claim, :type => :bigint - end - end -end diff --git a/db/migrate/20160114085140_add_network_router_id_to_cloud_subnet.rb b/db/migrate/20160114085140_add_network_router_id_to_cloud_subnet.rb deleted file mode 100644 index 3509b877e..000000000 --- a/db/migrate/20160114085140_add_network_router_id_to_cloud_subnet.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNetworkRouterIdToCloudSubnet < ActiveRecord::Migration[4.2] - def change - add_column :cloud_subnets, :network_router_id, :bigint - end -end diff --git a/db/migrate/20160114111114_delete_network_router_id_from_floating_ips.rb b/db/migrate/20160114111114_delete_network_router_id_from_floating_ips.rb deleted file mode 100644 index 7910e4c1f..000000000 --- a/db/migrate/20160114111114_delete_network_router_id_from_floating_ips.rb +++ /dev/null @@ -1,11 +0,0 @@ -class DeleteNetworkRouterIdFromFloatingIps < ActiveRecord::Migration[4.2] - def up - remove_index :floating_ips, :column => :network_router_id - remove_column :floating_ips, :network_router_id, :bigint - end - - def down - add_column :floating_ips, :network_router_id, :bigint - add_index :floating_ips, :network_router_id - end -end diff --git a/db/migrate/20160114153948_delete_cloud_network_id_from_network_ports.rb b/db/migrate/20160114153948_delete_cloud_network_id_from_network_ports.rb deleted file mode 100644 index a04c90f80..000000000 --- a/db/migrate/20160114153948_delete_cloud_network_id_from_network_ports.rb +++ /dev/null @@ -1,11 +0,0 @@ -class DeleteCloudNetworkIdFromNetworkPorts < ActiveRecord::Migration[4.2] - def up - remove_index :network_ports, :column => :cloud_network_id - remove_column :network_ports, :cloud_network_id, :bigint - end - - def down - add_column :network_ports, :cloud_network_id, :bigint - add_index :network_ports, :cloud_network_id - end -end diff --git a/db/migrate/20160115111829_chargeback_rate_detail_currency_not_nil.rb b/db/migrate/20160115111829_chargeback_rate_detail_currency_not_nil.rb deleted file mode 100644 index 2b0b05c30..000000000 --- a/db/migrate/20160115111829_chargeback_rate_detail_currency_not_nil.rb +++ /dev/null @@ -1,20 +0,0 @@ -class ChargebackRateDetailCurrencyNotNil < ActiveRecord::Migration[4.2] - # Migration in order to put a currency by default in rates that were added by a user before the addition of currencies - class ChargebackRateDetail < ActiveRecord::Base; end - - class ChargebackRateDetailCurrency < ActiveRecord::Base; end - - def up - chargeback_rate_details = ChargebackRateDetail.where(:chargeback_rate_detail_currency_id => nil) - if !chargeback_rate_details.count.zero? - currency = ChargebackRateDetailCurrency.find_by(:name => "Dollars") || - ChargebackRateDetailCurrency.create(:code => "USD", - :name => "Dollars", - :full_name => "United States Dollars", - :symbol => "$", - :unicode_hex => "36" - ) - chargeback_rate_details.update_all(:chargeback_rate_detail_currency_id => currency.id) - end - end -end diff --git a/db/migrate/20160115142023_remove_replicated_rows_from_newly_excluded_tables.rb b/db/migrate/20160115142023_remove_replicated_rows_from_newly_excluded_tables.rb deleted file mode 100644 index a422816b6..000000000 --- a/db/migrate/20160115142023_remove_replicated_rows_from_newly_excluded_tables.rb +++ /dev/null @@ -1,25 +0,0 @@ -class RemoveReplicatedRowsFromNewlyExcludedTables < ActiveRecord::Migration[4.2] - class MiqEventDefinition < ActiveRecord::Base; end - - class ScanItem < ActiveRecord::Base; end - - class Configuration < ActiveRecord::Base - serialize :settings, Hash - end - - def up - say_with_time("Removing rows from newly excluded tables") do - region_cond = anonymous_class_with_id_regions.region_to_conditions(anonymous_class_with_id_regions.my_region_number) - MiqEventDefinition.where.not(region_cond).delete_all - ScanItem.where.not(region_cond).delete_all - end - - say_with_time("Adding tables to replication worker exclude list") do - Configuration.where(:typ => "vmdb").each do |c| - c.settings.deep_symbolize_keys![:workers][:worker_base][:replication_worker][:replication][:exclude_tables] << - MiqEventDefinition.table_name << ScanItem.table_name - c.save! - end - end - end -end diff --git a/db/migrate/20160119125950_add_created_on_for_container_entities.rb b/db/migrate/20160119125950_add_created_on_for_container_entities.rb deleted file mode 100644 index d1eba809b..000000000 --- a/db/migrate/20160119125950_add_created_on_for_container_entities.rb +++ /dev/null @@ -1,44 +0,0 @@ -class AddCreatedOnForContainerEntities < ActiveRecord::Migration[4.2] - class ContainerNode < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class ContainerProject < ActiveRecord::Base; end - - class ContainerService < ActiveRecord::Base; end - - class ContainerRoute < ActiveRecord::Base; end - - class ContainerGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class ContainerReplicator < ActiveRecord::Base; end - - class ContainerQuota < ActiveRecord::Base; end - - class ContainerBuild < ActiveRecord::Base; end - - class ContainerBuildPod < ActiveRecord::Base; end - - class ContainerLimit < ActiveRecord::Base; end - - class ContainerVolume < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - CONTAINER_MODELS = [ContainerNode, ContainerProject, ContainerService, ContainerRoute, ContainerGroup, - ContainerReplicator, ContainerQuota, ContainerBuild, ContainerBuildPod, ContainerLimit, - ContainerVolume].freeze - - def change - CONTAINER_MODELS.each do |model| - add_column model.table_name, :created_on, :datetime - rename_column model.table_name, :creation_timestamp, :ems_created_on - - say_with_time("adding created_on datetime to all existing #{model}") do - model.update_all("created_on=ems_created_on") - end - end - end -end diff --git a/db/migrate/20160120151045_add_url_to_endpoints.rb b/db/migrate/20160120151045_add_url_to_endpoints.rb deleted file mode 100644 index 5493566c1..000000000 --- a/db/migrate/20160120151045_add_url_to_endpoints.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddUrlToEndpoints < ActiveRecord::Migration[4.2] - def change - add_column :endpoints, :url, :string - end -end diff --git a/db/migrate/20160120151642_migrate_url_from_provider_to_endpoints.rb b/db/migrate/20160120151642_migrate_url_from_provider_to_endpoints.rb deleted file mode 100644 index 0dd72107b..000000000 --- a/db/migrate/20160120151642_migrate_url_from_provider_to_endpoints.rb +++ /dev/null @@ -1,46 +0,0 @@ -class MigrateUrlFromProviderToEndpoints < ActiveRecord::Migration[4.2] - class Provider < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Endpoint < ActiveRecord::Base; end - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - Endpoint.connection.schema_cache.clear! - Endpoint.reset_column_information - say_with_time("Migrating Provider URL attribute to Endpoints") do - ExtManagementSystem.all.each do |ems| - next if ems.provider_id.nil? - provider = Provider.where(:id => ems.provider_id).first - endpoint = Endpoint.where( - :resource_type => "Provider", - :resource_id => ems.id).first_or_create - - endpoint.update!(:url => provider.url) - end - end - end - - def down - say_with_time("Migrating Endpoints URL to Provider") do - endpoints = Endpoint.where( - :role => "default", - :resource_type => "Provider", - ) - - endpoints.each do |endpoint| - next if endpoint.url.nil? - ems = ExtManagementSystem.where(:id => endpoint.resource_id).first - provider = Provider.where(:id => ems.provider_id).first - provider.update!( - :url => endpoint.url) - end - - Endpoint.delete_all - end - end -end diff --git a/db/migrate/20160126151325_add_disk_and_memory_minimum_to_hardware.rb b/db/migrate/20160126151325_add_disk_and_memory_minimum_to_hardware.rb deleted file mode 100644 index 688799765..000000000 --- a/db/migrate/20160126151325_add_disk_and_memory_minimum_to_hardware.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddDiskAndMemoryMinimumToHardware < ActiveRecord::Migration[4.2] - def change - add_column :hardwares, :disk_size_minimum, :integer, :limit => 8 - add_column :hardwares, :memory_mb_minimum, :integer, :limit => 8 - end -end diff --git a/db/migrate/20160127210622_migrate_old_configuration_settings.rb b/db/migrate/20160127210622_migrate_old_configuration_settings.rb deleted file mode 100644 index 0020c489c..000000000 --- a/db/migrate/20160127210622_migrate_old_configuration_settings.rb +++ /dev/null @@ -1,120 +0,0 @@ -class MigrateOldConfigurationSettings < ActiveRecord::Migration[4.2] - class Configuration < ActiveRecord::Base - serialize :settings, Hash - end - - def up - update_methods = private_methods(false) - - say_with_time("Migrating old configuration settings") do - Configuration.where(:typ => "vmdb").each do |config| - hash = config.settings.deep_symbolize_keys - update_methods.each { |m| send(m, hash) } - config.update!(:settings => hash) - end - end - end - - private - - def update_old_perf_processor_worker_settings!(config) - old_path = %i(workers worker_base queue_worker_base perf_processor_worker) - new_path = %i(workers worker_base queue_worker_base ems_metrics_processor_worker) - - settings = config.fetch_path(*old_path) - return if settings.nil? - - settings = {:defaults => settings} - - config.delete_path(*old_path) - config.store_path(new_path, settings) - end - - def update_old_perf_collector_worker_settings!(config) - old_path = %i(workers worker_base queue_worker_base perf_collector_worker) - new_path = %i(workers worker_base queue_worker_base ems_metrics_collector_worker) - - settings = config.fetch_path(*old_path) - return if settings.nil? - - keys = %i( - ems_metrics_collector_worker_amazon - ems_metrics_collector_worker_redhat - ems_metrics_collector_worker_vmware - ems_metrics_collector_worker_openstack - ems_metrics_collector_worker_kubernetes - ) - keys.each { |key| settings.delete(key) } - settings = {:defaults => settings} - - config.delete_path(*old_path) - config.store_path(new_path, settings) - end - - def update_old_ui_worker_settings!(config) - return if config.fetch_path(:workers, :worker_base, :ui_worker) - - roles = config.fetch_path(:server, :role).split(',') - return if roles.include?('user_interface') - - roles << 'user_interface' - config.store_path(:server, :role, roles.sort.join(',')) - end - - def update_old_web_service_worker_settings!(config) - return if config.fetch_path(:workers, :worker_base, :web_service_worker) - - roles = config.fetch_path(:server, :role).split(',') - return if roles.include?('web_services') - - roles << 'web_services' - config.store_path(:server, :role, roles.sort.join(',')) - end - - def update_old_event_catcher_settings!(config) - path = %i(workers worker_base event_catcher) - - settings = config.fetch_path(*path) - return if settings.try(:key?, :defaults) - - keys = %i( - event_catcher_redhat - event_catcher_vmware - event_catcher_openstack - ) - keys.each { |key| settings.delete(key) } - settings = {:defaults => settings} - - config.store_path(path, settings) - end - - def update_old_ems_refresh_worker_settings!(config) - path = %i(workers worker_base queue_worker_base ems_refresh_worker) - - settings = config.fetch_path(*path) - return if settings.try(:key?, :defaults) - - keys = %i( - ems_refresh_worker_ansible_tower_configuration - ems_refresh_worker_atomic - ems_refresh_worker_atomic_enterprise - ems_refresh_worker_azure - ems_refresh_worker_ec2 - ems_refresh_worker_foreman_configuration - ems_refresh_worker_foreman_provisioning - ems_refresh_worker_gce - ems_refresh_worker_kubernetes - ems_refresh_worker_openshift - ems_refresh_worker_openshift_enterprise - ems_refresh_worker_openstack - ems_refresh_worker_openstack_infra - ems_refresh_worker_rhevm - ems_refresh_worker_scvmm - ems_refresh_worker_vmwarews - ) - keys.each { |key| settings.delete(key) } - settings = {:defaults => settings} - - config.store_path(path, settings) - end -end diff --git a/db/migrate/20160127210623_create_settings_changes_table.rb b/db/migrate/20160127210623_create_settings_changes_table.rb deleted file mode 100644 index 593237fdf..000000000 --- a/db/migrate/20160127210623_create_settings_changes_table.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateSettingsChangesTable < ActiveRecord::Migration[4.2] - def up - create_table :settings_changes do |t| - t.belongs_to :resource, :type => :bigint, :polymorphic => true - t.string :key - t.text :value - t.timestamps :null => false - end - add_index :settings_changes, :key - add_index :settings_changes, [:resource_id, :resource_type] - end - - def down - drop_table :settings_changes - end -end diff --git a/db/migrate/20160127210624_convert_configurations_to_settings_changes.rb b/db/migrate/20160127210624_convert_configurations_to_settings_changes.rb deleted file mode 100644 index a5d3625d5..000000000 --- a/db/migrate/20160127210624_convert_configurations_to_settings_changes.rb +++ /dev/null @@ -1,92 +0,0 @@ -class ConvertConfigurationsToSettingsChanges < ActiveRecord::Migration[4.2] - class Configuration < ActiveRecord::Base - serialize :settings - end - - class SettingsChange < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - serialize :value - end - - def up - say_with_time("Migrating configuration changes") do - deltas = Configuration.where(:typ => TEMPLATES.keys).all.flat_map { |f| full_to_deltas(f) } - deltas.each { |d| SettingsChange.create!(d) } - end - end - - private - - def full_to_deltas(full_config) - config = full_config.settings.deep_symbolize_keys - config_type = full_config.typ - - adjust_config!(config_type, config) - - deltas = HashDiffer.changes(TEMPLATES[config_type], config) - deltas.each do |d| - d.merge!( - :resource_type => "MiqServer", - :resource_id => full_config.miq_server_id, - :created_at => full_config.created_on, - :updated_at => full_config.updated_on, - ) - d[:key] = "/#{config_type}#{d[:key]}" unless config_type == "vmdb" - end - end - - def adjust_config!(type, config) - case type - when "broker_notify_properties" - # Convert the various exclude sections from a Hash like - # {:key1 => nil, :key2 => nil} to an Array like ["key1", "key2"] - excludes = config[:exclude] - excludes.keys.each { |k| excludes[k] = excludes[k].keys.collect(&:to_s) } - end - end - - DATA_DIR = Pathname.new(__dir__).join("data", File.basename(__FILE__, ".rb")) - TEMPLATES = Dir.glob(DATA_DIR.join("*.tmpl.yml")).sort.each_with_object({}) do |f, h| - h[File.basename(f, ".tmpl.yml")] = YAML.load_file(f).deep_symbolize_keys - end - - # Copied from Vmdb::Settings::HashDiffer to keep a snapshot of it for this migration - # Inspired by http://stackoverflow.com/questions/1766741/comparing-ruby-hashes/7178108#7178108 - class HashDiffer - class MissingKey; end - - def self.changes(h1, h2) - diff_to_deltas(diff(h1, h2)) - end - - def self.diff(h1, h2) - keys = (h1.keys + h2.keys).uniq - keys.each_with_object({}) do |k, result| - v1 = h1.key?(k) ? h1[k] : MissingKey - v2 = h2.key?(k) ? h2[k] : MissingKey - next if v1 == v2 - - child = - if v1.kind_of?(Hash) && v2.kind_of?(Hash) - diff(v1, v2) - else - v2 - end - - result[k] = child if child != MissingKey - end - end - - def self.diff_to_deltas(diff, key_path = "") - diff.flat_map do |k, v| - new_key_path = [key_path, k].join("/") - case v - when Hash - diff_to_deltas(v, new_key_path) - else - {:key => new_key_path, :value => v} - end - end.compact - end - end -end diff --git a/db/migrate/20160127210625_remove_configurations.rb b/db/migrate/20160127210625_remove_configurations.rb deleted file mode 100644 index f5482c094..000000000 --- a/db/migrate/20160127210625_remove_configurations.rb +++ /dev/null @@ -1,16 +0,0 @@ -class RemoveConfigurations < ActiveRecord::Migration[4.2] - def up - drop_table :configurations - end - - def down - create_table :configurations do |t| - t.belongs_to :miq_server, :type => :bigint - t.string :typ - t.text :settings - t.datetime :created_on - t.datetime :updated_on - end - add_index :configurations, :miq_server_id - end -end diff --git a/db/migrate/20160127210705_create_configuration_script.rb b/db/migrate/20160127210705_create_configuration_script.rb deleted file mode 100644 index 1f6491d10..000000000 --- a/db/migrate/20160127210705_create_configuration_script.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateConfigurationScript < ActiveRecord::Migration[4.2] - def change - create_table :configuration_scripts do |t| - t.belongs_to :configuration_manager, :type => :bigint - - t.string :manager_ref - t.string :name - t.string :description - t.text :variables - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20160202200713_create_generic_object.rb b/db/migrate/20160202200713_create_generic_object.rb deleted file mode 100644 index dddb2016c..000000000 --- a/db/migrate/20160202200713_create_generic_object.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateGenericObject < ActiveRecord::Migration[4.2] - def change - create_table :generic_object_definitions do |t| - t.string :name - t.string :description - t.text :properties - t.timestamps :null => false - end - - create_table :generic_objects do |t| - t.string :name - t.string :uid - t.belongs_to :generic_object_definition, :type => :bigint - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20160203101130_add_orderable_to_orchestration_templates.rb b/db/migrate/20160203101130_add_orderable_to_orchestration_templates.rb deleted file mode 100644 index 3c576d2db..000000000 --- a/db/migrate/20160203101130_add_orderable_to_orchestration_templates.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AddOrderableToOrchestrationTemplates < ActiveRecord::Migration[4.2] - class OrchestrationTemplate < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def self.up - add_column :orchestration_templates, :orderable, :boolean - - say_with_time("Update OrchestrationTemplate orderable") do - OrchestrationTemplate.update_all(:orderable => true) - end - end - - def self.down - remove_column :orchestration_templates, :orderable - end -end diff --git a/db/migrate/20160203162135_add_deletion_time_for_container_archivables.rb b/db/migrate/20160203162135_add_deletion_time_for_container_archivables.rb deleted file mode 100644 index 0bd19adfb..000000000 --- a/db/migrate/20160203162135_add_deletion_time_for_container_archivables.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddDeletionTimeForContainerArchivables < ActiveRecord::Migration[4.2] - def change - add_column :container_projects, :deleted_on, :datetime - add_column :container_projects, :old_ems_id, :bigint - add_column :container_groups, :deleted_on, :datetime - add_column :container_groups, :old_ems_id, :bigint - add_column :container_definitions, :deleted_on, :datetime - add_column :containers, :deleted_on, :datetime - end -end diff --git a/db/migrate/20160209124055_create_service_orders.rb b/db/migrate/20160209124055_create_service_orders.rb deleted file mode 100644 index ec6503746..000000000 --- a/db/migrate/20160209124055_create_service_orders.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateServiceOrders < ActiveRecord::Migration[4.2] - def change - create_table :service_orders do |t| - t.string :name - t.bigint :tenant_id - t.bigint :user_id - t.string :user_name - t.string :state - t.datetime :created_at - t.datetime :updated_at - t.datetime :placed_at - end - end -end diff --git a/db/migrate/20160209130938_add_service_order_to_miq_request.rb b/db/migrate/20160209130938_add_service_order_to_miq_request.rb deleted file mode 100644 index ef151192b..000000000 --- a/db/migrate/20160209130938_add_service_order_to_miq_request.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddServiceOrderToMiqRequest < ActiveRecord::Migration[4.2] - def change - add_column :miq_requests, :service_order_id, :bigint - end -end diff --git a/db/migrate/20160211113430_create_cloud_databases.rb b/db/migrate/20160211113430_create_cloud_databases.rb deleted file mode 100644 index 2f1b5561f..000000000 --- a/db/migrate/20160211113430_create_cloud_databases.rb +++ /dev/null @@ -1,39 +0,0 @@ -class CreateCloudDatabases < ActiveRecord::Migration[4.2] - def change - create_table :cloud_database_flavors do |t| - t.string :name - t.string :type - t.string :ems_ref - t.integer :cpus - t.bigint :memory - t.bigint :max_size - t.integer :max_connections - t.string :performance - t.boolean :enabled - - t.belongs_to :ems, :type => :bigint - end - - add_index :cloud_database_flavors, :ems_id - - create_table :cloud_databases do |t| - t.string :name - t.string :type - t.string :ems_ref - t.string :db_engine - t.string :status - t.string :status_reason - t.bigint :used_storage - t.bigint :max_storage - t.text :extra_attributes - - t.belongs_to :ems, :type => :bigint - t.belongs_to :resource_group, :type => :bigint - t.belongs_to :cloud_database_flavor, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - end - - add_index :cloud_databases, :ems_id - add_index :cloud_databases, :cloud_database_flavor_id - end -end diff --git a/db/migrate/20160214115800_inline_ems_id.rb b/db/migrate/20160214115800_inline_ems_id.rb deleted file mode 100644 index 813ac1660..000000000 --- a/db/migrate/20160214115800_inline_ems_id.rb +++ /dev/null @@ -1,47 +0,0 @@ -class InlineEmsId < ActiveRecord::Migration[4.2] - class ContainerDefinition < ActiveRecord::Base; end - - class ContainerGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Container < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - - belongs_to :container_definition, :class_name => "InlineEmsId::ContainerDefinition" - has_one :container_group, :through => :container_definition, :class_name => "InlineEmsId::ContainerGroup" - end - - class ContainerDefinition < ActiveRecord::Base - belongs_to :container_group, :class_name => "InlineEmsId::ContainerGroup" - end - - def up - add_columns - update_columns - end - - def add_columns - add_column :containers, :ems_id, :bigint - add_column :container_definitions, :ems_id, :bigint - end - - def update_columns - say_with_time("Inline ems_id in containers") do - Container.includes(:container_definition => :container_group).all.each do |container| - container.update_attribute(:ems_id, container.container_group.ems_id) - end - end - - say_with_time("add ems_id to container definitions") do - ContainerDefinition.includes(:container_group).all.each do |container_definition| - container_definition.update_attribute(:ems_id, container_definition.container_group.ems_id) - end - end - end - - def down - remove_column :containers, :ems_id - remove_column :container_definitions, :ems_id - end -end diff --git a/db/migrate/20160219190002_add_type_to_ems_folders.rb b/db/migrate/20160219190002_add_type_to_ems_folders.rb deleted file mode 100644 index eca0dc854..000000000 --- a/db/migrate/20160219190002_add_type_to_ems_folders.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddTypeToEmsFolders < ActiveRecord::Migration[5.0] - def change - add_column :ems_folders, :type, :string - end -end diff --git a/db/migrate/20160220123313_add_open_scap_result_entities.rb b/db/migrate/20160220123313_add_open_scap_result_entities.rb deleted file mode 100644 index 4c6189414..000000000 --- a/db/migrate/20160220123313_add_open_scap_result_entities.rb +++ /dev/null @@ -1,16 +0,0 @@ -class AddOpenScapResultEntities < ActiveRecord::Migration[4.2] - def change - create_table :openscap_results do |t| - t.belongs_to :container_image, :type => :bigint - t.datetime :created_at - end - add_index :openscap_results, :container_image_id - create_table :openscap_rule_results do |t| - t.belongs_to :openscap_result, :type => :bigint - t.string :name - t.string :result - t.string :severity - end - add_index :openscap_rule_results, :openscap_result_id - end -end diff --git a/db/migrate/20160222161500_add_parent_ems_id_to_ext_management_system.rb b/db/migrate/20160222161500_add_parent_ems_id_to_ext_management_system.rb deleted file mode 100644 index 8d6bf889b..000000000 --- a/db/migrate/20160222161500_add_parent_ems_id_to_ext_management_system.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddParentEmsIdToExtManagementSystem < ActiveRecord::Migration[5.0] - def change - add_column :ext_management_systems, :parent_ems_id, :bigint - - add_index :ext_management_systems, :parent_ems_id - end -end diff --git a/db/migrate/20160223085416_add_stat_containergroup_create_rate.rb b/db/migrate/20160223085416_add_stat_containergroup_create_rate.rb deleted file mode 100644 index 8c6aefb98..000000000 --- a/db/migrate/20160223085416_add_stat_containergroup_create_rate.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddStatContainergroupCreateRate < ActiveRecord::Migration[5.0] - def change - add_column :metric_rollups, :stat_containergroup_create_rate, :integer - add_column :metric_rollups, :stat_containergroup_delete_rate, :integer - end -end diff --git a/db/migrate/20160224224115_remove_filters_from_users.rb b/db/migrate/20160224224115_remove_filters_from_users.rb deleted file mode 100644 index 23000ab48..000000000 --- a/db/migrate/20160224224115_remove_filters_from_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveFiltersFromUsers < ActiveRecord::Migration[5.0] - def change - remove_column :users, :filters, :text - end -end diff --git a/db/migrate/20160225033835_remove_resource_id_and_resource_type_from_miq_groups.rb b/db/migrate/20160225033835_remove_resource_id_and_resource_type_from_miq_groups.rb deleted file mode 100644 index aae530220..000000000 --- a/db/migrate/20160225033835_remove_resource_id_and_resource_type_from_miq_groups.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveResourceIdAndResourceTypeFromMiqGroups < ActiveRecord::Migration[5.0] - def change - remove_column :miq_groups, :resource_id, :bigint - remove_column :miq_groups, :resource_type, :string - end -end diff --git a/db/migrate/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager.rb b/db/migrate/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager.rb deleted file mode 100644 index cdbe8fb9a..000000000 --- a/db/migrate/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager.rb +++ /dev/null @@ -1,88 +0,0 @@ -class SeparateOpenstackNetworkManagerFromOpenstackCloudManager < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkPort < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkRouter < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class FloatingIp < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class SecurityGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def affected_classes - [CloudNetwork, CloudSubnet, NetworkPort, NetworkRouter, FloatingIp, SecurityGroup] - end - - def up - # Separate NetworkManager from CloudManager and move network models under NetworkManager - ExtManagementSystem.connection.schema_cache.clear! - ExtManagementSystem.reset_column_information - ExtManagementSystem - .joins('left join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => ['ManageIQ::Providers::Openstack::CloudManager', - 'ManageIQ::Providers::Openstack::InfraManager']}, - :network_manager => {:parent_ems_id => nil}).each do |cloud_manager| - network_manager = ExtManagementSystem.create!( - :type => 'ManageIQ::Providers::Openstack::NetworkManager', - :name => "#{cloud_manager.name} Network Manager", - :parent_ems_id => cloud_manager.id, - :guid => SecureRandom.uuid) - - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => cloud_manager.id) - .update_all("type = 'ManageIQ::Providers::Openstack::NetworkManager::#{network_model_class.name.demodulize}', ems_id = '#{network_manager.id}'") - end - end - end - - def down - # Move NetworkManager models back from CloudManager and delete NetworkManager - ExtManagementSystem - .joins('join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Openstack::CloudManager'}).each do |cloud_manager| - - network_manager = ExtManagementSystem.where(:parent_ems_id => cloud_manager.id).first - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => network_manager.id) - .update_all("type = 'ManageIQ::Providers::Openstack::CloudManager::#{network_model_class.name.demodulize}', ems_id = '#{cloud_manager.id}'") - end - - network_manager.destroy - end - - # Move NetworkManager models back from InfraManager and delete NetworkManager - ExtManagementSystem - .joins('join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Openstack::InfraManager'}).each do |cloud_manager| - network_manager = ExtManagementSystem.where(:parent_ems_id => cloud_manager.id).first - - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => network_manager.id) - .update_all("type = 'ManageIQ::Providers::Openstack::InfraManager::#{network_model_class.name.demodulize}', ems_id = '#{cloud_manager.id}'") - end - - network_manager.destroy - end - end -end diff --git a/db/migrate/20160226164206_remove_guid_from_miq_groups.rb b/db/migrate/20160226164206_remove_guid_from_miq_groups.rb deleted file mode 100644 index ddc564734..000000000 --- a/db/migrate/20160226164206_remove_guid_from_miq_groups.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveGuidFromMiqGroups < ActiveRecord::Migration[5.0] - def change - remove_column :miq_groups, :guid, :string, :limit => 36 - end -end diff --git a/db/migrate/20160301111647_remove_rate_column_from_chargeback_rate_detail.rb b/db/migrate/20160301111647_remove_rate_column_from_chargeback_rate_detail.rb deleted file mode 100644 index 9406e6f36..000000000 --- a/db/migrate/20160301111647_remove_rate_column_from_chargeback_rate_detail.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveRateColumnFromChargebackRateDetail < ActiveRecord::Migration[4.2] - def change - remove_column :chargeback_rate_details, :rate, :string - end -end diff --git a/db/migrate/20160301164102_add_survey_specs_to_configuration_scripts.rb b/db/migrate/20160301164102_add_survey_specs_to_configuration_scripts.rb deleted file mode 100644 index fd8fe06d8..000000000 --- a/db/migrate/20160301164102_add_survey_specs_to_configuration_scripts.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSurveySpecsToConfigurationScripts < ActiveRecord::Migration[5.0] - def change - add_column :configuration_scripts, :survey_spec, :text - end -end diff --git a/db/migrate/20160302203922_remove_is_datacenter_from_ems_folder.rb b/db/migrate/20160302203922_remove_is_datacenter_from_ems_folder.rb deleted file mode 100644 index e3f1ed290..000000000 --- a/db/migrate/20160302203922_remove_is_datacenter_from_ems_folder.rb +++ /dev/null @@ -1,24 +0,0 @@ -class RemoveIsDatacenterFromEmsFolder < ActiveRecord::Migration[5.0] - class EmsFolder < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - # Go through all existing EmsFolder records and set :type => Datacenter - # if the is_datacenter column is true before deleting it - say_with_time("Set type column for EmsFolders") do - EmsFolder.where(:is_datacenter => true).update_all(:type => "Datacenter") - end - - remove_column :ems_folders, :is_datacenter - end - - def down - add_column :ems_folders, :is_datacenter, :boolean - - say_with_time("Set is_datacenter for EmsFolders") do - EmsFolder.where("type != 'Datacenter' OR type is NULL").update_all(:is_datacenter => false) - EmsFolder.where(:type => "Datacenter").update_all(:is_datacenter => true) - end - end -end diff --git a/db/migrate/20160302214232_add_inventory_root_group_id_to_configured_systems.rb b/db/migrate/20160302214232_add_inventory_root_group_id_to_configured_systems.rb deleted file mode 100644 index f06ef8c68..000000000 --- a/db/migrate/20160302214232_add_inventory_root_group_id_to_configured_systems.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddInventoryRootGroupIdToConfiguredSystems < ActiveRecord::Migration[5.0] - def change - add_column :configured_systems, :inventory_root_group_id, :bigint - end -end diff --git a/db/migrate/20160303115326_add_websocket_to_miq_server.rb b/db/migrate/20160303115326_add_websocket_to_miq_server.rb deleted file mode 100644 index c51ba0fbf..000000000 --- a/db/migrate/20160303115326_add_websocket_to_miq_server.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddWebsocketToMiqServer < ActiveRecord::Migration[5.0] - def change - add_column :miq_servers, :has_active_websocket, :boolean - end -end diff --git a/db/migrate/20160307205816_fix_event_class_for_evm_alert_event.rb b/db/migrate/20160307205816_fix_event_class_for_evm_alert_event.rb deleted file mode 100644 index b71080209..000000000 --- a/db/migrate/20160307205816_fix_event_class_for_evm_alert_event.rb +++ /dev/null @@ -1,45 +0,0 @@ -class FixEventClassForEvmAlertEvent < ActiveRecord::Migration[4.2] - class EventStream < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class EmsCluster < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Host < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class Vm < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - say_with_time("Converting event class for EVMAlertEvent to MiqEvent") do - EventStream.where(:type => 'EmsEvent', :event_type => 'EVMAlertEvent').find_each do |event| - attrs = {:type => 'MiqEvent'} - - if event.ems_cluster_id - attrs[:target_type] = 'EmsCluster' - attrs[:target_id] = event.ems_cluster_id - elsif event.vm_or_template_id - attrs[:target_type] = 'VmOrTemplate' - attrs[:target_id] = event.vm_or_template_id - elsif event.host_id && event.vm_or_template_id.nil? - attrs[:target_type] = 'Host' - attrs[:target_id] = event.host_id - end - event.update(attrs) - end - end - end - - def down - say_with_time("Converting event class for EVMAlertEvent to EmsEvent") do - EventStream.where(:type => 'MiqEvent', :event_type => 'EVMAlertEvent').update_all( - :type => 'EmsEvent', :target_id => nil, :target_type => nil - ) - end - end -end diff --git a/db/migrate/20160308093819_add_security_protocol_to_endpoints.rb b/db/migrate/20160308093819_add_security_protocol_to_endpoints.rb deleted file mode 100644 index 84f13b5c9..000000000 --- a/db/migrate/20160308093819_add_security_protocol_to_endpoints.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSecurityProtocolToEndpoints < ActiveRecord::Migration[5.0] - def change - add_column :endpoints, :security_protocol, :string - end -end diff --git a/db/migrate/20160308093916_migrate_security_protocol_atribute_to_endpoints.rb b/db/migrate/20160308093916_migrate_security_protocol_atribute_to_endpoints.rb deleted file mode 100644 index 73ee68600..000000000 --- a/db/migrate/20160308093916_migrate_security_protocol_atribute_to_endpoints.rb +++ /dev/null @@ -1,39 +0,0 @@ -class MigrateSecurityProtocolAtributeToEndpoints < ActiveRecord::Migration[5.0] - class Endpoint < ActiveRecord::Base; end - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - say_with_time("Migrating Security Protocol attribute to Endpoints") do - ExtManagementSystem.all.each do |ems| - next if ems.security_protocol.nil? - endpoint = Endpoint.where( - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :role => "default").first_or_create - - endpoint.update!(:security_protocol => ems.security_protocol) - end - end - end - - def down - say_with_time("Migrating Endpoints Security Protocol attribute to EMS") do - endpoints = Endpoint.where( - :role => "default", - :resource_type => "ExtManagementSystem", - ) - - endpoints.each do |endpoint| - next if endpoint.security_protocol.nil? - ems = ExtManagementSystem.where(:id => endpoint.resource_id).first - ems.update!( - :security_protocol => endpoint.security_protocol) - end - - Endpoint.delete_all - end - end -end diff --git a/db/migrate/20160308093935_remove_security_protocol_from_ems.rb b/db/migrate/20160308093935_remove_security_protocol_from_ems.rb deleted file mode 100644 index fd905683d..000000000 --- a/db/migrate/20160308093935_remove_security_protocol_from_ems.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveSecurityProtocolFromEms < ActiveRecord::Migration[5.0] - def up - remove_column :ext_management_systems, :security_protocol - end - - def down - add_column :ext_management_systems, :security_protocol, :string - end -end diff --git a/db/migrate/20160308162644_add_cloud_subnets_network_ports_table.rb b/db/migrate/20160308162644_add_cloud_subnets_network_ports_table.rb deleted file mode 100644 index 812b46eb2..000000000 --- a/db/migrate/20160308162644_add_cloud_subnets_network_ports_table.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddCloudSubnetsNetworkPortsTable < ActiveRecord::Migration[5.0] - def change - create_table :cloud_subnets_network_ports do |t| - t.belongs_to :cloud_subnet, :type => :bigint - t.belongs_to :network_port, :type => :bigint - t.string :address - end - - add_index :cloud_subnets_network_ports, ["cloud_subnet_id", "network_port_id"], :name => "index_cloud_subnets_network_ports", :unique => true - end -end diff --git a/db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb b/db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb deleted file mode 100644 index e1fc32739..000000000 --- a/db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb +++ /dev/null @@ -1,35 +0,0 @@ -class MoveNetworkPortCloudSubnetIdToNetworkPortsCloudSubnets < ActiveRecord::Migration[5.0] - class NetworkPort < ActiveRecord::Base - include ActiveRecord::IdRegions - - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnetNetworkPort < ActiveRecord::Base - self.table_name = "cloud_subnets_network_ports" - end - - def up - # Move NetworkPort belongs_to :cloud_subnet to NetworkPort has_many :cloud_subnets, :through => :cloud_subnet_network_port - NetworkPort.in_my_region.find_each do |network_port| - CloudSubnetNetworkPort.create!( - :cloud_subnet_id => network_port.cloud_subnet_id, - :network_port_id => network_port.id) - end - end - - def down - # Move NetworkPort belongs_to :cloud_subnet to NetworkPort has_many :cloud_subnets, :through => :cloud_subnet_network_port - NetworkPort.in_my_region.find_each do |network_port| - cloud_subnet_network_port = CloudSubnetNetworkPort.find_by(:network_port_id => network_port.id) - if cloud_subnet_network_port - network_port.update!(:cloud_subnet_id => cloud_subnet_network_port.cloud_subnet_id) - cloud_subnet_network_port.destroy - end - end - end -end diff --git a/db/migrate/20160308165331_remove_cloud_subnet_id_from_network_port.rb b/db/migrate/20160308165331_remove_cloud_subnet_id_from_network_port.rb deleted file mode 100644 index fd3b9d486..000000000 --- a/db/migrate/20160308165331_remove_cloud_subnet_id_from_network_port.rb +++ /dev/null @@ -1,10 +0,0 @@ -class RemoveCloudSubnetIdFromNetworkPort < ActiveRecord::Migration[5.0] - def up - remove_column :network_ports, :cloud_subnet_id - end - - def down - add_column :network_ports, :cloud_subnet_id, :bigint - add_index :network_ports, :cloud_subnet_id - end -end diff --git a/db/migrate/20160309144534_create_system_consoles.rb b/db/migrate/20160309144534_create_system_consoles.rb deleted file mode 100644 index 4158d9a94..000000000 --- a/db/migrate/20160309144534_create_system_consoles.rb +++ /dev/null @@ -1,19 +0,0 @@ -class CreateSystemConsoles < ActiveRecord::Migration[5.0] - def change - create_table :system_consoles do |t| - t.string :url_secret - t.string :host_name - t.integer :port - t.boolean :ssl - t.string :protocol - t.string :secret - t.boolean :opened - t.belongs_to :vm, :type => :bigint - t.belongs_to :user, :type => :bigint - - t.timestamps - end - - add_index :system_consoles, :url_secret, :unique => true - end -end diff --git a/db/migrate/20160309223941_add_process_to_miq_requests.rb b/db/migrate/20160309223941_add_process_to_miq_requests.rb deleted file mode 100644 index ea30b6056..000000000 --- a/db/migrate/20160309223941_add_process_to_miq_requests.rb +++ /dev/null @@ -1,16 +0,0 @@ -class AddProcessToMiqRequests < ActiveRecord::Migration[5.0] - class MiqRequest < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - add_column :miq_requests, :process, :boolean - say_with_time("Update process attribute") do - MiqRequest.update_all(:process => true) - end - end - - def down - remove_column :miq_requests, :process - end -end diff --git a/db/migrate/20160310170333_add_service_ancestry.rb b/db/migrate/20160310170333_add_service_ancestry.rb deleted file mode 100644 index a3b9c5ed1..000000000 --- a/db/migrate/20160310170333_add_service_ancestry.rb +++ /dev/null @@ -1,38 +0,0 @@ -class AddServiceAncestry < ActiveRecord::Migration[5.0] - class Service < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def update_service_parent(parent) - ancestry = [parent.ancestry.presence, parent.id].compact.join("/") if parent - Service.where(:service_id => parent.try(:id)).each do |svc| - svc.update(:ancestry => ancestry) if ancestry - update_service_parent(svc) - end - end - - def up - add_column :services, :ancestry, :string - add_index :services, :ancestry - - say_with_time("Converting Services from service_id ancestry") do - update_service_parent(nil) - end - - remove_column :services, :service_id - end - - def down - add_column :services, :service_id, :bigint - add_index :services, :service_id - - say_with_time("Converting Services from ancestry to service_id") do - Service.all.each do |service| - parent_service_id = service.ancestry.split("/").last.to_i if service.ancestry.present? - service.update(:service_id => parent_service_id) - end - end - - remove_column :services, :ancestry - end -end diff --git a/db/migrate/20160311155237_create_entitlements.rb b/db/migrate/20160311155237_create_entitlements.rb deleted file mode 100644 index 0024f0b95..000000000 --- a/db/migrate/20160311155237_create_entitlements.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateEntitlements < ActiveRecord::Migration[5.0] - def change - create_table :entitlements do |t| - t.bigint :miq_group_id - t.bigint :miq_user_role_id - - t.timestamps - end - end -end diff --git a/db/migrate/20160311222150_create_git_repositories.rb b/db/migrate/20160311222150_create_git_repositories.rb deleted file mode 100644 index b304b68dc..000000000 --- a/db/migrate/20160311222150_create_git_repositories.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateGitRepositories < ActiveRecord::Migration[5.0] - def change - create_table :git_repositories do |t| - t.string :name - t.string :url - t.timestamp :last_refresh_on - t.integer :verify_ssl - - t.timestamps - end - end -end diff --git a/db/migrate/20160311231152_add_commit_sha_to_miq_ae_namespaces.rb b/db/migrate/20160311231152_add_commit_sha_to_miq_ae_namespaces.rb deleted file mode 100644 index a8608e0bd..000000000 --- a/db/migrate/20160311231152_add_commit_sha_to_miq_ae_namespaces.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddCommitShaToMiqAeNamespaces < ActiveRecord::Migration[5.0] - def change - add_column :miq_ae_namespaces, :commit_sha, :string - add_column :miq_ae_namespaces, :commit_time, :timestamp - add_column :miq_ae_namespaces, :commit_message, :text - add_column :miq_ae_namespaces, :git_repository_id, :bigint - add_column :miq_ae_namespaces, :ref, :string - add_column :miq_ae_namespaces, :ref_type, :string - add_column :miq_ae_namespaces, :last_import_on, :timestamp - end -end diff --git a/db/migrate/20160317041206_add_maintenance_to_host.rb b/db/migrate/20160317041206_add_maintenance_to_host.rb deleted file mode 100644 index e2e16e380..000000000 --- a/db/migrate/20160317041206_add_maintenance_to_host.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddMaintenanceToHost < ActiveRecord::Migration[5.0] - class Host < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def change - add_column :hosts, :maintenance, :boolean - add_column :hosts, :maintenance_reason, :string - end -end diff --git a/db/migrate/20160317160230_move_user_roles_to_entitlements.rb b/db/migrate/20160317160230_move_user_roles_to_entitlements.rb deleted file mode 100644 index 7994375ad..000000000 --- a/db/migrate/20160317160230_move_user_roles_to_entitlements.rb +++ /dev/null @@ -1,16 +0,0 @@ -class MoveUserRolesToEntitlements < ActiveRecord::Migration[5.0] - class MiqGroup < ActiveRecord::Base; end - class Entitlement < ActiveRecord::Base; end - - def up - MiqGroup.find_each do |group| - Entitlement.create!(:miq_group_id => group.id, :miq_user_role_id => group.miq_user_role_id) - end - end - - def down - MiqGroup.find_each do |group| - Entitlement.where(:miq_group_id => group.id).delete_all - end - end -end diff --git a/db/migrate/20160317164141_add_old_projectid_to_container_projects.rb b/db/migrate/20160317164141_add_old_projectid_to_container_projects.rb deleted file mode 100644 index 1a99f394f..000000000 --- a/db/migrate/20160317164141_add_old_projectid_to_container_projects.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddOldProjectidToContainerProjects < ActiveRecord::Migration[5.0] - def change - add_column :container_groups, :old_container_project_id, :bigint - end -end diff --git a/db/migrate/20160317194215_remove_miq_user_role_from_miq_groups.rb b/db/migrate/20160317194215_remove_miq_user_role_from_miq_groups.rb deleted file mode 100644 index e8caa40bb..000000000 --- a/db/migrate/20160317194215_remove_miq_user_role_from_miq_groups.rb +++ /dev/null @@ -1,28 +0,0 @@ -class RemoveMiqUserRoleFromMiqGroups < ActiveRecord::Migration[5.0] - class MiqGroup < ActiveRecord::Base - has_one :entitlement, :class_name => 'RemoveMiqUserRoleFromMiqGroups::Entitlement' - end - - class Entitlement < ActiveRecord::Base - belongs_to :miq_group, :class_name => 'RemoveMiqUserRoleFromMiqGroups::MiqGroup' - belongs_to :miq_user_role, :class_name => 'RemoveMiqUserRoleFromMiqGroups::MiqUserRole' - end - - class MiqUserRole < ActiveRecord::Base - has_many :entitlements, :class_name => 'RemoveMiqUserRoleFromMiqGroups::Entitlement' - end - - def up - remove_column :miq_groups, :miq_user_role_id - end - - def down - add_column :miq_groups, :miq_user_role_id, :bigint - - MiqGroup.includes(:entitlement).where.not(:entitlements => {:miq_user_role_id => nil}).find_each do |group| - group.miq_user_role_id = group.entitlement.miq_user_role_id - group.save! - end - MiqGroup.reset_column_information - end -end diff --git a/db/migrate/20160318133352_add_deprecated_to_vms.rb b/db/migrate/20160318133352_add_deprecated_to_vms.rb deleted file mode 100644 index a3deceffc..000000000 --- a/db/migrate/20160318133352_add_deprecated_to_vms.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDeprecatedToVms < ActiveRecord::Migration[5.0] - def change - add_column :vms, :deprecated, :boolean - end -end diff --git a/db/migrate/20160322141934_create_join_table_host_switch.rb b/db/migrate/20160322141934_create_join_table_host_switch.rb deleted file mode 100644 index 696a33d89..000000000 --- a/db/migrate/20160322141934_create_join_table_host_switch.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateJoinTableHostSwitch < ActiveRecord::Migration[5.0] - def change - create_table :host_switches do |t| - t.bigint :host_id - t.bigint :switch_id - end - end -end diff --git a/db/migrate/20160322174516_add_old_ems_id_to_containers_and_definitions.rb b/db/migrate/20160322174516_add_old_ems_id_to_containers_and_definitions.rb deleted file mode 100644 index 48f852e25..000000000 --- a/db/migrate/20160322174516_add_old_ems_id_to_containers_and_definitions.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddOldEmsIdToContainersAndDefinitions < ActiveRecord::Migration[5.0] - def change - add_column :containers, :old_ems_id, :bigint - add_column :container_definitions, :old_ems_id, :bigint - end -end diff --git a/db/migrate/20160322195653_move_switch_host_to_jointable.rb b/db/migrate/20160322195653_move_switch_host_to_jointable.rb deleted file mode 100644 index 09f92300b..000000000 --- a/db/migrate/20160322195653_move_switch_host_to_jointable.rb +++ /dev/null @@ -1,23 +0,0 @@ -class MoveSwitchHostToJointable < ActiveRecord::Migration[5.0] - class Host < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - has_many :switches, :class_name => 'MoveSwitchHostToJointable::Switch' - end - - class Switch < ActiveRecord::Base - belongs_to :host, :class_name => 'MoveSwitchHostToJointable::Host' - end - - class HostSwitch < ActiveRecord::Base - end - - def up - say_with_time('Populating host_switches table with (host.id, switch.id)') do - Host.includes(:switches).find_each do |host| - host.switches.each do |switch| - HostSwitch.create!(:host_id => host.id, :switch_id => switch.id) - end - end - end - end -end diff --git a/db/migrate/20160322205357_remove_host_id_from_switch.rb b/db/migrate/20160322205357_remove_host_id_from_switch.rb deleted file mode 100644 index 787452c03..000000000 --- a/db/migrate/20160322205357_remove_host_id_from_switch.rb +++ /dev/null @@ -1,31 +0,0 @@ -class RemoveHostIdFromSwitch < ActiveRecord::Migration[5.0] - class Host < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - has_many :host_switches, :dependent => :destroy, :class_name => 'RemoveHostIdFromSwitch::HostSwitch' - has_many :switches, :through => :host_switches, :class_name => 'RemoveHostIdFromSwitch::Switch' - end - - class Switch < ActiveRecord::Base - has_many :host_switches, :dependent => :destroy, :class_name => 'RemoveHostIdFromSwitch::HostSwitch' - has_many :hosts, :through => :host_switches, :class_name => 'RemoveHostIdFromSwitch::Host' - end - - class HostSwitch < ActiveRecord::Base - belongs_to :host, :class_name => 'RemoveHostIdFromSwitch::Host' - belongs_to :switch, :class_name => 'RemoveHostIdFromSwitch::Switch' - end - - def up - remove_column :switches, :host_id, :bigint - end - - def down - add_column :switches, :host_id, :bigint - say_with_time('Populating switches.host_id from host_switches table') do - Switch.includes(:hosts).find_each do |switch| - switch.host_id = switch.hosts.first.id - switch.save! - end - end - end -end diff --git a/db/migrate/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet.rb b/db/migrate/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet.rb deleted file mode 100644 index 326044f7e..000000000 --- a/db/migrate/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet.rb +++ /dev/null @@ -1,46 +0,0 @@ -class SetCorrectStiTypeAndEmsIdOnOpenstackCloudSubnet< ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - # Fill a missing link of CloudSubnet to EMS and a correct STI - ExtManagementSystem - .where({:type => 'ManageIQ::Providers::Openstack::NetworkManager'}).each do |ems| - CloudSubnet - .joins('left join cloud_networks on cloud_networks.id = cloud_subnets.cloud_network_id') - .where(:cloud_subnets => {:type => ['ManageIQ::Providers::Openstack::CloudManager::CloudSubnet', - 'ManageIQ::Providers::Openstack::InfraManager::CloudSubnet']}, - :cloud_networks => {:ems_id => ems.id}) - .update_all("type = 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', ems_id = '#{ems.id}'") - end - end - - def down - # Connect CloudSubnet back to CloudManager - CloudSubnet - .joins('left join cloud_networks on cloud_networks.id = cloud_subnets.cloud_network_id') - .joins('left join ext_management_systems on ext_management_systems.id = cloud_networks.ems_id') - .joins('left join ext_management_systems as cloud_manager on ext_management_systems.parent_ems_id = cloud_manager.id') - .where(:cloud_subnets => {:type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet'}, - :cloud_manager => {:type => 'ManageIQ::Providers::Openstack::CloudManager'}) - .update_all("type = 'ManageIQ::Providers::Openstack::CloudManager::CloudSubnet'") - - # Connect CloudSubnet back to InfraManager - CloudSubnet - .joins('left join cloud_networks on cloud_networks.id = cloud_subnets.cloud_network_id') - .joins('left join ext_management_systems on ext_management_systems.id = cloud_networks.ems_id') - .joins('left join ext_management_systems as cloud_manager on ext_management_systems.parent_ems_id = cloud_manager.id') - .where(:cloud_subnets => {:type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet'}, - :cloud_manager => {:type => 'ManageIQ::Providers::Openstack::InfraManager'}) - .update_all("type = 'ManageIQ::Providers::Openstack::InfraManager::CloudSubnet'") - end -end diff --git a/db/migrate/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager.rb b/db/migrate/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager.rb deleted file mode 100644 index 1b2777c37..000000000 --- a/db/migrate/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager.rb +++ /dev/null @@ -1,70 +0,0 @@ -class SeparateAmazonNetworkManagerFromAmazonCloudManager < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkPort < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkRouter < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class FloatingIp < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class SecurityGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def affected_classes - [CloudNetwork, CloudSubnet, NetworkPort, NetworkRouter, FloatingIp, SecurityGroup] - end - - def up - # Separate NetworkManager from CloudManager and move network models under NetworkManager - ExtManagementSystem - .joins('left join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Amazon::CloudManager'}, - :network_manager => {:parent_ems_id => nil}).each do |cloud_manager| - network_manager = ExtManagementSystem.create!( - :type => 'ManageIQ::Providers::Amazon::NetworkManager', - :name => "#{cloud_manager.name} Network Manager", - :parent_ems_id => cloud_manager.id, - :guid => SecureRandom.uuid) - - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => cloud_manager.id) - .update_all("type = 'ManageIQ::Providers::Amazon::NetworkManager::#{network_model_class.name.demodulize}', ems_id = '#{network_manager.id}'") - end - end - end - - def down - # Move NetworkManager models back from CloudManager and delete NetworkManager - ExtManagementSystem - .joins('join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Amazon::CloudManager'}).each do |cloud_manager| - - network_manager = ExtManagementSystem.where(:parent_ems_id => cloud_manager.id).first - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => network_manager.id) - .update_all("type = 'ManageIQ::Providers::Amazon::CloudManager::#{network_model_class.name.demodulize}', ems_id = '#{cloud_manager.id}'") - end - - network_manager.destroy - end - end -end diff --git a/db/migrate/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet.rb b/db/migrate/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet.rb deleted file mode 100644 index 4e8687d8f..000000000 --- a/db/migrate/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet.rb +++ /dev/null @@ -1,36 +0,0 @@ -class SetCorrectStiTypeAndEmsIdOnAmazonCloudSubnet < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - # Fill a missing link of CloudSubnet to EMS and a correct STI - ExtManagementSystem - .where({:type => 'ManageIQ::Providers::Amazon::NetworkManager'}).each do |ems| - CloudSubnet - .joins('left join cloud_networks on cloud_networks.id = cloud_subnets.cloud_network_id') - .where(:cloud_subnets => {:type => nil}, - :cloud_networks => {:ems_id => ems.id}) - .update_all("type = 'ManageIQ::Providers::Amazon::NetworkManager::CloudSubnet', ems_id = '#{ems.id}'") - end - end - - def down - # Connect CloudSubnet back to CloudManager - CloudSubnet - .joins('left join cloud_networks on cloud_networks.id = cloud_subnets.cloud_network_id') - .joins('left join ext_management_systems on ext_management_systems.id = cloud_networks.ems_id') - .joins('left join ext_management_systems as cloud_manager on ext_management_systems.parent_ems_id = cloud_manager.id') - .where(:cloud_subnets => {:type => 'ManageIQ::Providers::Amazon::NetworkManager::CloudSubnet'}, - :cloud_manager => {:type => 'ManageIQ::Providers::Amazon::CloudManager'}) - .update_all("type = NULL") - end -end diff --git a/db/migrate/20160324131349_add_hidden_to_ems_folders.rb b/db/migrate/20160324131349_add_hidden_to_ems_folders.rb deleted file mode 100644 index d5bcf4b91..000000000 --- a/db/migrate/20160324131349_add_hidden_to_ems_folders.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AddHiddenToEmsFolders < ActiveRecord::Migration[5.0] - class EmsFolder < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - add_column :ems_folders, :hidden, :boolean - - say_with_time('Setting ems_folders.hidden to false') do - EmsFolder.update_all(:hidden => false) - end - end - - def down - remove_column :ems_folders, :hidden - end -end diff --git a/db/migrate/20160324174132_create_container_deployments.rb b/db/migrate/20160324174132_create_container_deployments.rb deleted file mode 100644 index 8f5e4df78..000000000 --- a/db/migrate/20160324174132_create_container_deployments.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateContainerDeployments < ActiveRecord::Migration[5.0] - def change - create_table :container_deployments do |t| - t.string :kind - t.string :version - t.boolean :containerized - t.string :method_type - t.string :metrics_endpoint - t.text :customizations - t.boolean :deploy_metrics - t.boolean :deploy_registry - t.belongs_to :automation_task, :type => :bigint - t.belongs_to :deployed_ems, :type => :bigint - t.belongs_to :deployed_on_ems, :type => :bigint - t.timestamps - end - end -end diff --git a/db/migrate/20160324174218_create_container_deployment_nodes.rb b/db/migrate/20160324174218_create_container_deployment_nodes.rb deleted file mode 100644 index 49dde0428..000000000 --- a/db/migrate/20160324174218_create_container_deployment_nodes.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateContainerDeploymentNodes < ActiveRecord::Migration[5.0] - def change - create_table :container_deployment_nodes do |t| - t.string :address - t.string :name - t.text :labels - t.belongs_to :container_deployment, :type => :bigint - t.belongs_to :vm, :type => :bigint - t.text :docker_storage_devices, :array => true, :default => [] - t.bigint :docker_storage_data_size - t.text :customizations - t.timestamps - end - end -end diff --git a/db/migrate/20160328204930_remove_miq_server_product_update_join_table.rb b/db/migrate/20160328204930_remove_miq_server_product_update_join_table.rb deleted file mode 100644 index 453ff76cc..000000000 --- a/db/migrate/20160328204930_remove_miq_server_product_update_join_table.rb +++ /dev/null @@ -1,37 +0,0 @@ -class RemoveMiqServerProductUpdateJoinTable < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - EXCLUDES_KEY = "/workers/worker_base/replication_worker/replication/exclude_tables".freeze - - def up - drop_join_table(:miq_servers, :product_updates) - - say_with_time("Removing miq_servers_product_updates from replication excludes") do - SettingsChange.where(:key => EXCLUDES_KEY).each do |s| - s.value.delete("miq_servers_product_updates") - s.save! - end - end - end - - def down - # create_join_table(:miq_servers, :product_updates) - create_table(:miq_servers_product_updates, id: false) do |t| - t.bigint :miq_server_id, :null => false - t.bigint :product_update_id, :null => false - end - - say_with_time("Adding composite primary key for miq_servers_product_updates") do - execute("ALTER TABLE miq_servers_product_updates ADD PRIMARY KEY (product_update_id, miq_server_id)") - end - - say_with_time("Adding miq_servers_product_updates to replication excludes") do - SettingsChange.where(:key => EXCLUDES_KEY).each do |s| - s.value << "miq_servers_product_updates" - s.save! - end - end - end -end diff --git a/db/migrate/20160329192055_add_virtual_instance_ref_to_configured_systems.rb b/db/migrate/20160329192055_add_virtual_instance_ref_to_configured_systems.rb deleted file mode 100644 index cc3fc7628..000000000 --- a/db/migrate/20160329192055_add_virtual_instance_ref_to_configured_systems.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddVirtualInstanceRefToConfiguredSystems < ActiveRecord::Migration[5.0] - def change - add_column :configured_systems, :virtual_instance_ref, :string - end -end diff --git a/db/migrate/20160329212403_add_switch_uuid_and_is_shared_to_switch.rb b/db/migrate/20160329212403_add_switch_uuid_and_is_shared_to_switch.rb deleted file mode 100644 index bc4449b3e..000000000 --- a/db/migrate/20160329212403_add_switch_uuid_and_is_shared_to_switch.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddSwitchUuidAndIsSharedToSwitch < ActiveRecord::Migration[5.0] - def change - add_column :switches, :switch_uuid, :string - add_column :switches, :shared, :boolean - end -end diff --git a/db/migrate/20160331111338_add_registered_on_to_container_image.rb b/db/migrate/20160331111338_add_registered_on_to_container_image.rb deleted file mode 100644 index 21f91e359..000000000 --- a/db/migrate/20160331111338_add_registered_on_to_container_image.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddRegisteredOnToContainerImage < ActiveRecord::Migration[5.0] - def change - add_column :container_images, :registered_on, :datetime - end -end diff --git a/db/migrate/20160331111827_add_stat_containerimage_registration_rate_to_metric_rollups.rb b/db/migrate/20160331111827_add_stat_containerimage_registration_rate_to_metric_rollups.rb deleted file mode 100644 index 81c680364..000000000 --- a/db/migrate/20160331111827_add_stat_containerimage_registration_rate_to_metric_rollups.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStatContainerimageRegistrationRateToMetricRollups < ActiveRecord::Migration[5.0] - def change - add_column :metric_rollups, :stat_container_image_registration_rate, :integer - end -end diff --git a/db/migrate/20160404152107_add_subscription_to_ext_management_system.rb b/db/migrate/20160404152107_add_subscription_to_ext_management_system.rb deleted file mode 100644 index f76d4cbab..000000000 --- a/db/migrate/20160404152107_add_subscription_to_ext_management_system.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddSubscriptionToExtManagementSystem < ActiveRecord::Migration[5.0] - def up - add_column :ext_management_systems, :subscription, :string - end - - def down - remove_column :ext_management_systems, :subscription - end -end diff --git a/db/migrate/20160405074214_change_container_group_metric_field_name.rb b/db/migrate/20160405074214_change_container_group_metric_field_name.rb deleted file mode 100644 index 5aaf34dae..000000000 --- a/db/migrate/20160405074214_change_container_group_metric_field_name.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ChangeContainerGroupMetricFieldName < ActiveRecord::Migration[5.0] - def change - rename_column :metric_rollups, :stat_containergroup_create_rate, :stat_container_group_create_rate - rename_column :metric_rollups, :stat_containergroup_delete_rate, :stat_container_group_delete_rate - end -end diff --git a/db/migrate/20160405143543_create_git_references.rb b/db/migrate/20160405143543_create_git_references.rb deleted file mode 100644 index 4e70cbb5f..000000000 --- a/db/migrate/20160405143543_create_git_references.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateGitReferences < ActiveRecord::Migration[5.0] - def change - create_table :git_references do |t| - t.string :name - t.string :commit_sha - t.timestamp :commit_time - t.text :commit_message - t.string :type - t.bigint :git_repository_id - - t.timestamps - end - end -end diff --git a/db/migrate/20160405151142_remove_configurations_from_replication_excludes.rb b/db/migrate/20160405151142_remove_configurations_from_replication_excludes.rb deleted file mode 100644 index cf4161a1b..000000000 --- a/db/migrate/20160405151142_remove_configurations_from_replication_excludes.rb +++ /dev/null @@ -1,25 +0,0 @@ -class RemoveConfigurationsFromReplicationExcludes < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - EXCLUDES_KEY = "/workers/worker_base/replication_worker/replication/exclude_tables".freeze - - def up - say_with_time("Removing configurations from replication excludes") do - SettingsChange.where(:key => EXCLUDES_KEY).each do |s| - s.value.delete("configurations") - s.save! - end - end - end - - def down - say_with_time("Adding configurations to replication excludes") do - SettingsChange.where(:key => EXCLUDES_KEY).each do |s| - s.value << "configurations" - s.save! - end - end - end -end diff --git a/db/migrate/20160406072945_separate_azure_network_manager_from_azure_cloud_manager.rb b/db/migrate/20160406072945_separate_azure_network_manager_from_azure_cloud_manager.rb deleted file mode 100644 index 31d955267..000000000 --- a/db/migrate/20160406072945_separate_azure_network_manager_from_azure_cloud_manager.rb +++ /dev/null @@ -1,69 +0,0 @@ -class SeparateAzureNetworkManagerFromAzureCloudManager < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkPort < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkRouter < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class FloatingIp < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class SecurityGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def affected_classes - [CloudNetwork, CloudSubnet, NetworkPort, NetworkRouter, FloatingIp, SecurityGroup] - end - - def up - # Separate NetworkManager from CloudManager and move network models under NetworkManager - ExtManagementSystem - .joins('left join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Azure::CloudManager'}, - :network_manager => {:parent_ems_id => nil}).each do |cloud_manager| - network_manager = ExtManagementSystem.create!( - :type => 'ManageIQ::Providers::Azure::NetworkManager', - :name => "#{cloud_manager.name} Network Manager", - :parent_ems_id => cloud_manager.id, - :guid => SecureRandom.uuid) - - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => cloud_manager.id) - .update_all("type = 'ManageIQ::Providers::Azure::NetworkManager::#{network_model_class.name.demodulize}', ems_id = '#{network_manager.id}'") - end - end - end - - def down - # Move NetworkManager models back from CloudManager and delete NetworkManager - ExtManagementSystem - .joins('join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Azure::CloudManager'}).each do |cloud_manager| - network_manager = ExtManagementSystem.where(:parent_ems_id => cloud_manager.id).first - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => network_manager.id) - .update_all("type = 'ManageIQ::Providers::Azure::CloudManager::#{network_model_class.name.demodulize}', ems_id = '#{cloud_manager.id}'") - end - - network_manager.destroy - end - end -end diff --git a/db/migrate/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet.rb b/db/migrate/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet.rb deleted file mode 100644 index f11cd0693..000000000 --- a/db/migrate/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet.rb +++ /dev/null @@ -1,36 +0,0 @@ -class SetCorrectStiTypeAndEmsIdOnAzureCloudSubnet < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - # Fill a missing link of CloudSubnet to EMS and a correct STI - ExtManagementSystem - .where(:type => 'ManageIQ::Providers::Azure::NetworkManager').each do |ems| - CloudSubnet - .joins('left join cloud_networks on cloud_networks.id = cloud_subnets.cloud_network_id') - .where(:cloud_subnets => {:type => nil}, - :cloud_networks => {:ems_id => ems.id}) - .update_all("type = 'ManageIQ::Providers::Azure::NetworkManager::CloudSubnet', ems_id = '#{ems.id}'") - end - end - - def down - # Connect CloudSubnet back to CloudManager - CloudSubnet - .joins('left join cloud_networks on cloud_networks.id = cloud_subnets.cloud_network_id') - .joins('left join ext_management_systems on ext_management_systems.id = cloud_networks.ems_id') - .joins('left join ext_management_systems as cloud_manager on ext_management_systems.parent_ems_id = cloud_manager.id') - .where(:cloud_subnets => {:type => 'ManageIQ::Providers::Azure::NetworkManager::CloudSubnet'}, - :cloud_manager => {:type => 'ManageIQ::Providers::Azure::CloudManager'}) - .update_all("type = NULL") - end -end diff --git a/db/migrate/20160406190650_add_cross_manager_association_to_configured_system.rb b/db/migrate/20160406190650_add_cross_manager_association_to_configured_system.rb deleted file mode 100644 index ae3ea06da..000000000 --- a/db/migrate/20160406190650_add_cross_manager_association_to_configured_system.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCrossManagerAssociationToConfiguredSystem < ActiveRecord::Migration[5.0] - def change - add_reference(:configured_systems, :counterpart, :polymorphic => true, :type => :bigint) - end -end diff --git a/db/migrate/20160406195810_add_id_primary_key_to_join_tables.rb b/db/migrate/20160406195810_add_id_primary_key_to_join_tables.rb deleted file mode 100644 index 561baaccc..000000000 --- a/db/migrate/20160406195810_add_id_primary_key_to_join_tables.rb +++ /dev/null @@ -1,68 +0,0 @@ -class AddIdPrimaryKeyToJoinTables < ActiveRecord::Migration[5.0] - JOIN_TABLES = %w( - conditions_miq_policies - key_pairs_vms - miq_roles_features - security_groups_vms - storages_vms_and_templates - miq_groups_users - cloud_tenants_vms - customization_scripts_operating_system_flavors - configuration_locations_configuration_profiles - configuration_organizations_configuration_profiles - configuration_profiles_configuration_tags - configuration_tags_configured_systems - container_groups_container_services - direct_configuration_profiles_configuration_tags - direct_configuration_tags_configured_systems - network_ports_security_groups - ).freeze - - class MiqRegion < ActiveRecord::Base; end - - def up - JOIN_TABLES.each do |t| - delete_remote_region_rows(t) if on_replication_target? - - say_with_time("Add primary key \"id\" to #{t}") do - connection.execute <<-SQL - CREATE SEQUENCE #{sequence_name(t)} START #{seq_start_value} - SQL - - connection.execute <<-SQL - ALTER TABLE #{t} ADD COLUMN id BIGINT PRIMARY KEY - DEFAULT NEXTVAL('#{sequence_name(t)}') - SQL - - connection.execute <<-SQL - ALTER SEQUENCE #{sequence_name(t)} OWNED BY #{t}.id - SQL - end - end - end - - def down - JOIN_TABLES.each do |t| - remove_column t.to_sym, :id - end - end - - def delete_remote_region_rows(table) - model = Class.new(ActiveRecord::Base) { self.table_name = table } - col = model.column_names.first - model.where.not(col => anonymous_class_with_id_regions.region_to_range(anonymous_class_with_id_regions.my_region_number)).delete_all - end - - def on_replication_target? - MiqRegion.select(:region).distinct.count > 1 - end - - def sequence_name(table) - "#{table}_id_seq" - end - - def seq_start_value - val = anonymous_class_with_id_regions.rails_sequence_start - val == 0 ? 1 : val - end -end diff --git a/db/migrate/20160408154738_drop_url_from_providers.rb b/db/migrate/20160408154738_drop_url_from_providers.rb deleted file mode 100644 index 17c5832d4..000000000 --- a/db/migrate/20160408154738_drop_url_from_providers.rb +++ /dev/null @@ -1,5 +0,0 @@ -class DropUrlFromProviders < ActiveRecord::Migration[5.0] - def change - remove_column :providers, :url, :string - end -end diff --git a/db/migrate/20160412173518_add_inventory_group_relation_to_configuration_script.rb b/db/migrate/20160412173518_add_inventory_group_relation_to_configuration_script.rb deleted file mode 100644 index bfda7b7b0..000000000 --- a/db/migrate/20160412173518_add_inventory_group_relation_to_configuration_script.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddInventoryGroupRelationToConfigurationScript < ActiveRecord::Migration[5.0] - def change - add_reference :configuration_scripts, :inventory_root_group, :type => :bigint - end -end diff --git a/db/migrate/20160413175651_add_api_version_adn_path_to_endpoint.rb b/db/migrate/20160413175651_add_api_version_adn_path_to_endpoint.rb deleted file mode 100644 index 0758dc9dd..000000000 --- a/db/migrate/20160413175651_add_api_version_adn_path_to_endpoint.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddApiVersionAdnPathToEndpoint < ActiveRecord::Migration[5.0] - def change - add_column :endpoints, :api_version, :string - add_column :endpoints, :path, :string - end -end diff --git a/db/migrate/20160413191759_correct_sti_type_on_cloud_resource_quota.rb b/db/migrate/20160413191759_correct_sti_type_on_cloud_resource_quota.rb deleted file mode 100644 index c8f2cb8fe..000000000 --- a/db/migrate/20160413191759_correct_sti_type_on_cloud_resource_quota.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CorrectStiTypeOnCloudResourceQuota < ActiveRecord::Migration[5.0] - class CloudResourceQuota < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - NEW_TYPE = 'ManageIQ::Providers::Openstack::CloudManager::CloudResourceQuota'.freeze - OLD_TYPE = 'CloudResourceQuotaOpenstack'.freeze - EVEN_OLDER_TYPE = 'OpenstackResourceQuota'.freeze - - def up - CloudResourceQuota.where(:type => OLD_TYPE).update_all(:type => NEW_TYPE) - CloudResourceQuota.where(:type => EVEN_OLDER_TYPE).update_all(:type => NEW_TYPE) - end - - def down - CloudResourceQuota.where(:type => NEW_TYPE).update_all(:type => OLD_TYPE) - end -end diff --git a/db/migrate/20160413202128_sti_configuration_script.rb b/db/migrate/20160413202128_sti_configuration_script.rb deleted file mode 100644 index 52a16c5ec..000000000 --- a/db/migrate/20160413202128_sti_configuration_script.rb +++ /dev/null @@ -1,17 +0,0 @@ -class StiConfigurationScript < ActiveRecord::Migration[5.0] - class ConfigurationScript < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - add_column :configuration_scripts, :type, :string - - say_with_time("Setting type on ConfigurationScript") do - ConfigurationScript.update_all(:type => "ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript") - end - end - - def down - remove_column :configuration_scripts, :type - end -end diff --git a/db/migrate/20160414094300_change_capacity_to_hash_from_persistent_volume.rb b/db/migrate/20160414094300_change_capacity_to_hash_from_persistent_volume.rb deleted file mode 100644 index a1e623d8e..000000000 --- a/db/migrate/20160414094300_change_capacity_to_hash_from_persistent_volume.rb +++ /dev/null @@ -1,43 +0,0 @@ -class ChangeCapacityToHashFromPersistentVolume < ActiveRecord::Migration[5.0] - class ContainerVolume < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - class PersistentVolume < ContainerVolume - self.inheritance_column = :_type_disabled # disable STI - serialize :capacity - end - - def up - change_column :container_volumes, :capacity, :text - say_with_time("Changing string to hash") do - PersistentVolume.find_each do |vol| - result_hash = {} - unless vol.capacity.nil? - vol.capacity.split(',').each do |hash| - key, val = hash.split('=') - next if val.nil? - begin - result_hash[key.to_sym] = val.iec_60027_2_to_i - rescue ArgumentError - logger.warn("Capacity attribute was in bad format - #{val}") - end - end - end - vol.update!(:capacity => result_hash) - end - end - end - - def down - say_with_time("Changing hash to string") do - PersistentVolume.find_each do |vol| - next if vol.capacity.nil? - capacity = vol.capacity.collect { |key, val| "#{key}=#{val}" }.join(",") - capacity = nil if capacity.blank? - vol.update!(:capacity => capacity) - end - end - change_column :container_volumes, :capacity, :string - end -end diff --git a/db/migrate/20160414185708_create_container_label_tag_mappings.rb b/db/migrate/20160414185708_create_container_label_tag_mappings.rb deleted file mode 100644 index 6bdf4349d..000000000 --- a/db/migrate/20160414185708_create_container_label_tag_mappings.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateContainerLabelTagMappings < ActiveRecord::Migration[5.0] - def change - create_table :container_label_tag_mappings do |t| - t.string :labeled_resource_type - t.string :label_name - t.text :label_value - t.belongs_to :tag, :type => :bigint - - t.timestamps - end - end -end diff --git a/db/migrate/20160414192525_rename_configuration_manager_to_manager.rb b/db/migrate/20160414192525_rename_configuration_manager_to_manager.rb deleted file mode 100644 index 3c78ee1e8..000000000 --- a/db/migrate/20160414192525_rename_configuration_manager_to_manager.rb +++ /dev/null @@ -1,7 +0,0 @@ -class RenameConfigurationManagerToManager < ActiveRecord::Migration[5.0] - def change - rename_column :configuration_profiles, :configuration_manager_id, :manager_id - rename_column :configuration_scripts, :configuration_manager_id, :manager_id - rename_column :configured_systems, :configuration_manager_id, :manager_id - end -end diff --git a/db/migrate/20160415121724_create_cloud_services.rb b/db/migrate/20160415121724_create_cloud_services.rb deleted file mode 100644 index 20d4f1881..000000000 --- a/db/migrate/20160415121724_create_cloud_services.rb +++ /dev/null @@ -1,20 +0,0 @@ -class CreateCloudServices < ActiveRecord::Migration[5.0] - def change - create_table :cloud_services do |t| - t.string :ems_ref - t.string :source - t.string :executable_name - t.string :hostname - t.string :status - t.boolean :scheduling_disabled - t.string :scheduling_disabled_reason - t.bigint :ems_id - t.references :host, :type => :bigint - t.references :system_service, :type => :bigint - t.references :availability_zone, :type => :bigint - - t.timestamps - end - add_index :cloud_services, :ems_id - end -end diff --git a/db/migrate/20160417105237_add_read_only_to_policies.rb b/db/migrate/20160417105237_add_read_only_to_policies.rb deleted file mode 100644 index 48543d089..000000000 --- a/db/migrate/20160417105237_add_read_only_to_policies.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddReadOnlyToPolicies < ActiveRecord::Migration[5.0] - def change - add_column :miq_policies, :read_only, :boolean - add_column :conditions, :read_only, :boolean - end -end diff --git a/db/migrate/20160418141210_add_read_only_to_miq_alert.rb b/db/migrate/20160418141210_add_read_only_to_miq_alert.rb deleted file mode 100644 index d5c50677e..000000000 --- a/db/migrate/20160418141210_add_read_only_to_miq_alert.rb +++ /dev/null @@ -1,29 +0,0 @@ -class AddReadOnlyToMiqAlert < ActiveRecord::Migration[5.0] - class MiqAlert < ActiveRecord::Base; end - - MIQ_ALERT_GUIDS = ["9bc0d572-40bd-11de-bd12-005056a170fa", "fc2ae066-44b8-11de-900a-005056a170fa", - "8a6d32a8-44b8-11de-900a-005056a170fa", "a9532172-44a5-11de-b543-005056a170fa", - "1bb81254-44a6-11de-b543-005056a170fa", "ce2f8846-44a5-11de-b543-005056a170fa", - "fb73af80-40bd-11de-bd12-005056a170fa", "e750cdcc-447c-11de-aaba-005056a170fa", - "d59185a4-40bc-11de-bd12-005056a170fa", "c2fc477a-44a5-11de-b543-005056a170fa", - "fbe4b5ee-447e-11de-aaba-005056a170fa", "3cfbb5ce-40be-11de-bd12-005056a170fa", - "731da3b2-40bc-11de-bd12-005056a170fa", "5cd2b880-be53-11de-8d65-000c290de4f9", - "8261bf0a-be54-11de-8d65-000c290de4f9", "fdee2784-bf2c-11de-b3b4-000c290de4f9", - "9b61fd9e-bf35-11de-b3b4-000c290de4f9", "561d023c-bf36-11de-b3b4-000c290de4f9", - "82f853b0-bf36-11de-b3b4-000c290de4f9", "58e8a372-bff9-11de-b3b4-000c290de4f9", - "f8b870d0-c23d-11de-a3be-000c290de4f9", "eb88f942-c23e-11de-a3be-000c290de4f9", - "196868de-c23f-11de-a3be-000c290de4f9", "4077943a-c240-11de-a3be-000c290de4f9", - "89db0be8-c240-11de-a3be-000c290de4f9"].freeze - - def up - add_column :miq_alerts, :read_only, :boolean - - say_with_time('Add read only parameter to MiqAlert with true for OOTB alerts') do - MiqAlert.where(:guid => MIQ_ALERT_GUIDS).update(:read_only => true) - end - end - - def down - remove_column :miq_alerts, :read_only - end -end diff --git a/db/migrate/20160418205109_add_middleware_server_event_streams.rb b/db/migrate/20160418205109_add_middleware_server_event_streams.rb deleted file mode 100644 index 9791525ce..000000000 --- a/db/migrate/20160418205109_add_middleware_server_event_streams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddMiddlewareServerEventStreams < ActiveRecord::Migration[5.0] - def change - add_column :event_streams, :middleware_server_id, :bigint - add_column :event_streams, :middleware_server_name, :string - add_column :event_streams, :middleware_deployment_id, :bigint - add_column :event_streams, :middleware_deployment_name, :string - end -end diff --git a/db/migrate/20160419134542_add_deployment_authentication_options_to_authentications.rb b/db/migrate/20160419134542_add_deployment_authentication_options_to_authentications.rb deleted file mode 100644 index c7a9a747f..000000000 --- a/db/migrate/20160419134542_add_deployment_authentication_options_to_authentications.rb +++ /dev/null @@ -1,33 +0,0 @@ -class AddDeploymentAuthenticationOptionsToAuthentications < ActiveRecord::Migration[5.0] - def change - add_column :authentications, :challenge, :boolean - add_column :authentications, :login, :boolean - add_column :authentications, :public_key, :text - add_column :authentications, :htpassd_users, :text, :array => true, :default => [] - add_column :authentications, :ldap_id, :text, :array => true, :default => [] - add_column :authentications, :ldap_email, :text, :array => true, :default => [] - add_column :authentications, :ldap_name, :text, :array => true, :default => [] - add_column :authentications, :ldap_preferred_user_name, :text, :array => true, :default => [] - add_column :authentications, :ldap_bind_dn, :string - add_column :authentications, :ldap_insecure, :boolean - add_column :authentications, :ldap_url, :string - add_column :authentications, :request_header_challenge_url, :string - add_column :authentications, :request_header_login_url, :string - add_column :authentications, :request_header_headers, :text, :array => true, :default => [] - add_column :authentications, :request_header_preferred_username_headers, :text, :array => true, :default => [] - add_column :authentications, :request_header_name_headers, :text, :array => true, :default => [] - add_column :authentications, :request_header_email_headers, :text, :array => true, :default => [] - add_column :authentications, :open_id_sub_claim, :string - add_column :authentications, :open_id_user_info, :string - add_column :authentications, :open_id_authorization_endpoint, :string - add_column :authentications, :open_id_token_endpoint, :string - add_column :authentications, :open_id_extra_scopes, :text, :array => true, :default => [] - add_column :authentications, :open_id_extra_authorize_parameters, :text - add_column :authentications, :certificate_authority, :text - add_column :authentications, :google_hosted_domain, :string - add_column :authentications, :github_organizations, :text, :array => true, :default => [] - add_column :authentications, :rhsm_sku, :string - add_column :authentications, :rhsm_pool_id, :string - add_column :authentications, :rhsm_server, :string - end -end diff --git a/db/migrate/20160424124613_create_network_groups.rb b/db/migrate/20160424124613_create_network_groups.rb deleted file mode 100644 index 00026dfa8..000000000 --- a/db/migrate/20160424124613_create_network_groups.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateNetworkGroups < ActiveRecord::Migration[4.2] - def change - create_table :network_groups do |t| - t.string :ems_ref - t.string :name - t.string :cidr - t.string :status - t.boolean :enabled - t.belongs_to :ems, :type => :bigint - t.belongs_to :orchestration_stack, :type => :bigint - t.string :type - end - - add_index :network_groups, :ems_id - add_index :network_groups, :orchestration_stack_id - end -end diff --git a/db/migrate/20160424124654_add_network_group_id_to_security_groups.rb b/db/migrate/20160424124654_add_network_group_id_to_security_groups.rb deleted file mode 100644 index 539e8ccdb..000000000 --- a/db/migrate/20160424124654_add_network_group_id_to_security_groups.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddNetworkGroupIdToSecurityGroups < ActiveRecord::Migration[4.2] - def change - add_column :security_groups, :network_group_id, :bigint - - add_index :security_groups, :network_group_id - end -end diff --git a/db/migrate/20160424124710_add_network_group_id_to_cloud_subnets.rb b/db/migrate/20160424124710_add_network_group_id_to_cloud_subnets.rb deleted file mode 100644 index ea3b719f6..000000000 --- a/db/migrate/20160424124710_add_network_group_id_to_cloud_subnets.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddNetworkGroupIdToCloudSubnets < ActiveRecord::Migration[4.2] - def change - add_column :cloud_subnets, :network_group_id, :bigint - - add_index :cloud_subnets, :network_group_id - end -end diff --git a/db/migrate/20160424124736_add_network_group_id_to_network_router.rb b/db/migrate/20160424124736_add_network_group_id_to_network_router.rb deleted file mode 100644 index 8a94441af..000000000 --- a/db/migrate/20160424124736_add_network_group_id_to_network_router.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddNetworkGroupIdToNetworkRouter < ActiveRecord::Migration[4.2] - def change - add_column :network_routers, :network_group_id, :bigint - - add_index :network_routers, :network_group_id - end -end diff --git a/db/migrate/20160425141742_add_parent_cloud_subnet_id_to_cloud_subnets.rb b/db/migrate/20160425141742_add_parent_cloud_subnet_id_to_cloud_subnets.rb deleted file mode 100644 index 7721ca392..000000000 --- a/db/migrate/20160425141742_add_parent_cloud_subnet_id_to_cloud_subnets.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddParentCloudSubnetIdToCloudSubnets < ActiveRecord::Migration[5.0] - def change - add_column :cloud_subnets, :parent_cloud_subnet_id, :bigint - - add_index :cloud_subnets, :parent_cloud_subnet_id - end -end diff --git a/db/migrate/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports.rb b/db/migrate/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports.rb deleted file mode 100644 index 54b08bc3d..000000000 --- a/db/migrate/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports.rb +++ /dev/null @@ -1,27 +0,0 @@ -class SetReportTypeFromChargebackToChargebackVmOnMiqReports < ActiveRecord::Migration[5.0] - CHARGEBACK_REPORT_DB_MODEL = "Chargeback".freeze # old - CHARGEBACK_VM_REPORT_DB_MODEL = "ChargebackVm".freeze # new - - class MiqReport < ActiveRecord::Base - serialize :db_options - end - - def up - say_with_time('Set Chargeback to ChargebackVm on MiqReports for db column rtp_type in db_options') do - MiqReport.where(:db => CHARGEBACK_REPORT_DB_MODEL).all.each do |miq_report| - miq_report.db_options[:rpt_type] = miq_report.db = CHARGEBACK_VM_REPORT_DB_MODEL - miq_report.save! - end - end - end - - def down - say_with_time('Set ChargebackVm back to Chargeback on MiqReports for db column in db_options') do - MiqReport.where(:db => CHARGEBACK_VM_REPORT_DB_MODEL).all.each do |miq_report| - miq_report.db_options[:rpt_type] = CHARGEBACK_REPORT_DB_MODEL.downcase - miq_report.db = CHARGEBACK_REPORT_DB_MODEL - miq_report.save! - end - end - end -end diff --git a/db/migrate/20160425161234_remove_deleted_tables_from_replication_settings.rb b/db/migrate/20160425161234_remove_deleted_tables_from_replication_settings.rb deleted file mode 100644 index f84749858..000000000 --- a/db/migrate/20160425161234_remove_deleted_tables_from_replication_settings.rb +++ /dev/null @@ -1,19 +0,0 @@ -class RemoveDeletedTablesFromReplicationSettings < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - serialize :value - end - - def up - deleted_tables = %w(miq_events miq_license_contents vim_performances) - added_tables = %w(miq_event_definitions) - - changes = SettingsChange.where(:key => "/workers/worker_base/replication_worker/replication/exclude_tables") - changes.each do |change| - change.value -= deleted_tables - change.value += added_tables - change.value.uniq! - change.save - end - end -end diff --git a/db/migrate/20160425161235_correct_sti_type_on_cloud_tenant.rb b/db/migrate/20160425161235_correct_sti_type_on_cloud_tenant.rb deleted file mode 100644 index 475c647da..000000000 --- a/db/migrate/20160425161235_correct_sti_type_on_cloud_tenant.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CorrectStiTypeOnCloudTenant < ActiveRecord::Migration[5.0] - class CloudTenant < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - NEW_TYPE = 'ManageIQ::Providers::Openstack::CloudManager::CloudTenant'.freeze - - def up - CloudTenant.where(:type => nil).update_all(:type => NEW_TYPE) - end - - def down - CloudTenant.where(:type => NEW_TYPE).update_all(:type => nil) - end -end diff --git a/db/migrate/20160425161456_update_default_yum_repo_name_for56.rb b/db/migrate/20160425161456_update_default_yum_repo_name_for56.rb deleted file mode 100644 index 733527036..000000000 --- a/db/migrate/20160425161456_update_default_yum_repo_name_for56.rb +++ /dev/null @@ -1,27 +0,0 @@ -class UpdateDefaultYumRepoNameFor56 < ActiveRecord::Migration[5.0] - class MiqDatabase < ActiveRecord::Base; end - - REPO_NAME_HASH = { - "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms" => "cf-me-5.6-for-rhel-7-rpms rhel-server-rhscl-7-rpms" - }.freeze - - def up - say_with_time("Updating update_repo_name") do - update(REPO_NAME_HASH) - end - end - - def down - say_with_time("Updating update_repo_name") do - update(REPO_NAME_HASH.invert) - end - end - - def update(hash) - db = MiqDatabase.first - if db - new_repo = hash[db.update_repo_name] - db.update(:update_repo_name => new_repo) if new_repo - end - end -end diff --git a/db/migrate/20160425161822_create_middleware_datasources.rb b/db/migrate/20160425161822_create_middleware_datasources.rb deleted file mode 100644 index 45a94fd3a..000000000 --- a/db/migrate/20160425161822_create_middleware_datasources.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateMiddlewareDatasources < ActiveRecord::Migration[4.2] - def change - create_table :middleware_datasources do |t| - t.string :name # name of the datasource - t.string :ems_ref # path - t.string :nativeid - t.bigint :server_id - t.text :properties - t.bigint :ems_id - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20160428215808_add_filters_to_entitlements.rb b/db/migrate/20160428215808_add_filters_to_entitlements.rb deleted file mode 100644 index 867ab71d9..000000000 --- a/db/migrate/20160428215808_add_filters_to_entitlements.rb +++ /dev/null @@ -1,16 +0,0 @@ -class AddFiltersToEntitlements < ActiveRecord::Migration[5.0] - include MigrationHelper - - class Entitlement < ActiveRecord::Base; end - - def change - return if previously_migrated_as?("20160414123914") - - add_column :entitlements, :filters, :text - - # HACK, this shouldn't be required, figure out why. :cry: - # Without this, migrate fails when you go from "latest schema" down to: - # 20160317194215_remove_miq_user_role_from_miq_groups.rb - Entitlement.reset_column_information - end -end diff --git a/db/migrate/20160428215825_move_filters_to_entitlements.rb b/db/migrate/20160428215825_move_filters_to_entitlements.rb deleted file mode 100644 index d6a8b4d13..000000000 --- a/db/migrate/20160428215825_move_filters_to_entitlements.rb +++ /dev/null @@ -1,36 +0,0 @@ -class MoveFiltersToEntitlements < ActiveRecord::Migration[5.0] - include MigrationHelper - - class MiqGroup < ActiveRecord::Base - has_one :entitlement, :class_name => 'MoveFiltersToEntitlements::Entitlement' - serialize :filters - end - - class Entitlement < ActiveRecord::Base - belongs_to :miq_group, :class_name => 'MoveFiltersToEntitlements::MiqGroup' - serialize :filters - end - - def up - return if previously_migrated_as?("20160414124134") - say_with_time 'Moving MiqGroup filters to Entitlements' do - MiqGroup.find_each do |group| - if group.filters && group.entitlement - group.entitlement.filters = group.filters - group.entitlement.save! - end - end - end - end - - def down - say_with_time 'Moving Entitlement filters back to MiqGroups' do - Entitlement.find_each do |entitlement| - if entitlement.filters && entitlement.miq_group - entitlement.miq_group.filters = entitlement.filters - entitlement.miq_group.save! - end - end - end - end -end diff --git a/db/migrate/20160428215838_remove_filters_from_miq_groups.rb b/db/migrate/20160428215838_remove_filters_from_miq_groups.rb deleted file mode 100644 index 20ba4a610..000000000 --- a/db/migrate/20160428215838_remove_filters_from_miq_groups.rb +++ /dev/null @@ -1,8 +0,0 @@ -class RemoveFiltersFromMiqGroups < ActiveRecord::Migration[5.0] - include MigrationHelper - - def change - return if previously_migrated_as?("20160414132130") - remove_column :miq_groups, :filters, :text - end -end diff --git a/db/migrate/20160519083518_add_ems_id_and_ems_ref_to_orchestration_templates.rb b/db/migrate/20160519083518_add_ems_id_and_ems_ref_to_orchestration_templates.rb deleted file mode 100644 index 50dca04e2..000000000 --- a/db/migrate/20160519083518_add_ems_id_and_ems_ref_to_orchestration_templates.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddEmsIdAndEmsRefToOrchestrationTemplates < ActiveRecord::Migration[5.0] - def change - add_column :orchestration_templates, :ems_ref, :string - add_column :orchestration_templates, :ems_id, :bigint - - add_index :orchestration_templates, :ems_id - end -end diff --git a/db/migrate/20160607141740_remove_ruby_rep_tables_and_triggers.rb b/db/migrate/20160607141740_remove_ruby_rep_tables_and_triggers.rb deleted file mode 100644 index c482469d5..000000000 --- a/db/migrate/20160607141740_remove_ruby_rep_tables_and_triggers.rb +++ /dev/null @@ -1,40 +0,0 @@ -class RemoveRubyRepTablesAndTriggers < ActiveRecord::Migration[5.0] - include MigrationHelper - - TRIGGER_QUERY = <<-SQL.freeze - SELECT relname, array_agg(tgname) AS triggers - FROM pg_trigger t - JOIN pg_class c ON t.tgrelid = c.oid - WHERE t.tgname LIKE 'rr%_%' - GROUP BY relname - SQL - - TABLE_QUERY = <<-SQL.freeze - SELECT relname - FROM pg_class - WHERE relname LIKE 'rr%_pending_changes' OR - relname LIKE 'rr%_logged_events' OR - relname LIKE 'rr%_sync_state' - SQL - - def up - say_with_time("Dropping all rubyrep triggers") do - connection.execute(TRIGGER_QUERY).each do |r| - table = r["relname"] - sql_array_to_ruby(r["triggers"]).each do |trigger| - drop_trigger(table, trigger) - end - end - end - - say_with_time("Removing rubyrep tables") do - connection.execute(TABLE_QUERY).each { |r| drop_table(r["relname"]) } - end - end - - def sql_array_to_ruby(sql_arr) - # the array is returned like: "{value1,value2,value3}" - # so we cut out the brackets and split on commas - sql_arr[1..-2].split(",") - end -end diff --git a/db/migrate/20160607141810_remove_database_synchronization_role.rb b/db/migrate/20160607141810_remove_database_synchronization_role.rb deleted file mode 100644 index cd5ea70de..000000000 --- a/db/migrate/20160607141810_remove_database_synchronization_role.rb +++ /dev/null @@ -1,26 +0,0 @@ -class RemoveDatabaseSynchronizationRole < ActiveRecord::Migration[5.0] - class ServerRole < ActiveRecord::Base; end - class AssignedServerRole < ActiveRecord::Base; end - class SettingsChange < ActiveRecord::Base - serialize :value - end - - def up - say_with_time("Removing database synchronization role") do - role = ServerRole.find_by(:name => "database_synchronization") - if role - AssignedServerRole.where(:server_role_id => role.id).delete_all - role.delete - end - end - - say_with_time("Removing role from currently configured servers") do - changes = SettingsChange.where(:key => "/server/role") - changes.each do |change| - role_list = change.value.split(",") - change.value = role_list.reject { |role| role == "database_synchronization" }.join(",") - change.save! - end - end - end -end diff --git a/db/migrate/20160607141857_change_exclude_table_settings_key.rb b/db/migrate/20160607141857_change_exclude_table_settings_key.rb deleted file mode 100644 index 3e77d41a6..000000000 --- a/db/migrate/20160607141857_change_exclude_table_settings_key.rb +++ /dev/null @@ -1,18 +0,0 @@ -class ChangeExcludeTableSettingsKey < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - OLD_KEY = "/workers/worker_base/replication_worker/replication/exclude_tables".freeze - NEW_KEY = "/replication/exclude_tables".freeze - - def up - say_with_time("Moving exclude tables configuration") do - SettingsChange.where(:key => OLD_KEY).update_all(:key => NEW_KEY) - end - end - - def down - SettingsChange.where(:key => NEW_KEY).update_all(:key => OLD_KEY) - end -end diff --git a/db/migrate/20160610124506_add_lives_on_to_middleware_server.rb b/db/migrate/20160610124506_add_lives_on_to_middleware_server.rb deleted file mode 100644 index a0fd1af44..000000000 --- a/db/migrate/20160610124506_add_lives_on_to_middleware_server.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddLivesOnToMiddlewareServer < ActiveRecord::Migration[5.0] - def change - add_reference :middleware_servers, :lives_on, :type => :bigint, :polymorphic => true - end -end diff --git a/db/migrate/20160621023902_create_host_aggregate.rb b/db/migrate/20160621023902_create_host_aggregate.rb deleted file mode 100644 index 50181f005..000000000 --- a/db/migrate/20160621023902_create_host_aggregate.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateHostAggregate < ActiveRecord::Migration[5.0] - def change - create_table :host_aggregates do |t| - t.bigint :ems_id - t.string :name - t.string :ems_ref - t.string :type - t.text :metadata - end - - add_index "host_aggregates", ["ems_id"], :name => "index_host_aggregates_on_ems_id" - end -end diff --git a/db/migrate/20160621025312_create_host_aggregate_host.rb b/db/migrate/20160621025312_create_host_aggregate_host.rb deleted file mode 100644 index 547fd864d..000000000 --- a/db/migrate/20160621025312_create_host_aggregate_host.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateHostAggregateHost < ActiveRecord::Migration[5.0] - def change - create_table :host_aggregate_hosts do |t| - t.bigint :host_id - t.bigint :host_aggregate_id - end - - add_index "host_aggregate_hosts", ["host_id", "host_aggregate_id"], :name => "index_host_aggregate_hosts_on_host_id_and_aggregate_id", :unique => true - end -end diff --git a/db/migrate/20160627074242_separate_google_network_manager_from_google_cloud_manager.rb b/db/migrate/20160627074242_separate_google_network_manager_from_google_cloud_manager.rb deleted file mode 100644 index 1324af3fb..000000000 --- a/db/migrate/20160627074242_separate_google_network_manager_from_google_cloud_manager.rb +++ /dev/null @@ -1,69 +0,0 @@ -class SeparateGoogleNetworkManagerFromGoogleCloudManager < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudNetwork < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class CloudSubnet < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkPort < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class NetworkRouter < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class FloatingIp < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class SecurityGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def affected_classes - [CloudNetwork, CloudSubnet, NetworkPort, NetworkRouter, FloatingIp, SecurityGroup] - end - - def up - # Separate NetworkManager from CloudManager and move network models under NetworkManager - ExtManagementSystem - .joins('left join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Google::CloudManager'}, - :network_manager => {:parent_ems_id => nil}).each do |cloud_manager| - network_manager = ExtManagementSystem.create!( - :type => 'ManageIQ::Providers::Google::NetworkManager', - :name => "#{cloud_manager.name} Network Manager", - :parent_ems_id => cloud_manager.id, - :guid => SecureRandom.uuid) - - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => cloud_manager.id) - .update_all("type = 'ManageIQ::Providers::Google::NetworkManager::#{network_model_class.name.demodulize}', ems_id = '#{network_manager.id}'") - end - end - end - - def down - # Move NetworkManager models back from CloudManager and delete NetworkManager - ExtManagementSystem - .joins('join ext_management_systems as network_manager on network_manager.parent_ems_id = ext_management_systems.id') - .where(:ext_management_systems => {:type => 'ManageIQ::Providers::Google::CloudManager'}).each do |cloud_manager| - network_manager = ExtManagementSystem.where(:parent_ems_id => cloud_manager.id).first - affected_classes.each do |network_model_class| - network_model_class - .where(:ems_id => network_manager.id) - .update_all("type = 'ManageIQ::Providers::Google::CloudManager::#{network_model_class.name.demodulize}', ems_id = '#{cloud_manager.id}'") - end - - network_manager.destroy - end - end -end diff --git a/db/migrate/20160627112436_fix_lives_on_index_on_middleware_servers.rb b/db/migrate/20160627112436_fix_lives_on_index_on_middleware_servers.rb deleted file mode 100644 index 8a88f1560..000000000 --- a/db/migrate/20160627112436_fix_lives_on_index_on_middleware_servers.rb +++ /dev/null @@ -1,6 +0,0 @@ -class FixLivesOnIndexOnMiddlewareServers < ActiveRecord::Migration[5.0] - def change - remove_index :middleware_servers, :column => [:lives_on_type, :lives_on_id ] - add_index :middleware_servers, [:lives_on_id, :lives_on_type] - end -end diff --git a/db/migrate/20160627114232_fix_counterpart_index_on_configured_systems.rb b/db/migrate/20160627114232_fix_counterpart_index_on_configured_systems.rb deleted file mode 100644 index 5a79af921..000000000 --- a/db/migrate/20160627114232_fix_counterpart_index_on_configured_systems.rb +++ /dev/null @@ -1,6 +0,0 @@ -class FixCounterpartIndexOnConfiguredSystems < ActiveRecord::Migration[5.0] - def change - remove_index :configured_systems, :column => [:counterpart_type, :counterpart_id ] - add_index :configured_systems, [:counterpart_id, :counterpart_type] - end -end diff --git a/db/migrate/20160628124806_add_visible_to_dialog_fields.rb b/db/migrate/20160628124806_add_visible_to_dialog_fields.rb deleted file mode 100644 index fa469d8a8..000000000 --- a/db/migrate/20160628124806_add_visible_to_dialog_fields.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddVisibleToDialogFields < ActiveRecord::Migration[5.0] - def change - add_column :dialog_fields, :visible, :boolean - end -end diff --git a/db/migrate/20160628140841_fix_service_order_placed_at.rb b/db/migrate/20160628140841_fix_service_order_placed_at.rb deleted file mode 100644 index 35641bcc4..000000000 --- a/db/migrate/20160628140841_fix_service_order_placed_at.rb +++ /dev/null @@ -1,9 +0,0 @@ -class FixServiceOrderPlacedAt < ActiveRecord::Migration[5.0] - class ServiceOrder < ActiveRecord::Base; end - - def up - say_with_time('Update placed_at in ordered ServiceOrders') do - ServiceOrder.where(:state => 'ordered', :placed_at => nil).update_all('placed_at = updated_at') - end - end -end diff --git a/db/migrate/20160628165030_create_middleware_messagings.rb b/db/migrate/20160628165030_create_middleware_messagings.rb deleted file mode 100644 index 80b05b447..000000000 --- a/db/migrate/20160628165030_create_middleware_messagings.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateMiddlewareMessagings < ActiveRecord::Migration[4.2] - def change - create_table :middleware_messagings do |t| - t.string :name # name of the messaging - t.string :ems_ref # path - t.string :nativeid - t.string :feed - t.bigint :server_id - t.text :properties - t.bigint :ems_id - t.string :messaging_type - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20160701134322_add_ems_ref_to_host_storages.rb b/db/migrate/20160701134322_add_ems_ref_to_host_storages.rb deleted file mode 100644 index d037cf0bd..000000000 --- a/db/migrate/20160701134322_add_ems_ref_to_host_storages.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddEmsRefToHostStorages < ActiveRecord::Migration[5.0] - def change - add_column :host_storages, :ems_ref, :string - end -end diff --git a/db/migrate/20160701205641_add_properties_to_generic_object.rb b/db/migrate/20160701205641_add_properties_to_generic_object.rb deleted file mode 100644 index 567ea5243..000000000 --- a/db/migrate/20160701205641_add_properties_to_generic_object.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddPropertiesToGenericObject < ActiveRecord::Migration[5.0] - def change - add_column :generic_objects, :properties, :jsonb, :default => {} - end -end diff --git a/db/migrate/20160706230546_add_status_to_middleware_deployments.rb b/db/migrate/20160706230546_add_status_to_middleware_deployments.rb deleted file mode 100644 index 6da6b8b3c..000000000 --- a/db/migrate/20160706230546_add_status_to_middleware_deployments.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStatusToMiddlewareDeployments < ActiveRecord::Migration[5.0] - def change - add_column :middleware_deployments, :status, :string - end -end diff --git a/db/migrate/20160708140404_add_blueprint_id_to_service_templates.rb b/db/migrate/20160708140404_add_blueprint_id_to_service_templates.rb deleted file mode 100644 index 2755adfd8..000000000 --- a/db/migrate/20160708140404_add_blueprint_id_to_service_templates.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddBlueprintIdToServiceTemplates < ActiveRecord::Migration[5.0] - def change - add_column :service_templates, :blueprint_id, :bigint - end -end diff --git a/db/migrate/20160708140611_create_blueprints.rb b/db/migrate/20160708140611_create_blueprints.rb deleted file mode 100644 index 76cb7f921..000000000 --- a/db/migrate/20160708140611_create_blueprints.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateBlueprints < ActiveRecord::Migration[5.0] - def change - create_table :blueprints do |t| - t.string :name - t.string :description - t.string :status - t.string :version - t.jsonb :ui_properties - - t.timestamps - end - add_index :blueprints, :name - add_index :blueprints, :status - end -end diff --git a/db/migrate/20160708182331_remove_replication_worker_settings.rb b/db/migrate/20160708182331_remove_replication_worker_settings.rb deleted file mode 100644 index ae3e6341a..000000000 --- a/db/migrate/20160708182331_remove_replication_worker_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -class RemoveReplicationWorkerSettings < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - def up - say_with_time("Removing replication worker settings") do - SettingsChange.where("key LIKE ?", "/workers/worker_base/replication_worker%").delete_all - end - end -end diff --git a/db/migrate/20160708204023_remove_last_replication_columns_from_miq_database.rb b/db/migrate/20160708204023_remove_last_replication_columns_from_miq_database.rb deleted file mode 100644 index ffc087c9f..000000000 --- a/db/migrate/20160708204023_remove_last_replication_columns_from_miq_database.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveLastReplicationColumnsFromMiqDatabase < ActiveRecord::Migration[5.0] - def change - remove_column :miq_databases, :last_replication_id, :bigint - remove_column :miq_databases, :last_replication_count, :bigint - end -end diff --git a/db/migrate/20160712043931_create_storage_profiles.rb b/db/migrate/20160712043931_create_storage_profiles.rb deleted file mode 100644 index 960ea1d03..000000000 --- a/db/migrate/20160712043931_create_storage_profiles.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateStorageProfiles < ActiveRecord::Migration[5.0] - def change - create_table :storage_profiles do |t| - t.bigint :ems_id - t.string :name - t.string :ems_ref - t.string :profile_type - - t.timestamps - end - end -end diff --git a/db/migrate/20160712044409_create_join_table_storage_profile_storage.rb b/db/migrate/20160712044409_create_join_table_storage_profile_storage.rb deleted file mode 100644 index 910ccef0f..000000000 --- a/db/migrate/20160712044409_create_join_table_storage_profile_storage.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateJoinTableStorageProfileStorage < ActiveRecord::Migration[5.0] - def change - create_table :storage_profile_storages do |t| - t.bigint :storage_profile_id - t.bigint :storage_id - t.index :storage_id - t.index :storage_profile_id - end - end -end diff --git a/db/migrate/20160712144219_create_arbitration_defaults.rb b/db/migrate/20160712144219_create_arbitration_defaults.rb deleted file mode 100644 index d3a4ef894..000000000 --- a/db/migrate/20160712144219_create_arbitration_defaults.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateArbitrationDefaults < ActiveRecord::Migration[5.0] - def change - create_table :arbitration_defaults do |t| - t.string :uid_ems - - t.belongs_to :cloud_network, :type => :bigint - t.belongs_to :flavor, :type => :bigint - t.belongs_to :availability_zone, :type => :bigint - t.belongs_to :cloud_subnet, :type => :bigint - t.belongs_to :security_group, :type => :bigint - t.belongs_to :ems, :type => :bigint - t.belongs_to :authentication, :type => :bigint - end - end -end diff --git a/db/migrate/20160713130940_remove_type_template_and_vms_filters_from_miq_search.rb b/db/migrate/20160713130940_remove_type_template_and_vms_filters_from_miq_search.rb deleted file mode 100644 index 174b524c2..000000000 --- a/db/migrate/20160713130940_remove_type_template_and_vms_filters_from_miq_search.rb +++ /dev/null @@ -1,17 +0,0 @@ -class RemoveTypeTemplateAndVmsFiltersFromMiqSearch < ActiveRecord::Migration[5.0] - class MiqSearch < ActiveRecord::Base - end - - def up - say_with_time('Remove Type / Template and Type / VM from VMs filters') do - ["default_Type / Template", "default_Type / VM"].each do |name| - MiqSearch.find_by(:name => name).try(:delete) - end - end - end - - def down - # Rolling back this migration requires a serialized MiqExpression object, which is app-code dependent. - # Before this code change and migration, the seeds will reload these filters for you. - end -end diff --git a/db/migrate/20160713141244_upgrade_host_storage_from_reserved.rb b/db/migrate/20160713141244_upgrade_host_storage_from_reserved.rb deleted file mode 100644 index 44be15d57..000000000 --- a/db/migrate/20160713141244_upgrade_host_storage_from_reserved.rb +++ /dev/null @@ -1,23 +0,0 @@ -class UpgradeHostStorageFromReserved < ActiveRecord::Migration[5.0] - class HostStorage < ActiveRecord::Base - include ReservedMigrationMixin - include MigrationStubHelper - end - - def up - say_with_time("Migrate data from reserved table to host_storages") do - HostStorage.includes(:reserved_rec).each do |hs| - hs.reserved_hash_migrate(:ems_ref) - end - end - end - - def down - say_with_time("Migrate data from host_storages to reserved table") do - HostStorage.includes(:reserved_rec).each do |hs| - hs.reserved_hash_set(:ems_ref, hs.ems_ref) - hs.save! - end - end - end -end diff --git a/db/migrate/20160714133426_rename_arbitration_defaults_to_arbitration_profiles.rb b/db/migrate/20160714133426_rename_arbitration_defaults_to_arbitration_profiles.rb deleted file mode 100644 index 3100232f0..000000000 --- a/db/migrate/20160714133426_rename_arbitration_defaults_to_arbitration_profiles.rb +++ /dev/null @@ -1,15 +0,0 @@ -class RenameArbitrationDefaultsToArbitrationProfiles < ActiveRecord::Migration[5.0] - def up - rename_table :arbitration_defaults, :arbitration_profiles - add_column :arbitration_profiles, :name, :string - add_column :arbitration_profiles, :description, :text - add_column :arbitration_profiles, :default_profile, :boolean - end - - def down - rename_table :arbitration_profiles, :arbitration_defaults - remove_column :arbitration_defaults, :name - remove_column :arbitration_defaults, :description - remove_column :arbitration_defaults, :default_profile - end -end diff --git a/db/migrate/20160714210238_add_storage_profile_id_to_vms.rb b/db/migrate/20160714210238_add_storage_profile_id_to_vms.rb deleted file mode 100644 index 77d713b8b..000000000 --- a/db/migrate/20160714210238_add_storage_profile_id_to_vms.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStorageProfileIdToVms < ActiveRecord::Migration[5.0] - def change - add_column :vms, :storage_profile_id, :bigint - end -end diff --git a/db/migrate/20160714210434_add_storage_profile_id_to_disks.rb b/db/migrate/20160714210434_add_storage_profile_id_to_disks.rb deleted file mode 100644 index 4546a6b5f..000000000 --- a/db/migrate/20160714210434_add_storage_profile_id_to_disks.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStorageProfileIdToDisks < ActiveRecord::Migration[5.0] - def change - add_column :disks, :storage_profile_id, :bigint - end -end diff --git a/db/migrate/20160715155054_create_arbitration_settings.rb b/db/migrate/20160715155054_create_arbitration_settings.rb deleted file mode 100644 index cd0e3d9e0..000000000 --- a/db/migrate/20160715155054_create_arbitration_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateArbitrationSettings < ActiveRecord::Migration[5.0] - def change - create_table :arbitration_settings do |t| - t.string :name - t.string :display_name - t.text :value - t.datetime :created_on - t.datetime :updated_on - end - end -end diff --git a/db/migrate/20160719080735_add_parent_to_cloud_tenants.rb b/db/migrate/20160719080735_add_parent_to_cloud_tenants.rb deleted file mode 100644 index 6929f2c93..000000000 --- a/db/migrate/20160719080735_add_parent_to_cloud_tenants.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddParentToCloudTenants < ActiveRecord::Migration[5.0] - def change - add_column :cloud_tenants, :parent_id, :bigint - end -end diff --git a/db/migrate/20160719151049_add_bootable_to_disks.rb b/db/migrate/20160719151049_add_bootable_to_disks.rb deleted file mode 100644 index 9ad4efe12..000000000 --- a/db/migrate/20160719151049_add_bootable_to_disks.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddBootableToDisks < ActiveRecord::Migration[5.0] - def change - add_column :disks, :bootable, :boolean - end -end diff --git a/db/migrate/20160720085321_create_container_template.rb b/db/migrate/20160720085321_create_container_template.rb deleted file mode 100644 index d43c5ac99..000000000 --- a/db/migrate/20160720085321_create_container_template.rb +++ /dev/null @@ -1,27 +0,0 @@ -class CreateContainerTemplate < ActiveRecord::Migration[5.0] - def change - create_table :container_templates do |t| - t.string :ems_ref - t.string :name - t.timestamp :ems_created_on - t.string :resource_version - t.belongs_to :ems, :type => :bigint - t.belongs_to :container_project, :type => :bigint - t.text :objects - t.timestamps - end - - create_table :container_template_parameters do |t| - t.string :name - t.timestamp :ems_created_on - t.string :display_name - t.string :description - t.string :value - t.string :generate - t.string :from - t.boolean :required - t.belongs_to :container_template, :type => :bigint - t.timestamps - end - end -end diff --git a/db/migrate/20160720151217_create_arbitration_rules.rb b/db/migrate/20160720151217_create_arbitration_rules.rb deleted file mode 100644 index 22ec75278..000000000 --- a/db/migrate/20160720151217_create_arbitration_rules.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateArbitrationRules < ActiveRecord::Migration[5.0] - def change - create_table :arbitration_rules do |t| - t.string :name - t.string :description - t.string :operation - t.integer :arbitration_profile_id - t.integer :priority - t.text :expression - - t.timestamps - end - end -end diff --git a/db/migrate/20160721173414_create_middleware_domains.rb b/db/migrate/20160721173414_create_middleware_domains.rb deleted file mode 100644 index eeac13bec..000000000 --- a/db/migrate/20160721173414_create_middleware_domains.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateMiddlewareDomains < ActiveRecord::Migration[5.0] - def change - create_table :middleware_domains do |t| - t.string :name # name of the domain - t.string :ems_ref # path - t.string :nativeid - t.string :feed - t.string :type_path - t.string :profile - t.text :properties - t.bigint :ems_id - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20160725175531_create_middleware_server_groups.rb b/db/migrate/20160725175531_create_middleware_server_groups.rb deleted file mode 100644 index ba3aa0d56..000000000 --- a/db/migrate/20160725175531_create_middleware_server_groups.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateMiddlewareServerGroups < ActiveRecord::Migration[5.0] - def change - create_table :middleware_server_groups do |t| - t.string :name # name of the server group - t.string :ems_ref # path - t.string :nativeid - t.string :feed - t.string :type_path - t.string :profile - t.text :properties - t.bigint :domain_id - - t.timestamps :null => false - end - end -end diff --git a/db/migrate/20160725175841_add_server_group_id_to_middleware_servers.rb b/db/migrate/20160725175841_add_server_group_id_to_middleware_servers.rb deleted file mode 100644 index bac520be0..000000000 --- a/db/migrate/20160725175841_add_server_group_id_to_middleware_servers.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddServerGroupIdToMiddlewareServers < ActiveRecord::Migration[5.0] - def change - add_column :middleware_servers, :server_group_id, :bigint - end -end diff --git a/db/migrate/20160726161153_add_feed_to_middleware_deployments_and_datasources.rb b/db/migrate/20160726161153_add_feed_to_middleware_deployments_and_datasources.rb deleted file mode 100644 index b784ff66a..000000000 --- a/db/migrate/20160726161153_add_feed_to_middleware_deployments_and_datasources.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddFeedToMiddlewareDeploymentsAndDatasources < ActiveRecord::Migration[5.0] - def change - add_column :middleware_deployments, :feed, :string - add_column :middleware_datasources, :feed, :string - end -end diff --git a/db/migrate/20160726162229_add_properties_to_middleware_deployments.rb b/db/migrate/20160726162229_add_properties_to_middleware_deployments.rb deleted file mode 100644 index 2596bf13b..000000000 --- a/db/migrate/20160726162229_add_properties_to_middleware_deployments.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddPropertiesToMiddlewareDeployments < ActiveRecord::Migration[5.0] - def change - add_column :middleware_deployments, :properties, :text - end -end diff --git a/db/migrate/20160729182517_remove_system_add_source_to_miq_ae_namespace.rb b/db/migrate/20160729182517_remove_system_add_source_to_miq_ae_namespace.rb deleted file mode 100644 index 746655b25..000000000 --- a/db/migrate/20160729182517_remove_system_add_source_to_miq_ae_namespace.rb +++ /dev/null @@ -1,35 +0,0 @@ -class RemoveSystemAddSourceToMiqAeNamespace < ActiveRecord::Migration[5.0] - class MiqAeNamespace < ActiveRecord::Base; end - - def up - add_column :miq_ae_namespaces, :source, :string - - say_with_time('Migrating system attribute to source in MiqAeNamespace') do - MiqAeNamespace.where(:parent_id => nil).each do |obj| - source = if obj.name == 'ManageIQ' - 'system' - elsif obj.system - 'user_locked' - else - 'user' - end - obj.update!(:source => source) - end - end - - remove_column :miq_ae_namespaces, :system - end - - def down - add_column :miq_ae_namespaces, :system, :boolean - - say_with_time('Migrating source attribute to system in MiqAeNamespace') do - MiqAeNamespace.where(:parent_id => nil).each do |obj| - system = (obj.source == 'system' || obj.source == 'user_locked') - obj.update!(:system => system) - end - end - - remove_column :miq_ae_namespaces, :source - end -end diff --git a/db/migrate/20160801170547_add_type_to_arbitration_profile.rb b/db/migrate/20160801170547_add_type_to_arbitration_profile.rb deleted file mode 100644 index b7a88c67d..000000000 --- a/db/migrate/20160801170547_add_type_to_arbitration_profile.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddTypeToArbitrationProfile < ActiveRecord::Migration[5.0] - def change - add_column :arbitration_profiles, :type, :string - add_column :arbitration_profiles, :profile, :boolean - end -end diff --git a/db/migrate/20160801214912_add_generic_subtype_to_service_template.rb b/db/migrate/20160801214912_add_generic_subtype_to_service_template.rb deleted file mode 100644 index 86d17f27d..000000000 --- a/db/migrate/20160801214912_add_generic_subtype_to_service_template.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddGenericSubtypeToServiceTemplate < ActiveRecord::Migration[5.0] - def change - add_column :service_templates, :generic_subtype, :string - add_index :service_templates, :generic_subtype - end -end diff --git a/db/migrate/20160802145938_set_generic_subtype_on_service_template.rb b/db/migrate/20160802145938_set_generic_subtype_on_service_template.rb deleted file mode 100644 index ceac827fa..000000000 --- a/db/migrate/20160802145938_set_generic_subtype_on_service_template.rb +++ /dev/null @@ -1,15 +0,0 @@ -class SetGenericSubtypeOnServiceTemplate < ActiveRecord::Migration[5.0] - class ServiceTemplate < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time('Set generic_subtype to custom on ServiceTemplate') do - ServiceTemplate.where(:prov_type => "generic").update_all(:generic_subtype => "custom") - end - end - - def down - ServiceTemplate.where(:prov_type => "generic").update_all(:generic_subtype => nil) - end -end diff --git a/db/migrate/20160805084714_create_load_balancers.rb b/db/migrate/20160805084714_create_load_balancers.rb deleted file mode 100644 index e850bf58c..000000000 --- a/db/migrate/20160805084714_create_load_balancers.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateLoadBalancers < ActiveRecord::Migration[5.0] - def change - create_table :load_balancers do |t| - t.string :ems_ref - t.string :name - t.string :description - - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - - t.timestamps - end - - add_index :load_balancers, :ems_ref - end -end diff --git a/db/migrate/20160805104342_create_load_balancer_listeners.rb b/db/migrate/20160805104342_create_load_balancer_listeners.rb deleted file mode 100644 index 5d0a28044..000000000 --- a/db/migrate/20160805104342_create_load_balancer_listeners.rb +++ /dev/null @@ -1,23 +0,0 @@ -class CreateLoadBalancerListeners < ActiveRecord::Migration[5.0] - def change - create_table :load_balancer_listeners do |t| - t.string :ems_ref - t.string :name - t.string :description - t.string :load_balancer_protocol - t.integer :load_balancer_port - t.string :instance_protocol - t.integer :instance_port - - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - t.belongs_to :load_balancer, :type => :bigint - t.belongs_to :load_balancer_pool, :type => :bigint - t.belongs_to :network_port, :type => :bigint - - t.timestamps - end - - add_index :load_balancer_listeners, :ems_ref - end -end diff --git a/db/migrate/20160805123339_create_load_balancer_pools.rb b/db/migrate/20160805123339_create_load_balancer_pools.rb deleted file mode 100644 index 5aaa884ec..000000000 --- a/db/migrate/20160805123339_create_load_balancer_pools.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateLoadBalancerPools < ActiveRecord::Migration[5.0] - def change - create_table :load_balancer_pools do |t| - t.string :ems_ref - t.string :name - t.string :description - t.string :load_balancer_algorithm - t.string :protocol - - t.belongs_to :ems, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - - t.timestamps - end - - add_index :load_balancer_pools, :ems_ref - end -end diff --git a/db/migrate/20160805134120_create_load_balancer_health_checks.rb b/db/migrate/20160805134120_create_load_balancer_health_checks.rb deleted file mode 100644 index ea42a60bc..000000000 --- a/db/migrate/20160805134120_create_load_balancer_health_checks.rb +++ /dev/null @@ -1,24 +0,0 @@ -class CreateLoadBalancerHealthChecks < ActiveRecord::Migration[5.0] - def change - create_table :load_balancer_health_checks do |t| - t.string :ems_ref - t.string :name - - t.string :protocol - t.integer :port - t.string :url_path - t.integer :interval - t.integer :timeout - t.integer :healthy_threshold - t.integer :unhealthy_threshold - - t.belongs_to :ems, :type => :bigint - t.belongs_to :load_balancer_listener, :type => :bigint - t.belongs_to :cloud_tenant, :type => :bigint - - t.timestamps - end - - add_index :load_balancer_health_checks, :ems_ref - end -end diff --git a/db/migrate/20160805134419_create_load_balancer_listener_pools.rb b/db/migrate/20160805134419_create_load_balancer_listener_pools.rb deleted file mode 100644 index 20553b213..000000000 --- a/db/migrate/20160805134419_create_load_balancer_listener_pools.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateLoadBalancerListenerPools < ActiveRecord::Migration[5.0] - def change - create_table :load_balancer_listener_pools do |t| - t.belongs_to :load_balancer_listener, :type => :bigint - t.belongs_to :load_balancer_pool, :type => :bigint - - t.timestamps - end - - add_index :load_balancer_listener_pools, - [:load_balancer_listener_id, :load_balancer_pool_id], - :name => 'load_balancer_listener_pools_index' - end -end diff --git a/db/migrate/20160805141502_create_load_balancer_pool_members.rb b/db/migrate/20160805141502_create_load_balancer_pool_members.rb deleted file mode 100644 index f3402e070..000000000 --- a/db/migrate/20160805141502_create_load_balancer_pool_members.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateLoadBalancerPoolMembers < ActiveRecord::Migration[5.0] - def change - create_table :load_balancer_pool_members do |t| - t.string :ems_ref - t.string :address - t.integer :port - - t.belongs_to :cloud_tenant, :type => :bigint - t.belongs_to :cloud_subnet, :type => :bigint - t.belongs_to :network_port, :type => :bigint - t.belongs_to :resource_group, :type => :bigint - - t.timestamps - end - - add_index :load_balancer_pool_members, :ems_ref - end -end diff --git a/db/migrate/20160805142719_create_load_balancer_health_check_members.rb b/db/migrate/20160805142719_create_load_balancer_health_check_members.rb deleted file mode 100644 index bb7dea9a9..000000000 --- a/db/migrate/20160805142719_create_load_balancer_health_check_members.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateLoadBalancerHealthCheckMembers < ActiveRecord::Migration[5.0] - def change - create_table :load_balancer_health_check_members do |t| - t.belongs_to :load_balancer_health_check, :type => :bigint, :index => { :name => 'members_load_balancer_health_check_index' } - t.belongs_to :load_balancer_pool_member, :type => :bigint, :index => { :name => 'members_load_balancer_pool_member_index' } - end - - add_index :load_balancer_health_check_members, - [:load_balancer_health_check_id, :load_balancer_pool_member_id], - :name => 'load_balancer_health_check_members_index' - end -end diff --git a/db/migrate/20160808150745_add_metrics_status_to_ext_management_system.rb b/db/migrate/20160808150745_add_metrics_status_to_ext_management_system.rb deleted file mode 100644 index 0753015d7..000000000 --- a/db/migrate/20160808150745_add_metrics_status_to_ext_management_system.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddMetricsStatusToExtManagementSystem < ActiveRecord::Migration[5.0] - def change - add_column :ext_management_systems, :last_metrics_error, :text - add_column :ext_management_systems, :last_metrics_update_date, :timestamp - add_column :ext_management_systems, :last_metrics_success_date, :timestamp - end -end diff --git a/db/migrate/20160809142710_add_vm_id_to_load_balancer_pool_members.rb b/db/migrate/20160809142710_add_vm_id_to_load_balancer_pool_members.rb deleted file mode 100644 index 7ebe372dc..000000000 --- a/db/migrate/20160809142710_add_vm_id_to_load_balancer_pool_members.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddVmIdToLoadBalancerPoolMembers < ActiveRecord::Migration[5.0] - def change - add_column :load_balancer_pool_members, :vm_id, :bigint - add_index :load_balancer_pool_members, :vm_id - end -end diff --git a/db/migrate/20160810083516_remove_load_balancer_pool_id_and_network_port_id_from_load_balancer_listeners.rb b/db/migrate/20160810083516_remove_load_balancer_pool_id_and_network_port_id_from_load_balancer_listeners.rb deleted file mode 100644 index cca4ce16a..000000000 --- a/db/migrate/20160810083516_remove_load_balancer_pool_id_and_network_port_id_from_load_balancer_listeners.rb +++ /dev/null @@ -1,14 +0,0 @@ -class RemoveLoadBalancerPoolIdAndNetworkPortIdFromLoadBalancerListeners < ActiveRecord::Migration[5.0] - def up - remove_column :load_balancer_listeners, :load_balancer_pool_id - remove_column :load_balancer_listeners, :network_port_id - end - - def down - add_column :load_balancer_listeners, :load_balancer_pool_id, :bigint - add_column :load_balancer_listeners, :network_port_id, :bigint - - add_index :load_balancer_listeners, :load_balancer_pool_id - add_index :load_balancer_listeners, :network_port_id - end -end diff --git a/db/migrate/20160810090600_add_status_and_status_reason_to_load_balancer_health_check_members.rb b/db/migrate/20160810090600_add_status_and_status_reason_to_load_balancer_health_check_members.rb deleted file mode 100644 index acdf49e5d..000000000 --- a/db/migrate/20160810090600_add_status_and_status_reason_to_load_balancer_health_check_members.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddStatusAndStatusReasonToLoadBalancerHealthCheckMembers < ActiveRecord::Migration[5.0] - def change - add_column :load_balancer_health_check_members, :status, :string - add_column :load_balancer_health_check_members, :status_reason, :string - end -end diff --git a/db/migrate/20160810091423_add_load_balancer_id_to_load_balancer_health_checks.rb b/db/migrate/20160810091423_add_load_balancer_id_to_load_balancer_health_checks.rb deleted file mode 100644 index 60557619d..000000000 --- a/db/migrate/20160810091423_add_load_balancer_id_to_load_balancer_health_checks.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddLoadBalancerIdToLoadBalancerHealthChecks < ActiveRecord::Migration[5.0] - def change - add_column :load_balancer_health_checks, :load_balancer_id, :bigint - add_index :load_balancer_health_checks, :load_balancer_id - end -end diff --git a/db/migrate/20160810111958_add_sti_types_to_load_balancer_models.rb b/db/migrate/20160810111958_add_sti_types_to_load_balancer_models.rb deleted file mode 100644 index 17dc10e33..000000000 --- a/db/migrate/20160810111958_add_sti_types_to_load_balancer_models.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddStiTypesToLoadBalancerModels < ActiveRecord::Migration[5.0] - def change - add_column :load_balancers, :type, :string - add_column :load_balancer_pools, :type, :string - add_column :load_balancer_pool_members, :type, :string - add_column :load_balancer_listeners, :type, :string - add_column :load_balancer_health_checks, :type, :string - end -end diff --git a/db/migrate/20160810123100_create_load_balancer_pool_member_pools.rb b/db/migrate/20160810123100_create_load_balancer_pool_member_pools.rb deleted file mode 100644 index 774e086ef..000000000 --- a/db/migrate/20160810123100_create_load_balancer_pool_member_pools.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateLoadBalancerPoolMemberPools < ActiveRecord::Migration[5.0] - def change - create_table :load_balancer_pool_member_pools do |t| - t.belongs_to :load_balancer_pool, :type => :bigint, :index => {:name => 'load_balancer_pool_index'} - t.belongs_to :load_balancer_pool_member, :type => :bigint, :index => {:name => 'load_balancer_pool_member_index'} - end - - add_index :load_balancer_pool_member_pools, - [:load_balancer_pool_id, :load_balancer_pool_member_id], - :name => 'load_balancer_pool_member_pools_index', - :unique => true - end -end diff --git a/db/migrate/20160810124827_add_ems_id_to_load_balancer_pool_members.rb b/db/migrate/20160810124827_add_ems_id_to_load_balancer_pool_members.rb deleted file mode 100644 index 35d3fcdf8..000000000 --- a/db/migrate/20160810124827_add_ems_id_to_load_balancer_pool_members.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddEmsIdToLoadBalancerPoolMembers < ActiveRecord::Migration[5.0] - def change - add_column :load_balancer_pool_members, :ems_id, :bigint - add_index :load_balancer_pool_members, :ems_id - end -end diff --git a/db/migrate/20160810125803_change_load_balancer_m_to_n_tables_indexes_to_unique.rb b/db/migrate/20160810125803_change_load_balancer_m_to_n_tables_indexes_to_unique.rb deleted file mode 100644 index 8c7769458..000000000 --- a/db/migrate/20160810125803_change_load_balancer_m_to_n_tables_indexes_to_unique.rb +++ /dev/null @@ -1,21 +0,0 @@ -class ChangeLoadBalancerMToNTablesIndexesToUnique < ActiveRecord::Migration[5.0] - def change - remove_index :load_balancer_health_check_members, - :column => [:load_balancer_health_check_id, :load_balancer_pool_member_id], - :name => 'load_balancer_health_check_members_index' - - add_index :load_balancer_health_check_members, - [:load_balancer_health_check_id, :load_balancer_pool_member_id], - :name => 'load_balancer_health_check_members_index', - :unique => true - - remove_index :load_balancer_listener_pools, - :column => [:load_balancer_listener_id, :load_balancer_pool_id], - :name => 'load_balancer_listener_pools_index' - - add_index :load_balancer_listener_pools, - [:load_balancer_listener_id, :load_balancer_pool_id], - :name => 'load_balancer_listener_pools_index', - :unique => true - end -end diff --git a/db/migrate/20160811081235_add_source_to_tenants.rb b/db/migrate/20160811081235_add_source_to_tenants.rb deleted file mode 100644 index 0b3662f88..000000000 --- a/db/migrate/20160811081235_add_source_to_tenants.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSourceToTenants < ActiveRecord::Migration[5.0] - def change - add_reference :tenants, :source, :type => :bigint, :polymorphic => true - end -end diff --git a/db/migrate/20160811180711_create_cloud_volume_backups.rb b/db/migrate/20160811180711_create_cloud_volume_backups.rb deleted file mode 100644 index 1a34a9289..000000000 --- a/db/migrate/20160811180711_create_cloud_volume_backups.rb +++ /dev/null @@ -1,21 +0,0 @@ -class CreateCloudVolumeBackups < ActiveRecord::Migration[5.0] - def change - create_table :cloud_volume_backups do |t| - t.bigint :ems_id - t.string :type - t.string :name - t.string :description - t.string :ems_ref - t.string :status - t.datetime :creation_time - t.integer :size - t.integer :object_count - t.boolean :is_incremental - t.boolean :has_dependent_backups - t.bigint :cloud_volume_id - t.bigint :availability_zone_id - end - - add_index "cloud_volume_backups", ["ems_id"], :name => "index_cloud_volume_backups_on_ems_id" - end -end diff --git a/db/migrate/20160817104523_create_notification_types.rb b/db/migrate/20160817104523_create_notification_types.rb deleted file mode 100644 index c99372690..000000000 --- a/db/migrate/20160817104523_create_notification_types.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateNotificationTypes < ActiveRecord::Migration[5.0] - def change - create_table :notification_types do |t| - t.string :name, :limit => 64 - t.string :level, :limit => 16 - t.string :audience, :limit => 16 - t.text :message - t.integer :expires_in - end - add_index :notification_types, :name, :unique => true - end -end diff --git a/db/migrate/20160817120209_create_notifications.rb b/db/migrate/20160817120209_create_notifications.rb deleted file mode 100644 index 953bb3451..000000000 --- a/db/migrate/20160817120209_create_notifications.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateNotifications < ActiveRecord::Migration[5.0] - def change - create_table :notifications do |t| - t.references :notification_type, :foreign_key => true, :type => :bigint, :null => false - t.references :user, :foreign_key => true, :type => :bigint - t.references :subject, :polymorphic => true, :type => :bigint - t.references :cause, :polymorphic => true, :type => :bigint - - t.timestamps - end - end -end diff --git a/db/migrate/20160817121951_create_notification_recipients.rb b/db/migrate/20160817121951_create_notification_recipients.rb deleted file mode 100644 index 911759912..000000000 --- a/db/migrate/20160817121951_create_notification_recipients.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateNotificationRecipients < ActiveRecord::Migration[5.0] - def change - create_table :notification_recipients do |t| - t.references :notification, :foreign_key => true, :type => :bigint - t.references :user, :foreign_key => true, :type => :bigint - t.boolean :seen - end - end -end diff --git a/db/migrate/20160820003340_add_flavor_multi_tenant_relationship.rb b/db/migrate/20160820003340_add_flavor_multi_tenant_relationship.rb deleted file mode 100644 index 089b01e3b..000000000 --- a/db/migrate/20160820003340_add_flavor_multi_tenant_relationship.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddFlavorMultiTenantRelationship < ActiveRecord::Migration[5.0] - def change - create_table :cloud_tenant_flavors do |t| - t.column :cloud_tenant_id, :bigint - t.column :flavor_id, :bigint - end - add_column :flavors, :publicly_available, :boolean - add_index :cloud_tenant_flavors, [:cloud_tenant_id, :flavor_id], :unique => true - end -end diff --git a/db/migrate/20160825070810_fix_null_verify_ssl_on_endpoints.rb b/db/migrate/20160825070810_fix_null_verify_ssl_on_endpoints.rb deleted file mode 100644 index 5520024f7..000000000 --- a/db/migrate/20160825070810_fix_null_verify_ssl_on_endpoints.rb +++ /dev/null @@ -1,21 +0,0 @@ -class FixNullVerifySslOnEndpoints < ActiveRecord::Migration[5.0] - # 20151222103721_migrate_provider_attributes_to_endpoints.rb - # this migration moved verify_ssl from the Provider class to Endpoint - # but a lot of ems at this point did not have a Provider - # That resulted in verify_ssl being nil for all Endpoint, - # but the Endpoint class requires it being not nil - class Endpoint < ActiveRecord::Base - end - - def up - say_with_time("Fixing defaults for verify_ssl in Endpoint") do - # at the point of writing this is the default for verify_ssl - # OpenSSL::SSL::VERIFY_PEER == 1 in ruby stdlib 2.3.1 - Endpoint.where(:verify_ssl => nil).update_all(:verify_ssl => 1) - end - end - - def down - # irreversible, sorry - end -end diff --git a/db/migrate/20160825145949_remove_name_from_arbitration_rules.rb b/db/migrate/20160825145949_remove_name_from_arbitration_rules.rb deleted file mode 100644 index d5c35f63e..000000000 --- a/db/migrate/20160825145949_remove_name_from_arbitration_rules.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveNameFromArbitrationRules < ActiveRecord::Migration[5.0] - def up - remove_column :arbitration_rules, :name - end - - def down - add_column :arbitration_rules, :name, :string - end -end diff --git a/db/migrate/20160825152940_fix_port_zero_on_enpoints.rb b/db/migrate/20160825152940_fix_port_zero_on_enpoints.rb deleted file mode 100644 index d0003a8a4..000000000 --- a/db/migrate/20160825152940_fix_port_zero_on_enpoints.rb +++ /dev/null @@ -1,16 +0,0 @@ -class FixPortZeroOnEnpoints < ActiveRecord::Migration[5.0] - # the problem was in that migration 20141121200153_migrate_ems_attributes_to_endpoints.rb - # here port got converted from a string to int, but "".to_i is 0. - class Endpoint < ActiveRecord::Base - end - - def up - say_with_time("Fixing ports 0 in Endpoint") do - Endpoint.where(:port => 0).update_all(:port => nil) - end - end - - def down - # irreversible, sorry - end -end diff --git a/db/migrate/20160825203056_add_state_to_hardware.rb b/db/migrate/20160825203056_add_state_to_hardware.rb deleted file mode 100644 index dcedf6966..000000000 --- a/db/migrate/20160825203056_add_state_to_hardware.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddStateToHardware < ActiveRecord::Migration[5.0] - def change - add_column :hardwares, :introspected, :boolean - add_column :hardwares, :provision_state, :string - end -end diff --git a/db/migrate/20160826184028_add_notification_tables_to_replication_excludes.rb b/db/migrate/20160826184028_add_notification_tables_to_replication_excludes.rb deleted file mode 100644 index 94ed233ad..000000000 --- a/db/migrate/20160826184028_add_notification_tables_to_replication_excludes.rb +++ /dev/null @@ -1,29 +0,0 @@ -class AddNotificationTablesToReplicationExcludes < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - EXCLUDES_KEY = "/workers/worker_base/replication_worker/replication/exclude_tables".freeze - - def up - say_with_time("Adding notification tables to replication excludes") do - SettingsChange.where(:key => EXCLUDES_KEY).each do |s| - s.value << "notifications" - s.value << "notification_recipients" - s.value << "notification_types" - s.save! - end - end - end - - def down - say_with_time("Removing notification tables from replication excludes") do - SettingsChange.where(:key => EXCLUDES_KEY).each do |s| - s.value.delete("notifications") - s.value.delete("notification_recipients") - s.value.delete("notification_types") - s.save! - end - end - end -end diff --git a/db/migrate/20160829134746_remove_atomic_container_providers.rb b/db/migrate/20160829134746_remove_atomic_container_providers.rb deleted file mode 100644 index d968c2f3b..000000000 --- a/db/migrate/20160829134746_remove_atomic_container_providers.rb +++ /dev/null @@ -1,53 +0,0 @@ -class RemoveAtomicContainerProviders < ActiveRecord::Migration[5.0] - include MigrationHelper - - NAME_MAP = Hash[*%w( - ManageIQ::Providers::Atomic::ContainerManager ManageIQ::Providers::Openshift::ContainerManager - ManageIQ::Providers::Atomic::ContainerManager::EventCatcher ManageIQ::Providers::Openshift::ContainerManager::EventCatcher - ManageIQ::Providers::Atomic::ContainerManager::EventCatcher::Runner ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner - ManageIQ::Providers::Atomic::ContainerManager::EventParser ManageIQ::Providers::Openshift::ContainerManager::EventParser - ManageIQ::Providers::Atomic::ContainerManager::MetricsCollectorWorker ManageIQ::Providers::Openshift::ContainerManager::MetricsCollectorWorker - ManageIQ::Providers::Atomic::ContainerManager::MetricsCollectorWorker::Runner ManageIQ::Providers::Openshift::ContainerManager::MetricsCollectorWorker::Runner - ManageIQ::Providers::Atomic::ContainerManager::RefreshParser ManageIQ::Providers::Openshift::ContainerManager::RefreshParser - ManageIQ::Providers::Atomic::ContainerManager::RefreshWorker ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker - ManageIQ::Providers::Atomic::ContainerManager::RefreshWorker::Runner ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker::Runner - ManageIQ::Providers::Atomic::ContainerManager::Refresher ManageIQ::Providers::Openshift::ContainerManager::Refresher - - ManageIQ::Providers::AtomicEnterprise::ContainerManager ManageIQ::Providers::OpenshiftEnterprise::ContainerManager - ManageIQ::Providers::AtomicEnterprise::ContainerManager::EventCatcher ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventCatcher - ManageIQ::Providers::AtomicEnterprise::ContainerManager::EventCatcher::Runner ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventCatcher::Runner - ManageIQ::Providers::AtomicEnterprise::ContainerManager::EventParser ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventParser - ManageIQ::Providers::AtomicEnterprise::ContainerManager::MetricsCollectorWorker ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::MetricsCollectorWorker - ManageIQ::Providers::AtomicEnterprise::ContainerManager::MetricsCollectorWorker::Runner ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::MetricsCollectorWorker::Runner - ManageIQ::Providers::AtomicEnterprise::ContainerManager::RefreshParser ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshParser - ManageIQ::Providers::AtomicEnterprise::ContainerManager::RefreshWorker ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshWorker - ManageIQ::Providers::AtomicEnterprise::ContainerManager::RefreshWorker::Runner ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshWorker::Runner - ManageIQ::Providers::AtomicEnterprise::ContainerManager::Refresher ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::Refresher - )] - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiqWorker < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Authentication < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiqQueue < ActiveRecord::Base; end - - def up - rename_class_references(NAME_MAP) - - say_with_time "Rename Atomic to Openshift in Authentication:name" do - Authentication.update_all("name = replace(name, 'ManageIQ::Providers::Atomic', 'ManageIQ::Providers::Openshift')") - end - - say_with_time "Rename Atomic to Openshift in MiqQueue:args" do - MiqQueue.update_all("args = replace(args, 'ManageIQ::Providers::Atomic', 'ManageIQ::Providers::Openshift')") - end - end -end diff --git a/db/migrate/20160829152511_add_retirement_cols_to_load_balancers.rb b/db/migrate/20160829152511_add_retirement_cols_to_load_balancers.rb deleted file mode 100644 index e3fce402c..000000000 --- a/db/migrate/20160829152511_add_retirement_cols_to_load_balancers.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddRetirementColsToLoadBalancers < ActiveRecord::Migration[5.0] - def change - add_column :load_balancers, :retired, :boolean - add_column :load_balancers, :retires_on, :date - add_column :load_balancers, :retirement_warn, :bigint - add_column :load_balancers, :retirement_last_warn, :datetime - add_column :load_balancers, :retirement_state, :string - add_column :load_balancers, :retirement_requester, :string - end -end diff --git a/db/migrate/20160830110050_change_cloud_subnets_network_ports_unique_index.rb b/db/migrate/20160830110050_change_cloud_subnets_network_ports_unique_index.rb deleted file mode 100644 index 162db10db..000000000 --- a/db/migrate/20160830110050_change_cloud_subnets_network_ports_unique_index.rb +++ /dev/null @@ -1,15 +0,0 @@ -class ChangeCloudSubnetsNetworkPortsUniqueIndex < ActiveRecord::Migration[5.0] - def change - remove_index :cloud_subnets_network_ports, - :column => [:cloud_subnet_id, :network_port_id], - :name => 'index_cloud_subnets_network_ports', - :unique => true - - add_index :cloud_subnets_network_ports, :address - - add_index :cloud_subnets_network_ports, - [:cloud_subnet_id, :network_port_id, :address], - :name => 'index_cloud_subnets_network_ports_address', - :unique => true - end -end diff --git a/db/migrate/20160830233154_add_port_ranges_to_load_balancer_listener.rb b/db/migrate/20160830233154_add_port_ranges_to_load_balancer_listener.rb deleted file mode 100644 index 7b91259e0..000000000 --- a/db/migrate/20160830233154_add_port_ranges_to_load_balancer_listener.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddPortRangesToLoadBalancerListener < ActiveRecord::Migration[5.0] - def change - change_table :load_balancer_listeners do |t| - t.column :load_balancer_port_range, :int4range - t.column :instance_port_range, :int4range - end - end -end diff --git a/db/migrate/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener.rb b/db/migrate/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener.rb deleted file mode 100644 index cd7ac623c..000000000 --- a/db/migrate/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener.rb +++ /dev/null @@ -1,36 +0,0 @@ -class MigratePortsToPortRangesInLoadBalancerListener < ActiveRecord::Migration[5.0] - class LoadBalancerListener < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time("Migrating LoadBalancerListeners instance_port values to instance_port_range...") do - LoadBalancerListener.where.not(:instance_port => nil).each do |x| - x.update(:instance_port_range => x.instance_port..x.instance_port, - :instance_port => nil) - end - end - say_with_time("Migrating LoadBalancerListeners load_balancer_port values to load_balancer_port_range...") do - LoadBalancerListener.where.not(:load_balancer_port => nil).each do |x| - x.update(:load_balancer_port_range => x.load_balancer_port..x.load_balancer_port, - :load_balancer_port => nil) - end - end - end - - def down - say_with_time("Migrating LoadBalancerListeners load_balancer_port_range values to load_balancer_port"\ - " (where possible)...") do - LoadBalancerListener.where.not(:load_balancer_port_range => nil).each do |x| - x.update(:load_balancer_port => x.load_balancer_port_range.begin) if x.load_balancer_port_range.size == 1 - x.update(:load_balancer_port_range => nil) - end - end - say_with_time("Migrating LoadBalancerListeners instance_port_range values to instance_port (where possible)...") do - LoadBalancerListener.where.not(:instance_port_range => nil).each do |x| - x.update(:instance_port => x.instance_port_range.begin) if x.instance_port_range.size == 1 - x.update(:instance_port_range => nil) - end - end - end -end diff --git a/db/migrate/20160830233842_drop_ports_in_load_balancer_listener.rb b/db/migrate/20160830233842_drop_ports_in_load_balancer_listener.rb deleted file mode 100644 index 0957ed5f4..000000000 --- a/db/migrate/20160830233842_drop_ports_in_load_balancer_listener.rb +++ /dev/null @@ -1,6 +0,0 @@ -class DropPortsInLoadBalancerListener < ActiveRecord::Migration[5.0] - def change - remove_column :load_balancer_listeners, :load_balancer_port, :integer - remove_column :load_balancer_listeners, :instance_port, :integer - end -end diff --git a/db/migrate/20160911130449_add_value_serialized_to_custom_attribute.rb b/db/migrate/20160911130449_add_value_serialized_to_custom_attribute.rb deleted file mode 100644 index 5e369d978..000000000 --- a/db/migrate/20160911130449_add_value_serialized_to_custom_attribute.rb +++ /dev/null @@ -1,19 +0,0 @@ -class AddValueSerializedToCustomAttribute < ActiveRecord::Migration[5.0] - class CustomAttribute < ActiveRecord::Base - serialize :serialized_value - end - - def up - add_column :custom_attributes, :serialized_value, :text - - say_with_time "Copying values to serialized_value" do - CustomAttribute.all.each do |custom_attribute| - custom_attribute.update!(:serialized_value => custom_attribute.value) - end - end - end - - def down - remove_column :custom_attributes, :serialized_value - end -end diff --git a/db/migrate/20160912160750_change_retires_on_to_datetime.rb b/db/migrate/20160912160750_change_retires_on_to_datetime.rb deleted file mode 100644 index 7ba58e5ed..000000000 --- a/db/migrate/20160912160750_change_retires_on_to_datetime.rb +++ /dev/null @@ -1,15 +0,0 @@ -class ChangeRetiresOnToDatetime < ActiveRecord::Migration[5.0] - def up - change_column :vms, :retires_on, :datetime - change_column :services, :retires_on, :datetime - change_column :orchestration_stacks, :retires_on, :datetime - change_column :load_balancers, :retires_on, :datetime - end - - def down - change_column :vms, :retires_on, :date - change_column :services, :retires_on, :date - change_column :orchestration_stacks, :retires_on, :date - change_column :load_balancers, :retires_on, :date - end -end diff --git a/db/migrate/20160912183918_add_source_to_network_ports.rb b/db/migrate/20160912183918_add_source_to_network_ports.rb deleted file mode 100644 index 13dbec30a..000000000 --- a/db/migrate/20160912183918_add_source_to_network_ports.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSourceToNetworkPorts < ActiveRecord::Migration[5.0] - def change - add_column :network_ports, :source, :string - end -end diff --git a/db/migrate/20160913195129_move_repo_data_from_database_to_settings.rb b/db/migrate/20160913195129_move_repo_data_from_database_to_settings.rb deleted file mode 100644 index 28af4019d..000000000 --- a/db/migrate/20160913195129_move_repo_data_from_database_to_settings.rb +++ /dev/null @@ -1,43 +0,0 @@ -class MoveRepoDataFromDatabaseToSettings < ActiveRecord::Migration[5.0] - class MiqRegion < ActiveRecord::Base; end - class MiqDatabase < ActiveRecord::Base; end - class SettingsChange < ActiveRecord::Base - serialize :value - end - - SETTING_KEY = "/product/update_repo_names".freeze - - def up - db = MiqDatabase.first - return unless db.try(:update_repo_name) && my_region - - say_with_time("Moving repo information from miq_databases to Settings") do - repos = db.update_repo_name.split - SettingsChange.create!(settings_hash.merge(:value => repos)) - end - end - - def down - return unless my_region - change = SettingsChange.where(settings_hash).first - return unless change - - say_with_time("Moving repo information from Settings to miq_databases") do - db = MiqDatabase.first - db.update!(:update_repo_name => change.value.join(" ")) if db - change.delete - end - end - - def my_region - MiqRegion.find_by(:region => anonymous_class_with_id_regions.my_region_number) - end - - def settings_hash - { - :resource_type => "MiqRegion", - :resource_id => my_region.id, - :key => SETTING_KEY - } - end -end diff --git a/db/migrate/20160913195130_remove_update_repo_name_from_miq_databases.rb b/db/migrate/20160913195130_remove_update_repo_name_from_miq_databases.rb deleted file mode 100644 index 20b114ed4..000000000 --- a/db/migrate/20160913195130_remove_update_repo_name_from_miq_databases.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveUpdateRepoNameFromMiqDatabases < ActiveRecord::Migration[5.0] - def change - remove_column :miq_databases, :update_repo_name, :string - end -end diff --git a/db/migrate/20160915100611_add_openshift_data_to_container_image.rb b/db/migrate/20160915100611_add_openshift_data_to_container_image.rb deleted file mode 100644 index 72e85c38f..000000000 --- a/db/migrate/20160915100611_add_openshift_data_to_container_image.rb +++ /dev/null @@ -1,16 +0,0 @@ -class AddOpenshiftDataToContainerImage < ActiveRecord::Migration[5.0] - def change - add_column :container_images, :architecture, :string - add_column :container_images, :author, :string - add_column :container_images, :command, :string, :array => true, :default => [] - add_column :container_images, :entrypoint, :string, :array => true, :default => [] - add_column :container_images, :docker_version, :string - - add_column :container_images, :exposed_ports, :text - add_column :container_images, :environment_variables, :text - - add_column :container_images, :size, :bigint - - add_column :container_images, :created_on, :datetime - end -end diff --git a/db/migrate/20160915112948_add_disconnection_fields_to_container_image.rb b/db/migrate/20160915112948_add_disconnection_fields_to_container_image.rb deleted file mode 100644 index c0682d721..000000000 --- a/db/migrate/20160915112948_add_disconnection_fields_to_container_image.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddDisconnectionFieldsToContainerImage < ActiveRecord::Migration[5.0] - def change - add_column :container_images, :old_ems_id, :bigint - add_column :container_images, :deleted_on, :datetime - end -end diff --git a/db/migrate/20160915160023_add_tenant_mapping_enabled_to_ext_management_systems.rb b/db/migrate/20160915160023_add_tenant_mapping_enabled_to_ext_management_systems.rb deleted file mode 100644 index 7984951cc..000000000 --- a/db/migrate/20160915160023_add_tenant_mapping_enabled_to_ext_management_systems.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddTenantMappingEnabledToExtManagementSystems < ActiveRecord::Migration[5.0] - def change - add_column :ext_management_systems, :tenant_mapping_enabled, :boolean - end -end diff --git a/db/migrate/20160915160517_create_shares.rb b/db/migrate/20160915160517_create_shares.rb deleted file mode 100644 index 80482453d..000000000 --- a/db/migrate/20160915160517_create_shares.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateShares < ActiveRecord::Migration[5.0] - def change - create_table :shares do |t| - t.references :resource, :type => :bigint, :polymorphic => true - t.references :tenant, :type => :bigint - t.references :user, :type => :bigint - t.boolean :allow_tenant_inheritance - t.timestamps - end - - create_table :miq_product_features_shares do |t| - t.references :miq_product_feature, :type => :bigint - t.references :share, :type => :bigint - end - end -end diff --git a/db/migrate/20160915173610_create_service_connections.rb b/db/migrate/20160915173610_create_service_connections.rb deleted file mode 100644 index 0a2e929a7..000000000 --- a/db/migrate/20160915173610_create_service_connections.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateServiceConnections < ActiveRecord::Migration[5.0] - def change - create_table :service_connections do |t| - t.bigint :service_bundle_id - t.bigint :service_template_a_id - t.bigint :service_template_b_id - t.text :properties - end - add_index :service_connections, :service_template_a_id - add_index :service_connections, :service_template_b_id - end -end diff --git a/db/migrate/20160915173740_add_blueprint_to_dialogs.rb b/db/migrate/20160915173740_add_blueprint_to_dialogs.rb deleted file mode 100644 index 8285d5eb9..000000000 --- a/db/migrate/20160915173740_add_blueprint_to_dialogs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddBlueprintToDialogs < ActiveRecord::Migration[5.0] - def change - add_column :dialogs, :blueprint_id, :bigint - end -end diff --git a/db/migrate/20160915195120_add_timestamps_to_arbitration_profile.rb b/db/migrate/20160915195120_add_timestamps_to_arbitration_profile.rb deleted file mode 100644 index 909449546..000000000 --- a/db/migrate/20160915195120_add_timestamps_to_arbitration_profile.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddTimestampsToArbitrationProfile < ActiveRecord::Migration[5.0] - def change - add_timestamps(:arbitration_profiles) - end -end diff --git a/db/migrate/20160919115131_add_details_to_system_consoles.rb b/db/migrate/20160919115131_add_details_to_system_consoles.rb deleted file mode 100644 index cacef5879..000000000 --- a/db/migrate/20160919115131_add_details_to_system_consoles.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddDetailsToSystemConsoles < ActiveRecord::Migration[5.0] - def change - add_column :system_consoles, :url, :string - add_column :system_consoles, :proxy_pid, :integer - add_column :system_consoles, :proxy_status, :string - end -end diff --git a/db/migrate/20160919145034_add_top_level_namespace_to_miq_ae_namespaces.rb b/db/migrate/20160919145034_add_top_level_namespace_to_miq_ae_namespaces.rb deleted file mode 100644 index a2966abf3..000000000 --- a/db/migrate/20160919145034_add_top_level_namespace_to_miq_ae_namespaces.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddTopLevelNamespaceToMiqAeNamespaces < ActiveRecord::Migration[5.0] - def change - add_column :miq_ae_namespaces, :top_level_namespace, :string - end -end diff --git a/db/migrate/20160921072726_add_options_to_notifications.rb b/db/migrate/20160921072726_add_options_to_notifications.rb deleted file mode 100644 index bdf66e959..000000000 --- a/db/migrate/20160921072726_add_options_to_notifications.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddOptionsToNotifications < ActiveRecord::Migration[5.0] - def change - add_column :notifications, :options, :text - end -end diff --git a/db/migrate/20160922090347_remove_field_region_from_users.rb b/db/migrate/20160922090347_remove_field_region_from_users.rb deleted file mode 100644 index f29511ec3..000000000 --- a/db/migrate/20160922090347_remove_field_region_from_users.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveFieldRegionFromUsers < ActiveRecord::Migration[5.0] - def change - remove_index :users, :column => [:userid, :region], - :name => :index_users_on_userid_and_region, - :unique => true - add_index :users, [:userid], :name => :index_users_on_userid - remove_column :users, :region, :integer - end -end diff --git a/db/migrate/20160922171248_change_arbitration_rules_arbitration_profile_id_to_big_int.rb b/db/migrate/20160922171248_change_arbitration_rules_arbitration_profile_id_to_big_int.rb deleted file mode 100644 index 99a6b151c..000000000 --- a/db/migrate/20160922171248_change_arbitration_rules_arbitration_profile_id_to_big_int.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ChangeArbitrationRulesArbitrationProfileIdToBigInt < ActiveRecord::Migration[5.0] - def up - change_column :arbitration_rules, :arbitration_profile_id, :bigint - end - - def down - change_column :arbitration_rules, :arbitration_profile_id, :int - end -end diff --git a/db/migrate/20160922212345_remove_notifications_foreign_key_constraints.rb b/db/migrate/20160922212345_remove_notifications_foreign_key_constraints.rb deleted file mode 100644 index 7b6febe41..000000000 --- a/db/migrate/20160922212345_remove_notifications_foreign_key_constraints.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveNotificationsForeignKeyConstraints < ActiveRecord::Migration[5.0] - def change - remove_foreign_key :notifications, :notification_types - remove_foreign_key :notifications, :users - end -end diff --git a/db/migrate/20160922212346_remove_notification_recipients_foreign_key_constraints.rb b/db/migrate/20160922212346_remove_notification_recipients_foreign_key_constraints.rb deleted file mode 100644 index 225b96a7a..000000000 --- a/db/migrate/20160922212346_remove_notification_recipients_foreign_key_constraints.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveNotificationRecipientsForeignKeyConstraints < ActiveRecord::Migration[5.0] - def change - remove_foreign_key :notification_recipients, :notifications - remove_foreign_key :notification_recipients, :users - end -end diff --git a/db/migrate/20160922232606_change_cloud_volume_backup_size_to_bigint.rb b/db/migrate/20160922232606_change_cloud_volume_backup_size_to_bigint.rb deleted file mode 100644 index 91eecb5f7..000000000 --- a/db/migrate/20160922232606_change_cloud_volume_backup_size_to_bigint.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ChangeCloudVolumeBackupSizeToBigint < ActiveRecord::Migration[5.0] - def up - change_column :cloud_volume_backups, :size, :bigint - end - - def down - change_column :cloud_volume_backups, :size, :integer - end -end diff --git a/db/migrate/20160922234606_add_mem_and_swap_free_and_used_to_miq_servers.rb b/db/migrate/20160922234606_add_mem_and_swap_free_and_used_to_miq_servers.rb deleted file mode 100644 index 884e037ee..000000000 --- a/db/migrate/20160922234606_add_mem_and_swap_free_and_used_to_miq_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddMemAndSwapFreeAndUsedToMiqServers < ActiveRecord::Migration[5.0] - def change - add_column :miq_servers, :system_memory_free, :decimal, :precision => 20, :scale => 0 - add_column :miq_servers, :system_memory_used, :decimal, :precision => 20, :scale => 0 - add_column :miq_servers, :system_swap_free, :decimal, :precision => 20, :scale => 0 - add_column :miq_servers, :system_swap_used, :decimal, :precision => 20, :scale => 0 - end -end diff --git a/db/migrate/20160922235000_create_ancestry_indexes.rb b/db/migrate/20160922235000_create_ancestry_indexes.rb deleted file mode 100644 index 3fe85cab3..000000000 --- a/db/migrate/20160922235000_create_ancestry_indexes.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateAncestryIndexes < ActiveRecord::Migration[5.0] - def change - add_index :relationships, 'ancestry varchar_pattern_ops', :name => "index_relationships_on_ancestry_vpo" - add_index :orchestration_stacks, 'ancestry varchar_pattern_ops', :name => "index_orchestration_stacks_on_ancestry_vpo" - add_index :services, 'ancestry varchar_pattern_ops', :name => "index_services_on_ancestry_vpo" - add_index :tenants, 'ancestry varchar_pattern_ops', :name => "index_tenants_on_ancestry_vpo" - end -end diff --git a/db/migrate/20160923000000_remove_replication_excludes_from_settings.rb b/db/migrate/20160923000000_remove_replication_excludes_from_settings.rb deleted file mode 100644 index 2dc8dc944..000000000 --- a/db/migrate/20160923000000_remove_replication_excludes_from_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -class RemoveReplicationExcludesFromSettings < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - EXCLUDES_KEY = "/replication/exclude_tables".freeze - - def up - say_with_time("Removing configured replication excludes") do - SettingsChange.where(:key => EXCLUDES_KEY).delete_all - end - end -end diff --git a/db/migrate/20161010184005_create_physical_servers.rb b/db/migrate/20161010184005_create_physical_servers.rb deleted file mode 100644 index 8f2740725..000000000 --- a/db/migrate/20161010184005_create_physical_servers.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreatePhysicalServers < ActiveRecord::Migration[5.0] - def change - create_table :physical_servers do |t| - t.bigint :ems_id - t.string :name - t.string :type - t.string :uid_ems - t.string :ems_ref - t.timestamps - end - end -end diff --git a/db/migrate/20161024173542_add_cpu_memory_hot_plug_to_vms.rb b/db/migrate/20161024173542_add_cpu_memory_hot_plug_to_vms.rb deleted file mode 100644 index 7fbf21f57..000000000 --- a/db/migrate/20161024173542_add_cpu_memory_hot_plug_to_vms.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddCpuMemoryHotPlugToVms < ActiveRecord::Migration[5.0] - def change - add_column :vms, :cpu_hot_add_enabled, :boolean - add_column :vms, :cpu_hot_remove_enabled, :boolean - add_column :vms, :memory_hot_add_enabled, :boolean - add_column :vms, :memory_hot_add_limit, :int - add_column :vms, :memory_hot_add_increment, :int - end -end diff --git a/db/migrate/20161101174139_rename_ems_events_purging_settings_keys.rb b/db/migrate/20161101174139_rename_ems_events_purging_settings_keys.rb deleted file mode 100644 index 340e7ec10..000000000 --- a/db/migrate/20161101174139_rename_ems_events_purging_settings_keys.rb +++ /dev/null @@ -1,28 +0,0 @@ -class RenameEmsEventsPurgingSettingsKeys < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - OLD_KEYS = %w( - /ems_events/history/keep_ems_events - /workers/worker_base/schedule_worker/ems_events_purge_interval - ).freeze - NEW_KEYS = %w( - /event_streams/history/keep_events - /workers/worker_base/schedule_worker/event_streams_purge_interval - ).freeze - - def up - say_with_time("Renaming ems_events purging settings keys") do - OLD_KEYS.zip(NEW_KEYS).each do |old, new| - SettingsChange.where(:key => old).update_all(:key => new) - end - end - end - - def down - OLD_KEYS.zip(NEW_KEYS).each do |old, new| - SettingsChange.where(:key => new).update_all(:key => old) - end - end -end diff --git a/db/migrate/20161102093322_add_missing_fields_to_alert_statuses.rb b/db/migrate/20161102093322_add_missing_fields_to_alert_statuses.rb deleted file mode 100644 index 6afef33fe..000000000 --- a/db/migrate/20161102093322_add_missing_fields_to_alert_statuses.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddMissingFieldsToAlertStatuses < ActiveRecord::Migration[5.0] - def change - add_column :miq_alert_statuses, :url, :text - add_column :miq_alert_statuses, :severity, :string - add_column :miq_alert_statuses, :ancestry, :string - add_column :miq_alert_statuses, :acknowledged, :boolean - add_index :miq_alert_statuses, :ancestry - end -end diff --git a/db/migrate/20161113091851_add_miq_alert_status_actions.rb b/db/migrate/20161113091851_add_miq_alert_status_actions.rb deleted file mode 100644 index 4e7164d70..000000000 --- a/db/migrate/20161113091851_add_miq_alert_status_actions.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddMiqAlertStatusActions < ActiveRecord::Migration[5.0] - def change - create_table :miq_alert_status_actions do |t| - t.string :action_type - t.belongs_to :user, :type => :bigint - t.string :comment - t.belongs_to :assignee, :type => :bigint - t.belongs_to :miq_alert_status, :type => :bigint - t.timestamps - end - end -end diff --git a/db/migrate/20161211162552_add_generating_ems_to_event_streams.rb b/db/migrate/20161211162552_add_generating_ems_to_event_streams.rb deleted file mode 100644 index 77fc150a0..000000000 --- a/db/migrate/20161211162552_add_generating_ems_to_event_streams.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddGeneratingEmsToEventStreams < ActiveRecord::Migration[5.0] - def change - add_reference :event_streams, :generating_ems, :type => :bigint - end -end diff --git a/db/migrate/20161213112148_add_server_group_id_to_middleware_deployments.rb b/db/migrate/20161213112148_add_server_group_id_to_middleware_deployments.rb deleted file mode 100644 index 171d1f7f9..000000000 --- a/db/migrate/20161213112148_add_server_group_id_to_middleware_deployments.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddServerGroupIdToMiddlewareDeployments < ActiveRecord::Migration[5.0] - def change - add_column :middleware_deployments, :server_group_id, :bigint - end -end diff --git a/db/migrate/20161213140739_remove_remote_api_settings.rb b/db/migrate/20161213140739_remove_remote_api_settings.rb deleted file mode 100644 index 2601de206..000000000 --- a/db/migrate/20161213140739_remove_remote_api_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -class RemoveRemoteApiSettings < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - API_AUTH_KEY = "/webservices/remote_miq_api%".freeze - - def up - say_with_time("Removing configured API authentication") do - SettingsChange.where("key LIKE ?", API_AUTH_KEY).delete_all - end - end -end diff --git a/db/migrate/20170109101053_create_chargeable_fields.rb b/db/migrate/20170109101053_create_chargeable_fields.rb deleted file mode 100644 index 82ec6aa60..000000000 --- a/db/migrate/20170109101053_create_chargeable_fields.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateChargeableFields < ActiveRecord::Migration[5.0] - def change - create_table :chargeable_fields do |t| - t.bigint :chargeback_rate_detail_measure_id - t.string :metric - t.string :group - t.string :source - t.string :description - end - end -end diff --git a/db/migrate/20170109124924_add_chargeable_field_to_chargeback_rate_detail.rb b/db/migrate/20170109124924_add_chargeable_field_to_chargeback_rate_detail.rb deleted file mode 100644 index d7711c1ad..000000000 --- a/db/migrate/20170109124924_add_chargeable_field_to_chargeback_rate_detail.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddChargeableFieldToChargebackRateDetail < ActiveRecord::Migration[5.0] - def change - add_column :chargeback_rate_details, :chargeable_field_id, :bigint - end -end diff --git a/db/migrate/20170109142011_extract_field_data_from_rate_detail.rb b/db/migrate/20170109142011_extract_field_data_from_rate_detail.rb deleted file mode 100644 index f88257427..000000000 --- a/db/migrate/20170109142011_extract_field_data_from_rate_detail.rb +++ /dev/null @@ -1,39 +0,0 @@ -class ExtractFieldDataFromRateDetail < ActiveRecord::Migration[5.0] - class ChargebackRate < ActiveRecord::Base - end - - class ChargeableField < ActiveRecord::Base - end - - class ChargebackRateDetail < ActiveRecord::Base - belongs_to :chargeback_rate - belongs_to :chargeable_field - - def to_h - { :metric => metric, :source => source, :group => group, :description => description, - :chargeback_rate_detail_measure_id => chargeback_rate_detail_measure_id } - end - - def metric - # fixed_compute_n and fixed_storage_n had metric=nil, we need it to have metric!=nil so we can reference it - self[:metric] || "#{group}_#{source}" - end - end - - def up - # Cannot create in bulk, there are inconsistencies in the database. One would think that - # (:metric, :source, :group, :description) quaternion depends is function of :metric. - # Unfortunatelly it may not be. And we want it to be. - fields_cache = {} - ChargebackRateDetail.joins(:chargeback_rate).where(:chargeback_rates => {:default => true}).each do |rate| - rate.chargeable_field = ChargeableField.create!(rate.to_h) - rate.save! - fields_cache[rate.metric] = rate.chargeable_field - end - - ChargebackRateDetail.where(:chargeable_field_id => nil).each do |rate| - rate.chargeable_field = fields_cache[rate.metric] - rate.save! - end - end -end diff --git a/db/migrate/20170109190411_make_job_belong_to_miq_task.rb b/db/migrate/20170109190411_make_job_belong_to_miq_task.rb deleted file mode 100644 index b92552d02..000000000 --- a/db/migrate/20170109190411_make_job_belong_to_miq_task.rb +++ /dev/null @@ -1,5 +0,0 @@ -class MakeJobBelongToMiqTask < ActiveRecord::Migration[5.0] - def change - add_reference :jobs, :miq_task, :type => "bigint", :index => true - end -end diff --git a/db/migrate/20170109221226_create_configuration_script_sources.rb b/db/migrate/20170109221226_create_configuration_script_sources.rb deleted file mode 100644 index 8313b3815..000000000 --- a/db/migrate/20170109221226_create_configuration_script_sources.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateConfigurationScriptSources < ActiveRecord::Migration[5.0] - def change - create_table :configuration_script_sources do |t| - t.belongs_to :manager, :type => :bigint - t.string :manager_ref - t.string :name - t.string :description - t.timestamps - end - end -end diff --git a/db/migrate/20170110090935_add_ems_to_miq_alert_status.rb b/db/migrate/20170110090935_add_ems_to_miq_alert_status.rb deleted file mode 100644 index a049e36cc..000000000 --- a/db/migrate/20170110090935_add_ems_to_miq_alert_status.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddEmsToMiqAlertStatus < ActiveRecord::Migration[5.0] - def change - add_column :miq_alert_statuses, :ems_id, :bigint - end -end diff --git a/db/migrate/20170111033729_add_configuration_script_payload_and_configuration_script_source_to_configuration_scripts.rb b/db/migrate/20170111033729_add_configuration_script_payload_and_configuration_script_source_to_configuration_scripts.rb deleted file mode 100644 index cb192bf90..000000000 --- a/db/migrate/20170111033729_add_configuration_script_payload_and_configuration_script_source_to_configuration_scripts.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddConfigurationScriptPayloadAndConfigurationScriptSourceToConfigurationScripts < ActiveRecord::Migration[5.0] - def change - add_column :configuration_scripts, :parent_id, :bigint - add_column :configuration_scripts, :configuration_script_source_id, :bigint - end -end diff --git a/db/migrate/20170115140217_update_ems_in_miq_alert_status.rb b/db/migrate/20170115140217_update_ems_in_miq_alert_status.rb deleted file mode 100644 index 58018b8ef..000000000 --- a/db/migrate/20170115140217_update_ems_in_miq_alert_status.rb +++ /dev/null @@ -1,16 +0,0 @@ -class UpdateEmsInMiqAlertStatus < ActiveRecord::Migration[5.0] - class MiqAlertStatus < ActiveRecord::Base; end - - def up - say_with_time("update ems_id in miq alert statuses") do - %w(vms hosts ems_clusters container_images).each do |alert_resource| - arel_table = Arel::Table.new(alert_resource.to_sym) - klass_name = alert_resource.classify - klass_name = 'VmOrTemplate' if alert_resource == 'vms' - join_sql = arel_table.project(arel_table[:ems_id]) - .where(arel_table[:id].eq(MiqAlertStatus.arel_table[:resource_id])).to_sql - MiqAlertStatus.where(:resource_type => klass_name).update_all("ems_id = (#{join_sql})") - end - end - end -end diff --git a/db/migrate/20170116210702_add_manager_ref_to_authentications.rb b/db/migrate/20170116210702_add_manager_ref_to_authentications.rb deleted file mode 100644 index 500308848..000000000 --- a/db/migrate/20170116210702_add_manager_ref_to_authentications.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddManagerRefToAuthentications < ActiveRecord::Migration[5.0] - def change - add_column :authentications, :manager_ref, :string - end -end diff --git a/db/migrate/20170117144629_add_certificate_authority_to_endpoint.rb b/db/migrate/20170117144629_add_certificate_authority_to_endpoint.rb deleted file mode 100644 index 057af5ca9..000000000 --- a/db/migrate/20170117144629_add_certificate_authority_to_endpoint.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCertificateAuthorityToEndpoint < ActiveRecord::Migration[5.0] - def change - add_column :endpoints, :certificate_authority, :text - end -end diff --git a/db/migrate/20170118140522_add_configuration_template_to_resource_actions.rb b/db/migrate/20170118140522_add_configuration_template_to_resource_actions.rb deleted file mode 100644 index 6b88b8cb0..000000000 --- a/db/migrate/20170118140522_add_configuration_template_to_resource_actions.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddConfigurationTemplateToResourceActions < ActiveRecord::Migration[5.0] - def change - add_column :resource_actions, :configuration_template_id, :bigint - add_column :resource_actions, :configuration_template_type, :string - end -end diff --git a/db/migrate/20170118232430_create_join_table_authentication_configuration_script_base.rb b/db/migrate/20170118232430_create_join_table_authentication_configuration_script_base.rb deleted file mode 100644 index 7fd39e61b..000000000 --- a/db/migrate/20170118232430_create_join_table_authentication_configuration_script_base.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateJoinTableAuthenticationConfigurationScriptBase < ActiveRecord::Migration[5.0] - def change - create_table :authentication_configuration_script_bases do |t| - t.bigint :authentication_id - t.bigint :configuration_script_base_id - t.index :configuration_script_base_id, :name => 'index_configuration_script_base_id' - end - end -end diff --git a/db/migrate/20170120144842_change_datatype_of_message_on_miq_tasks_table_to_text.rb b/db/migrate/20170120144842_change_datatype_of_message_on_miq_tasks_table_to_text.rb deleted file mode 100644 index 3a76a226f..000000000 --- a/db/migrate/20170120144842_change_datatype_of_message_on_miq_tasks_table_to_text.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ChangeDatatypeOfMessageOnMiqTasksTableToText < ActiveRecord::Migration[5.0] - def up - change_column :miq_tasks, :message, :text - end - - def down - change_column :miq_tasks, :message, :string - end -end diff --git a/db/migrate/20170120154842_add_started_on_column_to_miq_tasks.rb b/db/migrate/20170120154842_add_started_on_column_to_miq_tasks.rb deleted file mode 100644 index c270c74cf..000000000 --- a/db/migrate/20170120154842_add_started_on_column_to_miq_tasks.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddStartedOnColumnToMiqTasks < ActiveRecord::Migration[5.0] - def change - add_column :miq_tasks, :started_on, :datetime - add_column :miq_tasks, :zone, :string - end -end diff --git a/db/migrate/20170120164058_create_task_for_each_job_and_transfer_attributes.rb b/db/migrate/20170120164058_create_task_for_each_job_and_transfer_attributes.rb deleted file mode 100644 index 86ff90b40..000000000 --- a/db/migrate/20170120164058_create_task_for_each_job_and_transfer_attributes.rb +++ /dev/null @@ -1,55 +0,0 @@ -class CreateTaskForEachJobAndTransferAttributes < ActiveRecord::Migration[5.0] - class Job < ActiveRecord::Base - belongs_to :miq_task, :class_name =>'CreateTaskForEachJobAndTransferAttributes::MiqTask' - self.inheritance_column = :_type_disabled - end - - class MiqTask < ActiveRecord::Base - has_one :job, :class_name => 'CreateTaskForEachJobAndTransferAttributes::Job' - end - - class LogFile < ActiveRecord::Base - end - - class BinaryBlob < ActiveRecord::Base - end - - def up - purge_date = 7.days.ago.utc - say_with_time("Deleting finished jobs older than 7 days") do - Job.where("updated_on < ?", purge_date).where("state = 'finished'").delete_all - end - - old_finished_tasks = MiqTask.where("updated_on < ?", purge_date).where("state = 'Finished'") - say_with_time("Deleting logs linked to finished tasks older than 7 days") do - LogFile.where(:miq_task_id => old_finished_tasks.select(:id)).delete_all - end - say_with_time("Deleting BinaryBlobs linked to finished tasks older than 7 days") do - BinaryBlob.where(:resource_type => 'MiqTask', :resource_id => old_finished_tasks.select(:id)).delete_all - end - say_with_time("Deleting finished tasks older than 7 days") do - old_finished_tasks.delete_all - end - - say_with_time("Creating tasks associated with jobs") do - Job.find_each do |job| - job.create_miq_task(:status => job.status.try(:capitalize), - :name => job.name, - :message => job.message, - :state => job.state.try(:capitalize), - :userid => job.userid, - :miq_server_id => job.miq_server_id, - :context_data => job.context, - :started_on => job.started_on, - :zone => job.zone) - end - end - end - - def down - say_with_time("Deleting all tasks which have job") do - MiqTask.where("id in (select miq_task_id from jobs)").delete_all - Job.update_all(:miq_task_id => nil) - end - end -end diff --git a/db/migrate/20170125141153_add_message_to_alert_statuses.rb b/db/migrate/20170125141153_add_message_to_alert_statuses.rb deleted file mode 100644 index 618f988f6..000000000 --- a/db/migrate/20170125141153_add_message_to_alert_statuses.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddMessageToAlertStatuses < ActiveRecord::Migration[5.0] - def change - add_column :miq_alert_statuses, :description, :string - end -end diff --git a/db/migrate/20170125141953_update_description_in_miq_alert_status.rb b/db/migrate/20170125141953_update_description_in_miq_alert_status.rb deleted file mode 100644 index 1b024104e..000000000 --- a/db/migrate/20170125141953_update_description_in_miq_alert_status.rb +++ /dev/null @@ -1,19 +0,0 @@ -class UpdateDescriptionInMiqAlertStatus < ActiveRecord::Migration[5.0] - class MiqAlertStatus < ActiveRecord::Base - belongs_to :miq_alert, :class_name => "UpdateDescriptionInMiqAlertStatus::MiqAlert" - end - - class MiqAlert < ActiveRecord::Base - has_many :miq_alert_statuses, :dependent => :destroy, :class_name => "UpdateDescriptionInMiqAlertStatus::MiqAlertStatus" - end - - def up - say_with_time("update description in miq alert statuses") do - miq_alerts = Arel::Table.new('miq_alerts') - miq_alert_statuses = Arel::Table.new('miq_alert_statuses') - join_sql = miq_alerts.project(miq_alerts[:description]) - .where(miq_alerts[:id].eq(miq_alert_statuses[:miq_alert_id])).to_sql - MiqAlertStatus.update_all("description = (#{join_sql})") - end - end -end diff --git a/db/migrate/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager.rb b/db/migrate/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager.rb deleted file mode 100644 index 5c7aa5d71..000000000 --- a/db/migrate/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager.rb +++ /dev/null @@ -1,85 +0,0 @@ -class MigrateAnsibleTowerConfigurationManagerStiTypeToAutomationManager < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class ConfigurationScript < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class ConfiguredSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Job < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class EmsFolder < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time('Migrating STI type of ansible_tower configuration_managers to automation_managers') do - ExtManagementSystem.where(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager' - ) - end - - say_with_time('Migrating STI type of ansible_tower configuration_scripts to be of automation_manager') do - ConfigurationScript.where(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript' - ) - end - - say_with_time('Migrating STI type of ansible_tower configured_systems to be of automation_manager') do - ConfiguredSystem.where(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfiguredSystem').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem' - ) - end - - say_with_time('Migrating STI type of ansible_tower jobs to be of automation_manager') do - Job.where(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Job' - ) - end - - say_with_time('Migrating STI type of ansible_tower inventory_groups to be of automation_manager') do - EmsFolder.where(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::InventoryGroup').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::InventoryGroup' - ) - end - end - - def down - say_with_time('Migrating STI type of ansible_tower automation_managers to configuration_managers') do - ExtManagementSystem.where(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager' - ) - end - - say_with_time('Migrating STI type of ansible_tower configuration_scripts to be of configuration_managers') do - ConfigurationScript.where(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript' - ) - end - - say_with_time('Migrating STI type of ansible_tower configured_systems to be of configuration_managers') do - ConfiguredSystem.where(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfiguredSystem' - ) - end - - say_with_time('Migrating STI type of ansible_tower jobs to be of configuration_managers') do - Job.where(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Job').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job' - ) - end - - say_with_time('Migrating STI type of ansible_tower inventory_groups to be of configuration_manager') do - EmsFolder.where(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::InventoryGroup').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::InventoryGroup' - ) - end - end -end diff --git a/db/migrate/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager.rb b/db/migrate/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager.rb deleted file mode 100644 index f158f6b9b..000000000 --- a/db/migrate/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager.rb +++ /dev/null @@ -1,45 +0,0 @@ -class MigrateAnsibleTowerConfigurationManagerSettingsToAutomationManager < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - serialize :value - end - - def up - say_with_time('Migrate /ems_refresh/ansible_tower_configuration% to be of Automation Manager') do - SettingsChange.where('key LIKE ?', '/ems_refresh/ansible_tower_configuration%').each do |s| - s.key = s.key.sub('/ansible_tower_configuration', '/ansible_tower_automation') - s.save! - end - end - - say_with_time('Migrate /workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_configuration%' \ - ' to be of Automation Manager') do - SettingsChange.where('key LIKE ?', '/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_configuration%').each do |s| - s.key = s.key.sub( - '/ems_refresh_worker_ansible_tower_configuration', - '/ems_refresh_worker_ansible_tower_automation' - ) - s.save! - end - end - end - - def down - say_with_time('Migrate /ems_refresh/ansible_tower_automation% back to be of Configuration Manager') do - SettingsChange.where("key LIKE ?", "/ems_refresh/ansible_tower_automation%").each do |s| - s.key = s.key.sub('/ansible_tower_automation', '/ansible_tower_configuration') - s.save! - end - end - - say_with_time('Migrate /workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_configuration%' \ - ' back to be of Configuration Manager') do - SettingsChange.where('key LIKE ?', '/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_automation%').each do |s| - s.key = s.key.sub( - '/ems_refresh_worker_ansible_tower_automation', - '/ems_refresh_worker_ansible_tower_configuration' - ) - s.save! - end - end - end -end diff --git a/db/migrate/20170203161253_add_scm_attributes_to_configuration_script_source.rb b/db/migrate/20170203161253_add_scm_attributes_to_configuration_script_source.rb deleted file mode 100644 index a9ee3d102..000000000 --- a/db/migrate/20170203161253_add_scm_attributes_to_configuration_script_source.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddScmAttributesToConfigurationScriptSource < ActiveRecord::Migration[5.0] - def change - add_column :configuration_script_sources, :scm_type, :string - add_column :configuration_script_sources, :scm_url, :string - add_column :configuration_script_sources, :scm_branch, :string - add_column :configuration_script_sources, :scm_clean, :boolean - add_column :configuration_script_sources, :scm_delete_on_update, :boolean - add_column :configuration_script_sources, :scm_update_on_launch, :boolean - add_column :configuration_script_sources, :authentication_id, :bigint - end -end diff --git a/db/migrate/20170206210552_add_options_column_to_authentication.rb b/db/migrate/20170206210552_add_options_column_to_authentication.rb deleted file mode 100644 index 76327747d..000000000 --- a/db/migrate/20170206210552_add_options_column_to_authentication.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddOptionsColumnToAuthentication < ActiveRecord::Migration[5.0] - def change - add_column :authentications, :options, :text - end -end diff --git a/db/migrate/20170207173837_set_service_display_and_retired_to_false.rb b/db/migrate/20170207173837_set_service_display_and_retired_to_false.rb deleted file mode 100644 index 212ee2cb2..000000000 --- a/db/migrate/20170207173837_set_service_display_and_retired_to_false.rb +++ /dev/null @@ -1,14 +0,0 @@ -class SetServiceDisplayAndRetiredToFalse < ActiveRecord::Migration[5.0] - class Service < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - Service.where(:retired => nil).update_all(:retired => false) - Service.where(:display => nil).update_all(:display => false) - end - - def down - # NOP - end -end diff --git a/db/migrate/20170207200029_add_sti_type_to_configuration_script_source.rb b/db/migrate/20170207200029_add_sti_type_to_configuration_script_source.rb deleted file mode 100644 index d392e1a64..000000000 --- a/db/migrate/20170207200029_add_sti_type_to_configuration_script_source.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStiTypeToConfigurationScriptSource < ActiveRecord::Migration[5.0] - def change - add_column :configuration_script_sources, :type, :string - end -end diff --git a/db/migrate/20170207215322_fix_vpor_time_profile_ids.rb b/db/migrate/20170207215322_fix_vpor_time_profile_ids.rb deleted file mode 100644 index e13a366d1..000000000 --- a/db/migrate/20170207215322_fix_vpor_time_profile_ids.rb +++ /dev/null @@ -1,44 +0,0 @@ -class FixVporTimeProfileIds < ActiveRecord::Migration[5.0] - class VimPerformanceOperatingRange < ActiveRecord::Base - end - - class TimeProfile < ActiveRecord::Base - ALL_DAYS = (0...7).to_a.freeze - ALL_HOURS = (0...24).to_a.freeze - DEFAULT_TZ = "UTC".freeze - - serialize :profile, Hash - - def self.default - @default ||= begin - ar_region_class = ActiveRecord::IdRegions::Migration.anonymous_class_with_id_regions - region_cond = ar_region_class.region_to_conditions(ar_region_class.my_region_number) - - where(region_cond) - .where(:rollup_daily_metrics => true) - .select do |tp| - tp.profile[:days].try(:sort) == ALL_DAYS && - tp.profile[:hours].try(:sort) == ALL_HOURS && - tp.profile[:tz] == DEFAULT_TZ - end - .first - end - end - end - - def up - if VimPerformanceOperatingRange.where.not(:time_profile_id => nil).exists? - # User has already used an old version where TimeProfiles were corrected, - # so the TimeProfile-less records are invalid and should be deleted - say_with_time("Removing old VimPerformanceOperatingRanges") do - VimPerformanceOperatingRange.where(:time_profile_id => nil).delete_all - end - elsif TimeProfile.any? - # User has not used an old version where TimeProfiles were corrected, - # so the TimeProfile-less records just need to be updated to the default TP - say_with_time("Updating old VimPerformanceOperatingRanges to the default TimeProfile") do - VimPerformanceOperatingRange.where(:time_profile_id => nil).update_all(:time_profile_id => TimeProfile.default.id) - end - end - end -end diff --git a/db/migrate/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type.rb b/db/migrate/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type.rb deleted file mode 100644 index cf95328d8..000000000 --- a/db/migrate/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type.rb +++ /dev/null @@ -1,21 +0,0 @@ -class MigrateAnsibleTowerConfigurationManagerInventoryRootGroupStiType < ActiveRecord::Migration[5.0] - class EmsFolder < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time('Migrating STI type of ansible_tower inventory_root_groups to automation_manager inventorys') do - EmsFolder.where(:type => 'ManageIQ::Providers::ConfigurationManager::InventoryRootGroup').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Inventory' - ) - end - end - - def down - say_with_time('Migrating STI type of ansible_tower inventorys to configuration_manager inventory_root_groups') do - EmsFolder.where(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Inventory').update_all( - :type => 'ManageIQ::Providers::ConfigurationManager::InventoryRootGroup' - ) - end - end -end diff --git a/db/migrate/20170209203904_orchestration_stack_enhancements_for_ansible_service_provision.rb b/db/migrate/20170209203904_orchestration_stack_enhancements_for_ansible_service_provision.rb deleted file mode 100644 index 3b1625836..000000000 --- a/db/migrate/20170209203904_orchestration_stack_enhancements_for_ansible_service_provision.rb +++ /dev/null @@ -1,9 +0,0 @@ -class OrchestrationStackEnhancementsForAnsibleServiceProvision < ActiveRecord::Migration[5.0] - def change - add_column :orchestration_stacks, :start_time, :timestamp - add_column :orchestration_stacks, :finish_time, :timestamp - add_column :orchestration_stacks, :configuration_script_base_id, :bigint - add_column :orchestration_stacks, :verbosity, :integer - add_column :orchestration_stacks, :hosts, :text, :array => true - end -end diff --git a/db/migrate/20170209211017_join_authentication_orchestration_stack.rb b/db/migrate/20170209211017_join_authentication_orchestration_stack.rb deleted file mode 100644 index 0bdf9154d..000000000 --- a/db/migrate/20170209211017_join_authentication_orchestration_stack.rb +++ /dev/null @@ -1,9 +0,0 @@ -class JoinAuthenticationOrchestrationStack < ActiveRecord::Migration[5.0] - def change - create_table :authentication_orchestration_stacks do |t| - t.bigint :authentication_id - t.bigint :orchestration_stack_id - t.index [:authentication_id, :orchestration_stack_id], :unique => true, :name => "index_authentication_orchestration_stacks" - end - end -end diff --git a/db/migrate/20170216124055_add_name_to_cloud_object_store_container.rb b/db/migrate/20170216124055_add_name_to_cloud_object_store_container.rb deleted file mode 100644 index a803b43a8..000000000 --- a/db/migrate/20170216124055_add_name_to_cloud_object_store_container.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNameToCloudObjectStoreContainer < ActiveRecord::Migration[5.0] - def change - add_column :cloud_object_store_containers, :name, :string - end -end diff --git a/db/migrate/20170216132118_add_health_state_property_to_physical_server.rb b/db/migrate/20170216132118_add_health_state_property_to_physical_server.rb deleted file mode 100644 index 85fcb5bb0..000000000 --- a/db/migrate/20170216132118_add_health_state_property_to_physical_server.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddHealthStatePropertyToPhysicalServer < ActiveRecord::Migration[5.0] - def change - add_column :physical_servers, :health_state, :string - end -end diff --git a/db/migrate/20170217085547_add_type_to_cloud_object_store_container.rb b/db/migrate/20170217085547_add_type_to_cloud_object_store_container.rb deleted file mode 100644 index 06b3c2d06..000000000 --- a/db/migrate/20170217085547_add_type_to_cloud_object_store_container.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddTypeToCloudObjectStoreContainer < ActiveRecord::Migration[5.0] - def change - add_column :cloud_object_store_containers, :type, :string - add_index :cloud_object_store_containers, :type - end -end diff --git a/db/migrate/20170217163547_migrate_tower_job_sti_type_to_automation_manager.rb b/db/migrate/20170217163547_migrate_tower_job_sti_type_to_automation_manager.rb deleted file mode 100644 index 0d7c94564..000000000 --- a/db/migrate/20170217163547_migrate_tower_job_sti_type_to_automation_manager.rb +++ /dev/null @@ -1,21 +0,0 @@ -class MigrateTowerJobStiTypeToAutomationManager < ActiveRecord::Migration[5.0] - class OrchestrationStack < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time('Migrating STI type of ansible_tower jobs to be of automation_manager') do - OrchestrationStack.where(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Job' - ) - end - end - - def down - say_with_time('Migrating STI type of ansible_tower jobs to be of configuration_managers') do - OrchestrationStack.where(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Job').update_all( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job' - ) - end - end -end diff --git a/db/migrate/20170217170604_add_times_to_orchestration_stack_resources.rb b/db/migrate/20170217170604_add_times_to_orchestration_stack_resources.rb deleted file mode 100644 index 7085ee3ff..000000000 --- a/db/migrate/20170217170604_add_times_to_orchestration_stack_resources.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddTimesToOrchestrationStackResources < ActiveRecord::Migration[5.0] - def change - add_column :orchestration_stack_resources, :start_time, :timestamp - add_column :orchestration_stack_resources, :finish_time, :timestamp - end -end diff --git a/db/migrate/20170217184205_add_power_state_property_to_physical_server.rb b/db/migrate/20170217184205_add_power_state_property_to_physical_server.rb deleted file mode 100644 index 9c9c22031..000000000 --- a/db/migrate/20170217184205_add_power_state_property_to_physical_server.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddPowerStatePropertyToPhysicalServer < ActiveRecord::Migration[5.0] - def change - add_column :physical_servers, :power_state, :string - end -end diff --git a/db/migrate/20170217194936_add_properties_to_physical_servers.rb b/db/migrate/20170217194936_add_properties_to_physical_servers.rb deleted file mode 100644 index 0f5ac95a7..000000000 --- a/db/migrate/20170217194936_add_properties_to_physical_servers.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddPropertiesToPhysicalServers < ActiveRecord::Migration[5.0] - def change - add_column :physical_servers, :hostname, :string - add_column :physical_servers, :product_name, :string - add_column :physical_servers, :manufacturer, :string - add_column :physical_servers, :machine_type, :string - add_column :physical_servers, :model, :string - add_column :physical_servers, :serial_number, :string - add_column :physical_servers, :field_replaceable_unit, :string - end -end diff --git a/db/migrate/20170217220618_remove_central_admin_region_auth_records.rb b/db/migrate/20170217220618_remove_central_admin_region_auth_records.rb deleted file mode 100644 index 893c72e90..000000000 --- a/db/migrate/20170217220618_remove_central_admin_region_auth_records.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveCentralAdminRegionAuthRecords < ActiveRecord::Migration[5.0] - class Authentication < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - Authentication.where(:resource_type => 'MiqRegion').delete_all - end -end diff --git a/db/migrate/20170222105117_remove_openshift_enterprise_provider.rb b/db/migrate/20170222105117_remove_openshift_enterprise_provider.rb deleted file mode 100644 index e70b33aba..000000000 --- a/db/migrate/20170222105117_remove_openshift_enterprise_provider.rb +++ /dev/null @@ -1,42 +0,0 @@ -class RemoveOpenshiftEnterpriseProvider < ActiveRecord::Migration[5.0] - include MigrationHelper - - NAME_MAP = Hash[*%w( - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager ManageIQ::Providers::Openshift::ContainerManager - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventCatcher ManageIQ::Providers::Openshift::ContainerManager::EventCatcher - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventCatcher::Runner ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventParser ManageIQ::Providers::Openshift::ContainerManager::EventParser - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::MetricsCollectorWorker ManageIQ::Providers::Openshift::ContainerManager::MetricsCollectorWorker - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::MetricsCollectorWorker::Runner ManageIQ::Providers::Openshift::ContainerManager::MetricsCollectorWorker::Runner - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshParser ManageIQ::Providers::Openshift::ContainerManager::RefreshParser - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshWorker ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshWorker::Runner ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker::Runner - ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::Refresher ManageIQ::Providers::Openshift::ContainerManager::Refresher - )] - - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiqWorker < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Authentication < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiqQueue < ActiveRecord::Base; end - - def up - rename_class_references(NAME_MAP) - - say_with_time "Rename Openshift to Openshift in Authentication:name" do - Authentication.update_all("name = replace(name, 'ManageIQ::Providers::OpenshiftEnterprise', 'ManageIQ::Providers::Openshift')") - end - - say_with_time "Rename Openshift to Openshift in MiqQueue:args" do - MiqQueue.update_all("args = replace(args, 'ManageIQ::Providers::OpenshiftEnterprise', 'ManageIQ::Providers::Openshift')") - end - end -end diff --git a/db/migrate/20170222192610_create_firmwares.rb b/db/migrate/20170222192610_create_firmwares.rb deleted file mode 100644 index dd71f07f3..000000000 --- a/db/migrate/20170222192610_create_firmwares.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateFirmwares < ActiveRecord::Migration[5.0] - def change - create_table :firmwares do |t| - t.string :name - t.string :build - t.string :version - t.datetime :release_date - t.bigint :resource_id - t.string :resource_type - t.timestamps - t.index %w(resource_id resource_type) - end - end -end diff --git a/db/migrate/20170222214902_add_initiator_to_service.rb b/db/migrate/20170222214902_add_initiator_to_service.rb deleted file mode 100644 index 985e972da..000000000 --- a/db/migrate/20170222214902_add_initiator_to_service.rb +++ /dev/null @@ -1,16 +0,0 @@ -class AddInitiatorToService < ActiveRecord::Migration[5.0] - class Service < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - add_column :services, :initiator, :string, :comment => "Entity that initiated the service creation" - say_with_time("Updating existing services to 'user' initiator") do - Service.update_all(:initiator => 'user') - end - end - - def down - remove_column :services, :initiator - end -end diff --git a/db/migrate/20170223135511_add_name_to_cloud_object_store_object.rb b/db/migrate/20170223135511_add_name_to_cloud_object_store_object.rb deleted file mode 100644 index fb4410087..000000000 --- a/db/migrate/20170223135511_add_name_to_cloud_object_store_object.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNameToCloudObjectStoreObject < ActiveRecord::Migration[5.0] - def change - add_column :cloud_object_store_objects, :name, :string - end -end diff --git a/db/migrate/20170223135521_add_type_to_cloud_object_store_object.rb b/db/migrate/20170223135521_add_type_to_cloud_object_store_object.rb deleted file mode 100644 index 0eae0e1c2..000000000 --- a/db/migrate/20170223135521_add_type_to_cloud_object_store_object.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddTypeToCloudObjectStoreObject < ActiveRecord::Migration[5.0] - def change - add_column :cloud_object_store_objects, :type, :string - add_index :cloud_object_store_objects, :type - end -end diff --git a/db/migrate/20170303180033_add_physical_server_id_to_hosts.rb b/db/migrate/20170303180033_add_physical_server_id_to_hosts.rb deleted file mode 100644 index 1f55c56b4..000000000 --- a/db/migrate/20170303180033_add_physical_server_id_to_hosts.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddPhysicalServerIdToHosts < ActiveRecord::Migration[5.0] - def change - add_column :hosts, :physical_server_id, :bigint - end -end diff --git a/db/migrate/20170303192951_remove_field_archive_form_jobs.rb b/db/migrate/20170303192951_remove_field_archive_form_jobs.rb deleted file mode 100644 index 39340739e..000000000 --- a/db/migrate/20170303192951_remove_field_archive_form_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveFieldArchiveFormJobs < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :archive, :boolean - end -end diff --git a/db/migrate/20170303213837_remove_field_code_from_jobs.rb b/db/migrate/20170303213837_remove_field_code_from_jobs.rb deleted file mode 100644 index 4ae324429..000000000 --- a/db/migrate/20170303213837_remove_field_code_from_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveFieldCodeFromJobs < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :code, :string - end -end diff --git a/db/migrate/20170307203433_migrate_configuration_script_to_base.rb b/db/migrate/20170307203433_migrate_configuration_script_to_base.rb deleted file mode 100644 index 29b9ad92b..000000000 --- a/db/migrate/20170307203433_migrate_configuration_script_to_base.rb +++ /dev/null @@ -1,20 +0,0 @@ -class MigrateConfigurationScriptToBase < ActiveRecord::Migration[5.0] - class ServiceResource < ActiveRecord::Base - end - - def up - say_with_time('Migrating service_resources configuration_script to configuration_script_base') do - ServiceResource - .where(:resource_type => 'ConfigurationScript') - .update_all(:resource_type => 'ConfigurationScriptBase') - end - end - - def down - say_with_time('Migrating service_resources configuration_script_base to configuration_script') do - ServiceResource - .where(:resource_type => 'ConfigurationScriptBase') - .update_all(:resource_type => 'ConfigurationScript') - end - end -end diff --git a/db/migrate/20170309111313_add_resolved_to_alerts.rb b/db/migrate/20170309111313_add_resolved_to_alerts.rb deleted file mode 100644 index e56acb933..000000000 --- a/db/migrate/20170309111313_add_resolved_to_alerts.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddResolvedToAlerts < ActiveRecord::Migration[5.0] - def change - add_column :miq_alert_statuses, :resolved, :boolean - end -end diff --git a/db/migrate/20170309125642_add_alert_ems_ref.rb b/db/migrate/20170309125642_add_alert_ems_ref.rb deleted file mode 100644 index 9deda5507..000000000 --- a/db/migrate/20170309125642_add_alert_ems_ref.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddAlertEmsRef < ActiveRecord::Migration[5.0] - def change - add_column :miq_alert_statuses, :event_ems_ref, :string - add_index :miq_alert_statuses, :event_ems_ref - end -end diff --git a/db/migrate/20170313142647_add_raw_power_state_to_physical_server.rb b/db/migrate/20170313142647_add_raw_power_state_to_physical_server.rb deleted file mode 100644 index 647d4a3be..000000000 --- a/db/migrate/20170313142647_add_raw_power_state_to_physical_server.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddRawPowerStateToPhysicalServer < ActiveRecord::Migration[5.0] - def change - add_column :physical_servers, :raw_power_state, :string - end -end diff --git a/db/migrate/20170313160354_remove_ancestry_from_alerts.rb b/db/migrate/20170313160354_remove_ancestry_from_alerts.rb deleted file mode 100644 index b70e8fdd0..000000000 --- a/db/migrate/20170313160354_remove_ancestry_from_alerts.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveAncestryFromAlerts < ActiveRecord::Migration[5.0] - def change - remove_index :miq_alert_statuses, :ancestry - remove_column :miq_alert_statuses, :ancestry, :string - end -end diff --git a/db/migrate/20170313170754_add_mas_assignee.rb b/db/migrate/20170313170754_add_mas_assignee.rb deleted file mode 100644 index bbd29836a..000000000 --- a/db/migrate/20170313170754_add_mas_assignee.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddMasAssignee < ActiveRecord::Migration[5.0] - def change - add_reference :miq_alert_statuses, :assignee, :type => :bigint, :index => true - end -end diff --git a/db/migrate/20170315082311_update_o_virt_api_path.rb b/db/migrate/20170315082311_update_o_virt_api_path.rb deleted file mode 100644 index 6c280bb06..000000000 --- a/db/migrate/20170315082311_update_o_virt_api_path.rb +++ /dev/null @@ -1,32 +0,0 @@ -# -# Starting with version 4.0 of oVirt, the support for the /api URL path has been removed, and replaced -# by /ovirt-engine/api, which was introduced in oVirt 3.5. All previous versions of oVirt are already -# out of support. The providers that were created with previous versions of oVirt will have stored in -# the database the old path, and will stop working when migrated to oVirt 4.0. To avoid that issue this -# migration updates all the relevant providers to use the new supported URL path. -# -class UpdateOVirtApiPath < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Endpoint < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time('Upddate oVirt providers API path to /ovirt-engine/api') do - providers = ExtManagementSystem.where(:type => 'ManageIQ::Providers::Redhat::InfraManager') - providers.each do |provider| - Endpoint.where( - :resource_type => 'ExtManagementSystem', - :resource_id => provider.id, - :role => 'default', - :path => '/api' - ).update_all( - :path => '/ovirt-engine/api' - ) - end - end - end -end diff --git a/db/migrate/20170315095936_update_persistent_volumes_parent_type.rb b/db/migrate/20170315095936_update_persistent_volumes_parent_type.rb deleted file mode 100644 index 746e4da79..000000000 --- a/db/migrate/20170315095936_update_persistent_volumes_parent_type.rb +++ /dev/null @@ -1,15 +0,0 @@ -class UpdatePersistentVolumesParentType < ActiveRecord::Migration[5.0] - class ContainerVolume < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - ContainerVolume.where(:parent_type => 'ManageIQ::Providers::ContainerManager') - .update_all(:parent_type => 'ExtManagementSystem') - end - - def down - ContainerVolume.where(:parent_type => 'ExtManagementSystem') - .update_all(:parent_type => 'ManageIQ::Providers::ContainerManager') - end -end diff --git a/db/migrate/20170316200500_remove_agent_state_from_jobs.rb b/db/migrate/20170316200500_remove_agent_state_from_jobs.rb deleted file mode 100644 index 8029caea9..000000000 --- a/db/migrate/20170316200500_remove_agent_state_from_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveAgentStateFromJobs < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :agent_state, :string - end -end diff --git a/db/migrate/20170317134007_remove_agent_class_from_jobs.rb b/db/migrate/20170317134007_remove_agent_class_from_jobs.rb deleted file mode 100644 index 5c25a7b47..000000000 --- a/db/migrate/20170317134007_remove_agent_class_from_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveAgentClassFromJobs < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :agent_class, :string - end -end diff --git a/db/migrate/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table.rb b/db/migrate/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table.rb deleted file mode 100644 index 3cfbb828d..000000000 --- a/db/migrate/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CopyAgentIdToMiqServerIdInJobsTable < ActiveRecord::Migration[5.0] - class Job < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time("copying data from agent_id column to miq_server_id column on jobs table") do - Job.update_all("miq_server_id = agent_id") - end - end - - def down - say_with_time("nullifying miq_server_id column on jobs table") do - Job.update_all(:miq_server_id => nil) - end - end -end diff --git a/db/migrate/20170320195659_remove_oid_integer_args_from_miq_queue.rb b/db/migrate/20170320195659_remove_oid_integer_args_from_miq_queue.rb deleted file mode 100644 index 6afa58238..000000000 --- a/db/migrate/20170320195659_remove_oid_integer_args_from_miq_queue.rb +++ /dev/null @@ -1,8 +0,0 @@ -class RemoveOidIntegerArgsFromMiqQueue < ActiveRecord::Migration[5.0] - class MiqQueue < ActiveRecord::Base; end - def up - say_with_time("Removing MiqQueue rows with args column values containing a class removed from Rails 5: PostgreSQL::OID::Integer.") do - MiqQueue.where("args LIKE '%PostgreSQL::OID::Integer%'").delete_all - end - end -end diff --git a/db/migrate/20170320195660_add_status_to_configuration_script_source.rb b/db/migrate/20170320195660_add_status_to_configuration_script_source.rb deleted file mode 100644 index d4fb83292..000000000 --- a/db/migrate/20170320195660_add_status_to_configuration_script_source.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStatusToConfigurationScriptSource < ActiveRecord::Migration[5.0] - def change - add_column :configuration_script_sources, :status, :string - end -end diff --git a/db/migrate/20170324124452_add_vendor_property_to_physical_server.rb b/db/migrate/20170324124452_add_vendor_property_to_physical_server.rb deleted file mode 100644 index ce2d3a3c0..000000000 --- a/db/migrate/20170324124452_add_vendor_property_to_physical_server.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddVendorPropertyToPhysicalServer < ActiveRecord::Migration[5.0] - def change - add_column :physical_servers, :vendor, :string - end -end diff --git a/db/migrate/20170328110106_fix_expression_in_tenant_quota_report.rb b/db/migrate/20170328110106_fix_expression_in_tenant_quota_report.rb deleted file mode 100644 index 6c71a2bf8..000000000 --- a/db/migrate/20170328110106_fix_expression_in_tenant_quota_report.rb +++ /dev/null @@ -1,24 +0,0 @@ -class FixExpressionInTenantQuotaReport < ActiveRecord::Migration[5.0] - class MiqReport < ActiveRecord::Base - def self.with_tenant_custom_report_and_condition(value) - where(:db => 'Tenant', :rpt_type => 'Custom').where("conditions LIKE ?", "%#{value}%") - end - end - - OLD_VALUE = 'count: tenants.tenant_quotas'.freeze - NEW_VALUE = 'count: Tenant.tenant_quotas'.freeze - - def up - MiqReport.with_tenant_custom_report_and_condition(OLD_VALUE).each do |x| - x.conditions.gsub!(OLD_VALUE, NEW_VALUE) - x.save - end - end - - def down - MiqReport.with_tenant_custom_report_and_condition(NEW_VALUE).each do |x| - x.conditions.gsub!(NEW_VALUE, OLD_VALUE) - x.save - end - end -end diff --git a/db/migrate/20170330234701_create_event_streams_index_availability_zone.rb b/db/migrate/20170330234701_create_event_streams_index_availability_zone.rb deleted file mode 100644 index 9a4c34a9e..000000000 --- a/db/migrate/20170330234701_create_event_streams_index_availability_zone.rb +++ /dev/null @@ -1,5 +0,0 @@ -class CreateEventStreamsIndexAvailabilityZone < ActiveRecord::Migration[5.0] - def change - add_index :event_streams, [:availability_zone_id, :type] - end -end diff --git a/db/migrate/20170404213245_add_loc_led_state_to_physical_servers.rb b/db/migrate/20170404213245_add_loc_led_state_to_physical_servers.rb deleted file mode 100644 index 826c4c0e1..000000000 --- a/db/migrate/20170404213245_add_loc_led_state_to_physical_servers.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddLocLedStateToPhysicalServers < ActiveRecord::Migration[5.0] - def change - add_column :physical_servers, :location_led_state, :string - end -end diff --git a/db/migrate/20170405192333_delete_miq_replication_worker.rb b/db/migrate/20170405192333_delete_miq_replication_worker.rb deleted file mode 100644 index 3c05f638e..000000000 --- a/db/migrate/20170405192333_delete_miq_replication_worker.rb +++ /dev/null @@ -1,9 +0,0 @@ -class DeleteMiqReplicationWorker < ActiveRecord::Migration[5.0] - class MiqWorker < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - MiqWorker.where(:type => "MiqReplicationWorker").destroy_all - end -end diff --git a/db/migrate/20170409083720_add_enabled_field_to_ems.rb b/db/migrate/20170409083720_add_enabled_field_to_ems.rb deleted file mode 100644 index 74aff84e3..000000000 --- a/db/migrate/20170409083720_add_enabled_field_to_ems.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddEnabledFieldToEms < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def change - add_column :ext_management_systems, :enabled, :boolean - - say_with_time('Setting ExtManagementSystem.enabled to true') do - ExtManagementSystem.update_all(:enabled => true) - end - end -end diff --git a/db/migrate/20170410055056_add_iops_and_encrypted_to_cloud_volume.rb b/db/migrate/20170410055056_add_iops_and_encrypted_to_cloud_volume.rb deleted file mode 100644 index e5b0f99b7..000000000 --- a/db/migrate/20170410055056_add_iops_and_encrypted_to_cloud_volume.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddIopsAndEncryptedToCloudVolume < ActiveRecord::Migration[5.0] - def change - add_column :cloud_volumes, :iops, :integer - add_column :cloud_volumes, :encrypted, :boolean - end -end diff --git a/db/migrate/20170410130134_copy_server_id_from_jobs_to_miq_tasks.rb b/db/migrate/20170410130134_copy_server_id_from_jobs_to_miq_tasks.rb deleted file mode 100644 index 71d6d868f..000000000 --- a/db/migrate/20170410130134_copy_server_id_from_jobs_to_miq_tasks.rb +++ /dev/null @@ -1,21 +0,0 @@ -class CopyServerIdFromJobsToMiqTasks < ActiveRecord::Migration[5.0] - class Job < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiqTask < ActiveRecord::Base; end - - def up - say_with_time("Copying miq_server_id from jobs table to miq_tasks") do - Job.where.not(:miq_task_id => nil).find_each do |job| - MiqTask.find(job.miq_task_id).update!(:miq_server_id => job.miq_server_id) - end - end - end - - def down - say_with_time("nullifying miq_server_id column on miq_tasks table") do - MiqTask.update_all(:miq_server_id => nil) - end - end -end diff --git a/db/migrate/20170417185038_remove_process_column_from_jobs.rb b/db/migrate/20170417185038_remove_process_column_from_jobs.rb deleted file mode 100644 index da301e40c..000000000 --- a/db/migrate/20170417185038_remove_process_column_from_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveProcessColumnFromJobs < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :process, :bytea - end -end diff --git a/db/migrate/20170418141731_drop_arbitration_tables.rb b/db/migrate/20170418141731_drop_arbitration_tables.rb deleted file mode 100644 index 05ec8f380..000000000 --- a/db/migrate/20170418141731_drop_arbitration_tables.rb +++ /dev/null @@ -1,40 +0,0 @@ -class DropArbitrationTables < ActiveRecord::Migration[5.0] - def change - drop_table :arbitration_settings do |t| - t.string :name - t.string :display_name - t.text :value - t.datetime :created_on - t.datetime :updated_on - end - - drop_table :arbitration_rules do |t| - t.string :description - t.string :operation - t.integer :arbitration_profile_id - t.integer :priority - t.text :expression - - t.timestamps - end - - drop_table :arbitration_profiles do |t| - t.string :uid_ems - t.string :name - t.string :type - t.boolean :profile - t.text :description - t.boolean :default_profile - - t.belongs_to :cloud_network, :type => :bigint - t.belongs_to :flavor, :type => :bigint - t.belongs_to :availability_zone, :type => :bigint - t.belongs_to :cloud_subnet, :type => :bigint - t.belongs_to :security_group, :type => :bigint - t.belongs_to :ems, :type => :bigint - t.belongs_to :authentication, :type => :bigint - - t.timestamps - end - end -end diff --git a/db/migrate/20170419154137_remove_deleted_migration_timestamps.rb b/db/migrate/20170419154137_remove_deleted_migration_timestamps.rb deleted file mode 100644 index c27e1d7a0..000000000 --- a/db/migrate/20170419154137_remove_deleted_migration_timestamps.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveDeletedMigrationTimestamps < ActiveRecord::Migration[5.0] - class SchemaMigration < ActiveRecord::Base; end - - DELETED_TIMESTAMPS = [20160106214719, 20160425161345].freeze - - def up - SchemaMigration.where(:version => DELETED_TIMESTAMPS).delete_all - end -end diff --git a/db/migrate/20170420124055_update_policy_seed.rb b/db/migrate/20170420124055_update_policy_seed.rb deleted file mode 100644 index b7f467b4f..000000000 --- a/db/migrate/20170420124055_update_policy_seed.rb +++ /dev/null @@ -1,13 +0,0 @@ -class UpdatePolicySeed < ActiveRecord::Migration[5.0] - class MiqPolicy < ActiveRecord::Base; end - - def up - defaults = { :towhat => 'Vm', :active => true, :mode => 'control' } - defaults.each { |col, val| MiqPolicy.where(col => nil).update_all(col => val) } - end - - def down - # these values should not be nil - # no need to rollback - end -end diff --git a/db/migrate/20170421193150_add_embedded_methods_to_miq_ae_method.rb b/db/migrate/20170421193150_add_embedded_methods_to_miq_ae_method.rb deleted file mode 100644 index 654291484..000000000 --- a/db/migrate/20170421193150_add_embedded_methods_to_miq_ae_method.rb +++ /dev/null @@ -1,13 +0,0 @@ -class AddEmbeddedMethodsToMiqAeMethod < ActiveRecord::Migration[5.0] - class MiqAeMethod < ActiveRecord::Base; end - def up - add_column :miq_ae_methods, :embedded_methods, :text, :array => true, :comment => "Ordered list of embedded method names" - say_with_time("Updating existing miq_ae_methods embedded methods") do - MiqAeMethod.update_all(:embedded_methods => []) - end - end - - def down - remove_column :miq_ae_methods, :embedded_methods - end -end diff --git a/db/migrate/20170425154145_add_sti_to_middlewares.rb b/db/migrate/20170425154145_add_sti_to_middlewares.rb deleted file mode 100644 index f5d52ee46..000000000 --- a/db/migrate/20170425154145_add_sti_to_middlewares.rb +++ /dev/null @@ -1,83 +0,0 @@ -class AddStiToMiddlewares < ActiveRecord::Migration[5.0] - class MiddlewareDatasource < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiddlewareDeployment < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiddlewareDomain < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiddlewareMessaging < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiddlewareServer < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiddlewareServerGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - add_column :middleware_datasources, :type, :string - add_index :middleware_datasources, :type - - add_column :middleware_deployments, :type, :string - add_index :middleware_deployments, :type - - add_column :middleware_domains, :type, :string - add_index :middleware_domains, :type - - add_column :middleware_messagings, :type, :string - add_index :middleware_messagings, :type - - add_column :middleware_server_groups, :type, :string - add_index :middleware_server_groups, :type - - add_column :middleware_servers, :type, :string - add_index :middleware_servers, :type - - MiddlewareDatasource - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareDatasource') - - MiddlewareDeployment - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareDeployment') - - MiddlewareDomain - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareDomain') - - MiddlewareMessaging - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareMessaging') - - MiddlewareServerGroup - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerGroup') - - MiddlewareServer - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer') - end - - def down - remove_index :middleware_datasources, :column => [:type] - remove_column :middleware_datasources, :type - - remove_index :middleware_deployments, :column => [:type] - remove_column :middleware_deployments, :type - - remove_index :middleware_domains, :column => [:type] - remove_column :middleware_domains, :type - - remove_index :middleware_messagings, :column => [:type] - remove_column :middleware_messagings, :type - - remove_index :middleware_server_groups, :column => [:type] - remove_column :middleware_server_groups, :type - - remove_index :middleware_servers, :column => [:type] - remove_column :middleware_servers, :type - end -end diff --git a/db/migrate/20170425185231_create_asset_details.rb b/db/migrate/20170425185231_create_asset_details.rb deleted file mode 100644 index ff7f51b77..000000000 --- a/db/migrate/20170425185231_create_asset_details.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateAssetDetails < ActiveRecord::Migration[5.0] - def change - create_table :asset_details do |t| - t.text :description - t.text :contact - t.text :location - t.text :room - t.text :rack_name - t.text :lowest_rack_unit - t.bigint :resource_id - t.string :resource_type - t.timestamps - t.index %w(resource_id resource_type) - end - end -end diff --git a/db/migrate/20170427152006_remove_invalid_hawkular_endpoints.rb b/db/migrate/20170427152006_remove_invalid_hawkular_endpoints.rb deleted file mode 100644 index 7771be70a..000000000 --- a/db/migrate/20170427152006_remove_invalid_hawkular_endpoints.rb +++ /dev/null @@ -1,83 +0,0 @@ -class RemoveInvalidHawkularEndpoints < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Endpoint < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Authentication < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - ems_container_ids = ExtManagementSystem.where( - :type => %w(ManageIQ::Providers::Openshift::ContainerManager ManageIQ::Providers::Kubernetes::ContainerManager) - ).pluck(:id) - delete_ids = Endpoint.where( - :resource_type => 'ExtManagementSystem', - :resource_id => ems_container_ids, - :role => "hawkular", - :hostname => ["", nil], - ).pluck(:resource_id) - - unless delete_ids.empty? - say_with_time("Removing invalid endpoint and authentication for ems ids [#{delete_ids}]") do - Endpoint.where( - :resource_type => 'ExtManagementSystem', - :resource_id => delete_ids, - :role => "hawkular", - ).destroy_all - Authentication.where( - :authtype => "hawkular", - :resource_type => 'ExtManagementSystem', - :resource_id => delete_ids - ).destroy_all - end - end - end - - def down - ems_containers_by_id = ExtManagementSystem.where( - :type => %w(ManageIQ::Providers::Openshift::ContainerManager ManageIQ::Providers::Kubernetes::ContainerManager) - ).map { |ems| [ems.id, ems] }.to_h - - ems_container_ids = ems_containers_by_id.keys - ems_with_hawkular = Endpoint.where( - :resource_type => 'ExtManagementSystem', - :resource_id => ems_container_ids, - :role => "hawkular", - ).pluck(:resource_id) - create_ids = ems_container_ids - ems_with_hawkular - - unless create_ids.empty? - create_ids.each do |ems_id| - say_with_time("Recreating invalid endpoint and authentication for [#{ems_id}]") do - Endpoint.create!( - :role => "hawkular", - :hostname => "", - :port => 443, - :resource_type => "ExtManagementSystem", - :resource_id => ems_id, - :verify_ssl => 1, - :security_protocol => "ssl-with-validation", - ) - default_auth = Authentication.find_by( - :authtype => 'bearer', - :resource_type => "ExtManagementSystem", - :resource_id => ems_id - ) - Authentication.create!( - :name => "#{ems_containers_by_id[ems_id].type} #{ems_containers_by_id[ems_id].name}", - :authtype => "hawkular", - :resource_type => "ExtManagementSystem", - :resource_id => ems_id, - :type => "AuthToken", - :auth_key => default_auth.auth_key - ) - end - end - end - end -end diff --git a/db/migrate/20170509224500_remove_agent_name_from_jobs.rb b/db/migrate/20170509224500_remove_agent_name_from_jobs.rb deleted file mode 100644 index 3a8e4675d..000000000 --- a/db/migrate/20170509224500_remove_agent_name_from_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveAgentNameFromJobs < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :agent_name, :string - end -end diff --git a/db/migrate/20170509230548_remove_agent_id_from_jobs.rb b/db/migrate/20170509230548_remove_agent_id_from_jobs.rb deleted file mode 100644 index 87e152c96..000000000 --- a/db/migrate/20170509230548_remove_agent_id_from_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveAgentIdFromJobs < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :agent_id, :bigint - end -end diff --git a/db/migrate/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task.rb b/db/migrate/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task.rb deleted file mode 100644 index a3d38a73a..000000000 --- a/db/migrate/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task.rb +++ /dev/null @@ -1,23 +0,0 @@ -class RenameWaitingToStartStateToQueuedinMiqTask < ActiveRecord::Migration[5.0] - class Job < ActiveRecord::Base - belongs_to :miq_task, :class_name =>'RenameWaitingToStartStateToQueuedinMiqTask::MiqTask' - self.inheritance_column = :_type_disabled - end - - class MiqTask < ActiveRecord::Base - has_one :job, :class_name => 'RenameWaitingToStartStateToQueuedinMiqTask::Job' - end - - def up - say_with_time("updating 'state' attribute of 'miq_tasks' table from 'Waiting_to_start' to 'Queued'") do - MiqTask.where(:state => "Waiting_to_start").update_all(:state => "Queued") - end - end - - def down - say_with_time("updating 'state' of 'miq_tasks' from 'Queued' to 'Waiting_to_start' if there is linked job") do - MiqTask.where("id IN (SELECT miq_task_id FROM jobs)") - .where(:state => "Queued").update_all(:state => "Waiting_to_start") - end - end -end diff --git a/db/migrate/20170511120047_remove_container_group_failed_sync_event.rb b/db/migrate/20170511120047_remove_container_group_failed_sync_event.rb deleted file mode 100644 index f7cc4e7e5..000000000 --- a/db/migrate/20170511120047_remove_container_group_failed_sync_event.rb +++ /dev/null @@ -1,19 +0,0 @@ -class RemoveContainerGroupFailedSyncEvent < ActiveRecord::Migration[5.0] - class Relationship < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiqEventDefinition < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time("Remove event definition containergroup_failedsync") do - eventdef = MiqEventDefinition.where(:name => 'containergroup_failedsync').first - if eventdef - Relationship.where(:resource_type => 'MiqEventDefinition', :resource_id => eventdef.id).delete_all - eventdef.delete - end - end - end -end diff --git a/db/migrate/20170512233333_drop_miq_server_rhn_mirror.rb b/db/migrate/20170512233333_drop_miq_server_rhn_mirror.rb deleted file mode 100644 index bca1eb0ad..000000000 --- a/db/migrate/20170512233333_drop_miq_server_rhn_mirror.rb +++ /dev/null @@ -1,48 +0,0 @@ -class DropMiqServerRhnMirror < ActiveRecord::Migration[5.0] - class ServerRole < ActiveRecord::Base; end - class AssignedServerRole < ActiveRecord::Base; end - class SettingsChange < ActiveRecord::Base - serialize :value - end - - def up - remove_column :miq_servers, :rhn_mirror - - say_with_time("Removing RHN Mirror role") do - role = ServerRole.find_by(:name => "rhn_mirror") - if role - AssignedServerRole.where(:server_role_id => role.id).delete_all - role.delete - end - end - - say_with_time("Removing RHN Mirror role from currently configured servers") do - changes = SettingsChange.where(:key => "/server/role") - changes.each do |change| - role_list = change.value.split(",") - change.value = role_list.reject { |role| role == "rhn_mirror" }.join(",") - change.save! - end - end - - if Rails.env.production? && File.exist?('/var/www/miq/vmdb') - say_with_time("Removing files created by RHN Mirror role") do - require 'fileutils' - require 'linux_admin' - - if File.exist?("/etc/fstab") - LinuxAdmin::FSTab.instance.entries.delete_if { |e| e.mount_point == "/repo" } - LinuxAdmin::FSTab.instance.write! - end - - FileUtils.rm_f("/etc/httpd/conf.d/manageiq-https-mirror.conf") - FileUtils.rm_f("/etc/yum.repos.d/manageiq-mirror.repo") - FileUtils.rm_rf(Dir.glob("/repo/*")) - end - end - end - - def down - add_column :miq_servers, :rhn_mirror, :boolean - end -end diff --git a/db/migrate/20170516230854_cockpit_ws.rb b/db/migrate/20170516230854_cockpit_ws.rb deleted file mode 100644 index ac1796521..000000000 --- a/db/migrate/20170516230854_cockpit_ws.rb +++ /dev/null @@ -1,5 +0,0 @@ -class CockpitWs < ActiveRecord::Migration[5.0] - def change - add_column :miq_servers, :has_active_cockpit_ws, :boolean - end -end diff --git a/db/migrate/20170517185419_add_physical_server_id_to_event_parser.rb b/db/migrate/20170517185419_add_physical_server_id_to_event_parser.rb deleted file mode 100644 index 45aee77f7..000000000 --- a/db/migrate/20170517185419_add_physical_server_id_to_event_parser.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddPhysicalServerIdToEventParser < ActiveRecord::Migration[5.0] - def change - add_column :event_streams, :physical_server_id, :bigint - end -end diff --git a/db/migrate/20170519003257_remove_cim_ontap_storage_tables.rb b/db/migrate/20170519003257_remove_cim_ontap_storage_tables.rb deleted file mode 100644 index 5a49aceaa..000000000 --- a/db/migrate/20170519003257_remove_cim_ontap_storage_tables.rb +++ /dev/null @@ -1,662 +0,0 @@ -class RemoveCimOntapStorageTables < ActiveRecord::Migration[5.0] - def up - drop_table :miq_cim_associations - drop_table :miq_cim_derived_metrics - drop_table :miq_cim_instances - drop_table :miq_storage_metrics - drop_table :ontap_aggregate_derived_metrics - drop_table :ontap_aggregate_metrics_rollups - drop_table :ontap_disk_derived_metrics - drop_table :ontap_disk_metrics_rollups - drop_table :ontap_lun_derived_metrics - drop_table :ontap_lun_metrics_rollups - drop_table :ontap_system_derived_metrics - drop_table :ontap_system_metrics_rollups - drop_table :ontap_volume_derived_metrics - drop_table :ontap_volume_metrics_rollups - drop_table :storage_managers - drop_table :storage_metrics_metadata - end - - def down - create_table :miq_cim_associations do |t| - t.string :assoc_class - t.string :result_class - t.string :role - t.string :result_role - t.string :obj_name - t.string :result_obj_name - t.bigint :miq_cim_instance_id - t.bigint :result_instance_id - t.integer :status - t.bigint :zone_id - t.index [:miq_cim_instance_id, :assoc_class, :role, :result_role], :name => "index_on_miq_cim_associations_for_gen_query" - t.index :miq_cim_instance_id, :name => "index_miq_cim_associations_on_miq_cim_instance_id" - t.index [:obj_name, :result_obj_name, :assoc_class], :name => "index_on_miq_cim_associations_for_point_to_point" - t.index :result_instance_id, :name => "index_miq_cim_associations_on_result_instance_id" - end - - create_table :miq_cim_derived_metrics do |t| - t.datetime :statistic_time - t.integer :interval - t.float :k_bytes_read_per_sec - t.float :read_ios_per_sec - t.float :k_bytes_written_per_sec - t.float :k_bytes_transferred_per_sec - t.float :write_ios_per_sec - t.float :write_hit_ios_per_sec - t.float :read_hit_ios_per_sec - t.float :total_ios_per_sec - t.float :utilization - t.float :response_time_sec - t.float :queue_depth - t.float :service_time_sec - t.float :wait_time_sec - t.float :avg_read_size - t.float :avg_write_size - t.float :pct_read - t.float :pct_write - t.float :pct_hit - t.bigint :miq_storage_metric_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.index :miq_storage_metric_id, :name => "index_miq_cim_derived_metrics_on_miq_storage_metric_id" - end - - create_table :miq_cim_instances do |t| - t.string :class_name - t.string :class_hier, :limit => 1024 - t.string :namespace - t.string :obj_name_str - t.text :obj_name - t.text :obj - t.integer :last_update_status - t.boolean :is_top_managed_element - t.bigint :top_managed_element_id - t.bigint :agent_top_id - t.bigint :agent_id - t.bigint :metric_id - t.bigint :metric_top_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.bigint :vmdb_obj_id - t.string :vmdb_obj_type - t.bigint :zone_id - t.string :source - t.string :type - t.text :type_spec_obj - t.index :agent_id, :name => "index_miq_cim_instances_on_agent_id" - t.index :agent_top_id, :name => "index_miq_cim_instances_on_agent_top_id" - t.index :metric_id, :name => "index_miq_cim_instances_on_metric_id" - t.index :metric_top_id, :name => "index_miq_cim_instances_on_metric_top_id" - t.index :obj_name_str, :name => "index_miq_cim_instances_on_obj_name_str", :unique => true - t.index :top_managed_element_id, :name => "index_miq_cim_instances_on_top_managed_element_id" - t.index :type, :name => "index_miq_cim_instances_on_type" - end - - create_table :miq_storage_metrics do |t| - t.text :metric_obj - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.string :type - end - - create_table :ontap_aggregate_derived_metrics do |t| - t.datetime :statistic_time - t.integer :interval - t.float :total_transfers - t.float :user_reads - t.float :user_writes - t.float :cp_reads - t.float :user_read_blocks - t.float :user_write_blocks - t.float :cp_read_blocks - t.bigint :miq_storage_metric_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.text :base_counters - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_aggregate_derived_metrics_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_aggregate_derived_metrics_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_aggregate_derived_metrics_on_smm_id" - end - - create_table :ontap_aggregate_metrics_rollups do |t| - t.datetime :statistic_time - t.string :rollup_type - t.bigint :interval - t.float :total_transfers - t.float :total_transfers_min - t.float :total_transfers_max - t.float :user_reads - t.float :user_reads_min - t.float :user_reads_max - t.float :user_writes - t.float :user_writes_min - t.float :user_writes_max - t.float :cp_reads - t.float :cp_reads_min - t.float :cp_reads_max - t.float :user_read_blocks - t.float :user_read_blocks_min - t.float :user_read_blocks_max - t.float :user_write_blocks - t.float :user_write_blocks_min - t.float :user_write_blocks_max - t.float :cp_read_blocks - t.float :cp_read_blocks_min - t.float :cp_read_blocks_max - t.text :base_counters - t.bigint :miq_storage_metric_id - t.bigint :time_profile_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_aggregate_metrics_rollups_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_aggregate_metrics_rollups_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_aggregate_metrics_rollups_on_smm_id" - t.index :time_profile_id, :name => "index_ontap_aggregate_metrics_rollups_on_time_profile_id" - end - - create_table :ontap_disk_derived_metrics do |t| - t.datetime :statistic_time - t.integer :interval - t.float :total_transfers - t.float :user_read_chain - t.float :user_reads - t.float :user_write_chain - t.float :user_writes - t.float :user_writes_in_skip_mask - t.float :user_skip_write_ios - t.float :cp_read_chain - t.float :cp_reads - t.float :guarenteed_read_chain - t.float :guarenteed_reads - t.float :guarenteed_write_chain - t.float :guarenteed_writes - t.float :user_read_latency - t.float :user_read_blocks - t.float :user_write_latency - t.float :user_write_blocks - t.float :skip_blocks - t.float :cp_read_latency - t.float :cp_read_blocks - t.float :guarenteed_read_latency - t.float :guarenteed_read_blocks - t.float :guarenteed_write_latency - t.float :guarenteed_write_blocks - t.float :disk_busy - t.float :io_pending - t.float :io_queued - t.bigint :miq_storage_metric_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.text :base_counters - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_disk_derived_metrics_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_disk_derived_metrics_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_disk_derived_metrics_on_smm_id" - end - - create_table :ontap_disk_metrics_rollups do |t| - t.datetime :statistic_time - t.string :rollup_type - t.bigint :interval - t.float :total_transfers - t.float :total_transfers_min - t.float :total_transfers_max - t.float :user_read_chain - t.float :user_read_chain_min - t.float :user_read_chain_max - t.float :user_reads - t.float :user_reads_min - t.float :user_reads_max - t.float :user_write_chain - t.float :user_write_chain_min - t.float :user_write_chain_max - t.float :user_writes - t.float :user_writes_min - t.float :user_writes_max - t.float :user_writes_in_skip_mask - t.float :user_writes_in_skip_mask_min - t.float :user_writes_in_skip_mask_max - t.float :user_skip_write_ios - t.float :user_skip_write_ios_min - t.float :user_skip_write_ios_max - t.float :cp_read_chain - t.float :cp_read_chain_min - t.float :cp_read_chain_max - t.float :cp_reads - t.float :cp_reads_min - t.float :cp_reads_max - t.float :guarenteed_read_chain - t.float :guarenteed_read_chain_min - t.float :guarenteed_read_chain_max - t.float :guarenteed_reads - t.float :guarenteed_reads_min - t.float :guarenteed_reads_max - t.float :guarenteed_write_chain - t.float :guarenteed_write_chain_min - t.float :guarenteed_write_chain_max - t.float :guarenteed_writes - t.float :guarenteed_writes_min - t.float :guarenteed_writes_max - t.float :user_read_latency - t.float :user_read_latency_min - t.float :user_read_latency_max - t.float :user_read_blocks - t.float :user_read_blocks_min - t.float :user_read_blocks_max - t.float :user_write_latency - t.float :user_write_latency_min - t.float :user_write_latency_max - t.float :user_write_blocks - t.float :user_write_blocks_min - t.float :user_write_blocks_max - t.float :skip_blocks - t.float :skip_blocks_min - t.float :skip_blocks_max - t.float :cp_read_latency - t.float :cp_read_latency_min - t.float :cp_read_latency_max - t.float :cp_read_blocks - t.float :cp_read_blocks_min - t.float :cp_read_blocks_max - t.float :guarenteed_read_latency - t.float :guarenteed_read_latency_min - t.float :guarenteed_read_latency_max - t.float :guarenteed_read_blocks - t.float :guarenteed_read_blocks_min - t.float :guarenteed_read_blocks_max - t.float :guarenteed_write_latency - t.float :guarenteed_write_latency_min - t.float :guarenteed_write_latency_max - t.float :guarenteed_write_blocks - t.float :guarenteed_write_blocks_min - t.float :guarenteed_write_blocks_max - t.float :disk_busy - t.float :disk_busy_min - t.float :disk_busy_max - t.float :io_pending - t.float :io_pending_min - t.float :io_pending_max - t.float :io_queued - t.float :io_queued_min - t.float :io_queued_max - t.text :base_counters - t.bigint :miq_storage_metric_id - t.bigint :time_profile_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_disk_metrics_rollups_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_disk_metrics_rollups_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_disk_metrics_rollups_on_smm_id" - t.index :time_profile_id, :name => "index_ontap_disk_metrics_rollups_on_time_profile_id" - end - - create_table :ontap_lun_derived_metrics do |t| - t.datetime :statistic_time - t.integer :interval - t.float :read_ops - t.float :write_ops - t.float :other_ops - t.float :total_ops - t.float :read_data - t.float :write_data - t.float :queue_full - t.float :avg_latency - t.bigint :miq_storage_metric_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.text :base_counters - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_lun_derived_metrics_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_lun_derived_metrics_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_lun_derived_metrics_on_smm_id" - end - - create_table :ontap_lun_metrics_rollups do |t| - t.datetime :statistic_time - t.string :rollup_type - t.bigint :interval - t.float :read_ops - t.float :read_ops_min - t.float :read_ops_max - t.float :write_ops - t.float :write_ops_min - t.float :write_ops_max - t.float :other_ops - t.float :other_ops_min - t.float :other_ops_max - t.float :total_ops - t.float :total_ops_min - t.float :total_ops_max - t.float :read_data - t.float :read_data_min - t.float :read_data_max - t.float :write_data - t.float :write_data_min - t.float :write_data_max - t.float :queue_full - t.float :queue_full_min - t.float :queue_full_max - t.float :avg_latency - t.float :avg_latency_min - t.float :avg_latency_max - t.text :base_counters - t.bigint :miq_storage_metric_id - t.bigint :time_profile_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_lun_metrics_rollups_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_lun_metrics_rollups_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_lun_metrics_rollups_on_smm_id" - t.index :time_profile_id, :name => "index_ontap_lun_metrics_rollups_on_time_profile_id" - end - - create_table :ontap_system_derived_metrics do |t| - t.datetime :statistic_time - t.integer :interval - t.float :cpu_busy - t.float :avg_processor_busy - t.float :total_processor_busy - t.float :read_ops - t.float :write_ops - t.float :total_ops - t.float :sys_read_latency - t.float :sys_write_latency - t.float :sys_avg_latency - t.float :nfs_ops - t.float :cifs_ops - t.float :http_ops - t.float :fcp_ops - t.float :iscsi_ops - t.float :net_data_recv - t.float :net_data_sent - t.float :disk_data_read - t.float :disk_data_written - t.bigint :miq_storage_metric_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.text :base_counters - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_system_derived_metrics_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_system_derived_metrics_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_system_derived_metrics_on_smm_id" - end - - create_table :ontap_system_metrics_rollups do |t| - t.datetime :statistic_time - t.string :rollup_type - t.bigint :interval - t.float :cpu_busy - t.float :cpu_busy_min - t.float :cpu_busy_max - t.float :avg_processor_busy - t.float :avg_processor_busy_min - t.float :avg_processor_busy_max - t.float :total_processor_busy - t.float :total_processor_busy_min - t.float :total_processor_busy_max - t.float :read_ops - t.float :read_ops_min - t.float :read_ops_max - t.float :write_ops - t.float :write_ops_min - t.float :write_ops_max - t.float :total_ops - t.float :total_ops_min - t.float :total_ops_max - t.float :sys_read_latency - t.float :sys_read_latency_min - t.float :sys_read_latency_max - t.float :sys_write_latency - t.float :sys_write_latency_min - t.float :sys_write_latency_max - t.float :sys_avg_latency - t.float :sys_avg_latency_min - t.float :sys_avg_latency_max - t.float :nfs_ops - t.float :nfs_ops_min - t.float :nfs_ops_max - t.float :cifs_ops - t.float :cifs_ops_min - t.float :cifs_ops_max - t.float :http_ops - t.float :http_ops_min - t.float :http_ops_max - t.float :fcp_ops - t.float :fcp_ops_min - t.float :fcp_ops_max - t.float :iscsi_ops - t.float :iscsi_ops_min - t.float :iscsi_ops_max - t.float :net_data_recv - t.float :net_data_recv_min - t.float :net_data_recv_max - t.float :net_data_sent - t.float :net_data_sent_min - t.float :net_data_sent_max - t.float :disk_data_read - t.float :disk_data_read_min - t.float :disk_data_read_max - t.float :disk_data_written - t.float :disk_data_written_min - t.float :disk_data_written_max - t.text :base_counters - t.bigint :miq_storage_metric_id - t.bigint :time_profile_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_system_metrics_rollups_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_system_metrics_rollups_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_system_metrics_rollups_on_smm_id" - t.index :time_profile_id, :name => "index_ontap_system_metrics_rollups_on_time_profile_id" - end - - create_table :ontap_volume_derived_metrics do |t| - t.datetime :statistic_time - t.integer :interval - t.float :avg_latency - t.float :total_ops - t.float :read_data - t.float :read_latency - t.float :read_ops - t.float :write_data - t.float :write_latency - t.float :write_ops - t.float :other_latency - t.float :other_ops - t.float :nfs_read_data - t.float :nfs_read_latency - t.float :nfs_read_ops - t.float :nfs_write_data - t.float :nfs_write_latency - t.float :nfs_write_ops - t.float :nfs_other_latency - t.float :nfs_other_ops - t.float :cifs_read_data - t.float :cifs_read_latency - t.float :cifs_read_ops - t.float :cifs_write_data - t.float :cifs_write_latency - t.float :cifs_write_ops - t.float :cifs_other_latency - t.float :cifs_other_ops - t.float :san_read_data - t.float :san_read_latency - t.float :san_read_ops - t.float :san_write_data - t.float :san_write_latency - t.float :san_write_ops - t.float :san_other_latency - t.float :san_other_ops - t.float :queue_depth - t.bigint :miq_storage_metric_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.text :base_counters - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_volume_derived_metrics_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_volume_derived_metrics_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_volume_derived_metrics_on_smm_id" - end - - create_table :ontap_volume_metrics_rollups do |t| - t.datetime :statistic_time - t.string :rollup_type - t.bigint :interval - t.float :avg_latency - t.float :avg_latency_min - t.float :avg_latency_max - t.float :total_ops - t.float :total_ops_min - t.float :total_ops_max - t.float :read_data - t.float :read_data_min - t.float :read_data_max - t.float :read_latency - t.float :read_latency_min - t.float :read_latency_max - t.float :read_ops - t.float :read_ops_min - t.float :read_ops_max - t.float :write_data - t.float :write_data_min - t.float :write_data_max - t.float :write_latency - t.float :write_latency_min - t.float :write_latency_max - t.float :write_ops - t.float :write_ops_min - t.float :write_ops_max - t.float :other_latency - t.float :other_latency_min - t.float :other_latency_max - t.float :other_ops - t.float :other_ops_min - t.float :other_ops_max - t.float :nfs_read_data - t.float :nfs_read_data_min - t.float :nfs_read_data_max - t.float :nfs_read_latency - t.float :nfs_read_latency_min - t.float :nfs_read_latency_max - t.float :nfs_read_ops - t.float :nfs_read_ops_min - t.float :nfs_read_ops_max - t.float :nfs_write_data - t.float :nfs_write_data_min - t.float :nfs_write_data_max - t.float :nfs_write_latency - t.float :nfs_write_latency_min - t.float :nfs_write_latency_max - t.float :nfs_write_ops - t.float :nfs_write_ops_min - t.float :nfs_write_ops_max - t.float :nfs_other_latency - t.float :nfs_other_latency_min - t.float :nfs_other_latency_max - t.float :nfs_other_ops - t.float :nfs_other_ops_min - t.float :nfs_other_ops_max - t.float :cifs_read_data - t.float :cifs_read_data_min - t.float :cifs_read_data_max - t.float :cifs_read_latency - t.float :cifs_read_latency_min - t.float :cifs_read_latency_max - t.float :cifs_read_ops - t.float :cifs_read_ops_min - t.float :cifs_read_ops_max - t.float :cifs_write_data - t.float :cifs_write_data_min - t.float :cifs_write_data_max - t.float :cifs_write_latency - t.float :cifs_write_latency_min - t.float :cifs_write_latency_max - t.float :cifs_write_ops - t.float :cifs_write_ops_min - t.float :cifs_write_ops_max - t.float :cifs_other_latency - t.float :cifs_other_latency_min - t.float :cifs_other_latency_max - t.float :cifs_other_ops - t.float :cifs_other_ops_min - t.float :cifs_other_ops_max - t.float :san_read_data - t.float :san_read_data_min - t.float :san_read_data_max - t.float :san_read_latency - t.float :san_read_latency_min - t.float :san_read_latency_max - t.float :san_read_ops - t.float :san_read_ops_min - t.float :san_read_ops_max - t.float :san_write_data - t.float :san_write_data_min - t.float :san_write_data_max - t.float :san_write_latency - t.float :san_write_latency_min - t.float :san_write_latency_max - t.float :san_write_ops - t.float :san_write_ops_min - t.float :san_write_ops_max - t.float :san_other_latency - t.float :san_other_latency_min - t.float :san_other_latency_max - t.float :san_other_ops - t.float :san_other_ops_min - t.float :san_other_ops_max - t.text :base_counters - t.bigint :miq_storage_metric_id - t.bigint :time_profile_id - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.bigint :miq_cim_instance_id - t.bigint :storage_metrics_metadata_id - t.index :miq_cim_instance_id, :name => "index_ontap_volume_metrics_rollups_on_miq_cim_instance_id" - t.index :miq_storage_metric_id, :name => "index_ontap_volume_metrics_rollups_on_miq_storage_metric_id" - t.index :storage_metrics_metadata_id, :name => "index_ontap_volume_metrics_rollups_on_smm_id" - t.index :time_profile_id, :name => "index_ontap_volume_metrics_rollups_on_time_profile_id" - end - - create_table :storage_managers do |t| - t.string :ipaddress - t.string :agent_type - t.integer :last_update_status - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - t.bigint :zone_id - t.string :name - t.string :hostname - t.string :port - t.bigint :parent_agent_id - t.string :vendor - t.string :version - t.string :type - t.text :type_spec_data - t.index :parent_agent_id, :name => "index_storage_managers_on_parent_agent_id" - t.index :zone_id, :name => "index_storage_managers_on_zone_id" - end - - create_table :storage_metrics_metadata do |t| - t.string :type - t.text :counter_info - t.datetime :created_at, :null => false - t.datetime :updated_at, :null => false - end - end -end diff --git a/db/migrate/20170519153350_add_showback_models.rb b/db/migrate/20170519153350_add_showback_models.rb deleted file mode 100644 index f8ccf7c9b..000000000 --- a/db/migrate/20170519153350_add_showback_models.rb +++ /dev/null @@ -1,64 +0,0 @@ -class AddShowbackModels < ActiveRecord::Migration[5.0] - def change - create_table :showback_usage_types do |t| - t.string :category - t.string :description - t.string :measure - t.text :dimensions - t.timestamps - end - - create_table :showback_events do |t| - t.jsonb :data - t.timestamp :start_time - t.timestamp :end_time - t.belongs_to :resource, :type => :bigint, :polymorphic => true, :index => true - t.jsonb :context - t.timestamps - end - - create_table :showback_price_plans do |t| - t.string :name - t.belongs_to :resource, :type => :bigint, :polymorphic => true - t.string :description - t.timestamps - end - - create_table :showback_rates do |t| - t.bigint :fixed_rate_subunit # Columns needed by gem money - t.string :fixed_rate_currency - t.bigint :variable_rate_subunit # Columns needed by gem money - t.string :variable_rate_currency - t.string :calculation - t.string :category - t.string :dimension - t.jsonb :screener - t.datetime :date - t.string :concept - t.belongs_to :showback_price_plan, :type => :bigint - t.timestamps - end - add_index :showback_rates, %i[category dimension] - # add_index :showback_rates, :screener, :using => :gin - - create_table :showback_pools do |t| - t.string :name - t.string :description - t.timestamp :start_time - t.timestamp :end_time - t.string :state - t.bigint :accumulated_cost_subunits # Columns needed by gem money - t.string :accumulated_cost_currency - t.references :resource, :type => :bigint, :polymorphic => true, :index => true - t.timestamps - end - - create_table :showback_charges do |t| - t.bigint :cost_subunits - t.string :cost_currency - t.belongs_to :showback_pool, :type => :bigint, :index => true - t.belongs_to :showback_event, :type => :bigint, :index => true - t.timestamps - end - end -end diff --git a/db/migrate/20170519173044_remove_cim_ontap_records.rb b/db/migrate/20170519173044_remove_cim_ontap_records.rb deleted file mode 100644 index bca4a19b8..000000000 --- a/db/migrate/20170519173044_remove_cim_ontap_records.rb +++ /dev/null @@ -1,136 +0,0 @@ -class RemoveCimOntapRecords < ActiveRecord::Migration[5.0] - class ServerRole < ActiveRecord::Base; end - - class AssignedServerRole < ActiveRecord::Base; end - - class SettingsChange < ActiveRecord::Base - serialize :value - end - - class MiqWorker < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class MiqProductFeature < ActiveRecord::Base; end - - class MiqRolesFeature < ActiveRecord::Base; end # Join table for MiqProductFeature<->MiqUserRole - - ROLES = %w( - storage_inventory - storage_metrics_collector - storage_metrics_coordinator - storage_metrics_processor - vmdb_storage_bridge - ).freeze - - WORKERS = %w( - MiqNetappRefreshWorker - MiqSmisRefreshWorker - MiqStorageMetricsCollectorWorker - MiqVmdbStorageBridgeWorker - ).freeze - - SETTINGS = %w( - /storage/inventory% - /storage/metrics_collection% - /storage/metrics_history% - /storage/metrics_history% - /workers/worker_base/smis_refresh_worker% - /workers/worker_base/queue_worker_base/netapp_refresh_worker% - /workers/worker_base/queue_worker_base/storage_metrics_collector_worker% - /workers/worker_base/queue_worker_base/vmdb_storage_bridge_worker% - ).freeze - - PRODUCT_FEATURES = %w( - cim_base_storage_extent - cim_base_storage_extent_control - cim_base_storage_extent_show - cim_base_storage_extent_show_list - cim_base_storage_extent_statistics - cim_base_storage_extent_tag - cim_base_storage_extent_view - ontap_file_share - ontap_file_share_control - ontap_file_share_create_datastore - ontap_file_share_show - ontap_file_share_show_list - ontap_file_share_statistics - ontap_file_share_tag - ontap_file_share_view - ontap_logical_disk - ontap_logical_disk_control - ontap_logical_disk_perf - ontap_logical_disk_show - ontap_logical_disk_show_list - ontap_logical_disk_statistics - ontap_logical_disk_tag - ontap_logical_disk_view - ontap_storage_system - ontap_storage_system_control - ontap_storage_system_create_logical_disk - ontap_storage_system_show - ontap_storage_system_show_list - ontap_storage_system_statistics - ontap_storage_system_tag - ontap_storage_system_view - ontap_storage_volume - ontap_storage_volume_control - ontap_storage_volume_show - ontap_storage_volume_show_list - ontap_storage_volume_statistics - ontap_storage_volume_tag - ontap_storage_volume_view - snia_local_file_system - snia_local_file_system_control - snia_local_file_system_show - snia_local_file_system_show_list - snia_local_file_system_statistics - snia_local_file_system_tag - snia_local_file_system_view - storage_manager - storage_manager_admin - storage_manager_control - storage_manager_delete - storage_manager_edit - storage_manager_new - storage_manager_refresh_inventory - storage_manager_refresh_status - storage_manager_show - storage_manager_show_list - storage_manager_view - ).freeze - - def up - say_with_time("Removing roles") do - ServerRole.where(:name => ROLES).each do |role| - AssignedServerRole.where(:server_role_id => role.id).delete_all - role.delete - end - end - - say_with_time("Removing roles from currently configured servers") do - SettingsChange.where(:key => "/server/role").each do |change| - role_list = change.value.split(",") - new_role_list = (role_list - ROLES).join(",") - change.update!(:value => new_role_list) - end - end - - say_with_time("Removing workers") do - MiqWorker.where(:type => WORKERS).delete_all - end - - say_with_time("Removing settings") do - SETTINGS.each do |key| - SettingsChange.where("key LIKE ?", key).delete_all - end - end - - say_with_time("Removing product features") do - query = MiqProductFeature.where(:identifier => PRODUCT_FEATURES) - ids = query.pluck(:id) - query.delete_all - MiqRolesFeature.where(:miq_product_feature_id => ids).delete_all - end - end -end diff --git a/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb b/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb deleted file mode 100644 index 140d855c4..000000000 --- a/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddGuestDeviceIdToFirmwares < ActiveRecord::Migration[5.0] - def change - add_column :firmwares, :guest_device_id, :bigint - add_index :firmwares, :guest_device_id - end -end diff --git a/db/migrate/20170528102055_add_limits_resources_to_containers.rb b/db/migrate/20170528102055_add_limits_resources_to_containers.rb deleted file mode 100644 index a94d9e31a..000000000 --- a/db/migrate/20170528102055_add_limits_resources_to_containers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddLimitsResourcesToContainers < ActiveRecord::Migration[5.0] - def change - add_column :containers, :request_cpu_cores, :float - add_column :containers, :request_memory_bytes, :bigint - add_column :containers, :limit_cpu_cores, :float - add_column :containers, :limit_memory_bytes, :bigint - end -end diff --git a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb deleted file mode 100644 index ee81c56c9..000000000 --- a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddManufacturerAndFruToGuestDevices < ActiveRecord::Migration[5.0] - def change - add_column :guest_devices, :manufacturer, :string - add_column :guest_devices, :field_replaceable_unit, :string - add_column :guest_devices, :parent_device_id, :bigint - add_index :guest_devices, :parent_device_id - end -end diff --git a/db/migrate/20170611130239_add_disconnection_fields_to_container_node.rb b/db/migrate/20170611130239_add_disconnection_fields_to_container_node.rb deleted file mode 100644 index fc3851043..000000000 --- a/db/migrate/20170611130239_add_disconnection_fields_to_container_node.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddDisconnectionFieldsToContainerNode < ActiveRecord::Migration[5.0] - def change - add_column :container_nodes, :old_ems_id, :bigint - add_column :container_nodes, :deleted_on, :datetime - end -end diff --git a/db/migrate/20170612051535_add_encrypted_to_cloud_volume_snapshot.rb b/db/migrate/20170612051535_add_encrypted_to_cloud_volume_snapshot.rb deleted file mode 100644 index c30066473..000000000 --- a/db/migrate/20170612051535_add_encrypted_to_cloud_volume_snapshot.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddEncryptedToCloudVolumeSnapshot < ActiveRecord::Migration[5.0] - def change - add_column :cloud_volume_snapshots, :encrypted, :boolean - end -end diff --git a/db/migrate/20170613144708_add_sti_to_container_image.rb b/db/migrate/20170613144708_add_sti_to_container_image.rb deleted file mode 100644 index a4be04e2a..000000000 --- a/db/migrate/20170613144708_add_sti_to_container_image.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddStiToContainerImage < ActiveRecord::Migration[5.0] - def change - add_column :container_images, :type, :string - add_column :container_images, :ems_ref, :string - end -end diff --git a/db/migrate/20170619161514_add_options_to_ext_management_system.rb b/db/migrate/20170619161514_add_options_to_ext_management_system.rb deleted file mode 100644 index 0e29846d7..000000000 --- a/db/migrate/20170619161514_add_options_to_ext_management_system.rb +++ /dev/null @@ -1,53 +0,0 @@ -class AddOptionsToExtManagementSystem < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - has_many :custom_attributes, - :as => :resource, - :dependent => :destroy, - :class_name => 'AddOptionsToExtManagementSystem::CustomAttribute' - serialize :options - end - - class CustomAttribute < ActiveRecord::Base - self.inheritance_column = :_type_disabled - belongs_to :resource, :polymorphic => true - serialize :serialized_value - end - - def up - add_column :ext_management_systems, :options, :text - say_with_time("Migrating Kubernetes provider options") do - ExtManagementSystem - .where(:type => ["ManageIQ::Providers::Kubernetes::ContainerManager", - "ManageIQ::Providers::Openshift::ContainerManager"]) - .each do |cp| - migrated_options = Hash[ - cp.custom_attributes.where(:section => 'cluster_settings', - :name => %w(no_proxy http_proxy https_proxy)) - .map { |ca| [ca.name.to_sym, ca.value] }] - cp.update(:options => {:image_inspector_options => migrated_options}) - end - CustomAttribute.where(:section => 'cluster_settings', - :name => %w(no_proxy http_proxy https_proxy)).delete_all - end - end - - def down - say_with_time("Migrating Kubernetes provider options") do - ExtManagementSystem - .where(:type => ["ManageIQ::Providers::Kubernetes::ContainerManager", - "ManageIQ::Providers::Openshift::ContainerManager"]) - .each do |cp| - options = cp.options - %w(no_proxy http_proxy https_proxy).each do |opt| - if options[:image_inspector_options].keys.include?(opt.to_sym) - cp.custom_attributes.create(:section => 'cluster_settings', - :name => opt, - :value => options[:image_inspector_options][opt.to_sym]) - end - end - end - end - remove_column :ext_management_systems, :options - end -end diff --git a/db/migrate/20170619170148_remove_mirrored_logger_settings.rb b/db/migrate/20170619170148_remove_mirrored_logger_settings.rb deleted file mode 100644 index 643aec737..000000000 --- a/db/migrate/20170619170148_remove_mirrored_logger_settings.rb +++ /dev/null @@ -1,10 +0,0 @@ -class RemoveMirroredLoggerSettings < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - end - - def up - say_with_time("Remove MirroredLogger settings") do - SettingsChange.where("key LIKE ?", "/log/level_%_in_evm").delete_all - end - end -end diff --git a/db/migrate/20170621204151_drop_miq_queue_for_user.rb b/db/migrate/20170621204151_drop_miq_queue_for_user.rb deleted file mode 100644 index be122c11c..000000000 --- a/db/migrate/20170621204151_drop_miq_queue_for_user.rb +++ /dev/null @@ -1,11 +0,0 @@ -class DropMiqQueueForUser < ActiveRecord::Migration[5.0] - def up - remove_column :miq_queue, :for_user - remove_column :miq_queue, :for_user_id - end - - def down - add_column :miq_queue, :for_user, :string - add_column :miq_queue, :for_user_id, :bigint - end -end diff --git a/db/migrate/20170622181340_change_showback_column_name.rb b/db/migrate/20170622181340_change_showback_column_name.rb deleted file mode 100644 index 98954648c..000000000 --- a/db/migrate/20170622181340_change_showback_column_name.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ChangeShowbackColumnName < ActiveRecord::Migration[5.0] - def change - rename_column :showback_rates, :fixed_rate_subunit, :fixed_rate_subunits - rename_column :showback_rates, :variable_rate_subunit, :variable_rate_subunits - end -end diff --git a/db/migrate/20170622210452_create_miq_queues_work_label.rb b/db/migrate/20170622210452_create_miq_queues_work_label.rb deleted file mode 100644 index d5036a7da..000000000 --- a/db/migrate/20170622210452_create_miq_queues_work_label.rb +++ /dev/null @@ -1,5 +0,0 @@ -class CreateMiqQueuesWorkLabel < ActiveRecord::Migration[5.0] - def change - add_column :miq_queue, :tracking_label, :string, :comment => 'label to track requests through the system' - end -end diff --git a/db/migrate/20170627135623_update_container_image_types.rb b/db/migrate/20170627135623_update_container_image_types.rb deleted file mode 100644 index bbfbe0add..000000000 --- a/db/migrate/20170627135623_update_container_image_types.rb +++ /dev/null @@ -1,12 +0,0 @@ -class UpdateContainerImageTypes < ActiveRecord::Migration[5.0] - class ContainerImage < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - say_with_time("Updating type column for ContainerImage") do - ContainerImage.where(:size => nil).update_all(:type => "ContainerImage") - ContainerImage.where.not(:size => nil).update_all(:type => "ManageIQ::Providers::Openshift::ContainerManager::ContainerImage") - end - end -end diff --git a/db/migrate/20170703094235_add_hash_expression_to_miq_alert.rb b/db/migrate/20170703094235_add_hash_expression_to_miq_alert.rb deleted file mode 100644 index 5110567d2..000000000 --- a/db/migrate/20170703094235_add_hash_expression_to_miq_alert.rb +++ /dev/null @@ -1,30 +0,0 @@ -class AddHashExpressionToMiqAlert < ActiveRecord::Migration[5.0] - class MiqAlert < ActiveRecord::Base - end - - def up - add_column :miq_alerts, :hash_expression, :text - - say_with_time('Add hash expression to MiqAlert for existing alerts') do - MiqAlert.where("expression NOT LIKE ?", "--- !ruby/object:MiqExpression%").each do |alert| - alert.hash_expression = alert.expression - alert.expression = nil - alert.save - end - end - - rename_column :miq_alerts, :expression, :miq_expression - end - - def down - say_with_time('Remove hash expression from MiqAlert for existing alerts') do - MiqAlert.where.not(:hash_expression => nil).each do |alert| - alert.miq_expression = alert.hash_expression - alert.save - end - end - - remove_column :miq_alerts, :hash_expression - rename_column :miq_alerts, :miq_expression, :expression - end -end diff --git a/db/migrate/20170704102506_add_deleted_on_indexes_to_containers_tables.rb b/db/migrate/20170704102506_add_deleted_on_indexes_to_containers_tables.rb deleted file mode 100644 index be7cca7d3..000000000 --- a/db/migrate/20170704102506_add_deleted_on_indexes_to_containers_tables.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddDeletedOnIndexesToContainersTables < ActiveRecord::Migration[5.0] - def change - add_index :container_definitions, :deleted_on - add_index :container_groups, :deleted_on - add_index :container_images, :deleted_on - add_index :container_projects, :deleted_on - add_index :container_nodes, :deleted_on - add_index :containers, :deleted_on - end -end diff --git a/db/migrate/20170704102536_use_deleted_on_in_containers_tables.rb b/db/migrate/20170704102536_use_deleted_on_in_containers_tables.rb deleted file mode 100644 index cd5d75d5b..000000000 --- a/db/migrate/20170704102536_use_deleted_on_in_containers_tables.rb +++ /dev/null @@ -1,58 +0,0 @@ -class UseDeletedOnInContainersTables < ActiveRecord::Migration[5.0] - class ContainerDefinition < ActiveRecord::Base - end - - class ContainerGroup < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class ContainerImage < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class ContainerProject < ActiveRecord::Base - end - - class ContainerNode < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Container < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def disconnect_to_soft_delete(model) - model.where(:deleted_on => nil, :ems_id => nil).update_all(:deleted_on => Time.now.utc) - model.where.not(:deleted_on => nil).where.not(:ems_id => nil).update_all(:deleted_on => nil) - model.where.not(:deleted_on => nil).update_all("ems_id = old_ems_id") - end - - def soft_delete_to_disconnect(model) - model.where.not(:deleted_on => nil).update_all(:ems_id => nil) - end - - MODEL_CLASSES = [ - ContainerDefinition, - ContainerGroup, - ContainerImage, - ContainerProject, - ContainerNode, - Container, - ].freeze - - def up - MODEL_CLASSES.each do |model_class| - say_with_time("Change ':deleted_on not nil' :ems_id to :old_ems_id for #{model_class}") do - disconnect_to_soft_delete(model_class) - end - end - end - - def down - MODEL_CLASSES.each do |model_class| - say_with_time("Change ':deleted_on not nil' :ems_id to nil for #{model_class}") do - soft_delete_to_disconnect(model_class) - end - end - end -end diff --git a/db/migrate/20170705074637_add_object_labels_to_container_templates.rb b/db/migrate/20170705074637_add_object_labels_to_container_templates.rb deleted file mode 100644 index c3fadddcb..000000000 --- a/db/migrate/20170705074637_add_object_labels_to_container_templates.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddObjectLabelsToContainerTemplates < ActiveRecord::Migration[5.0] - def change - add_column :container_templates, :object_labels, :text - end -end diff --git a/db/migrate/20170706220336_add_sti_to_container_template.rb b/db/migrate/20170706220336_add_sti_to_container_template.rb deleted file mode 100644 index d7a547bb9..000000000 --- a/db/migrate/20170706220336_add_sti_to_container_template.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStiToContainerTemplate < ActiveRecord::Migration[5.0] - def change - add_column :container_templates, :type, :string - end -end diff --git a/db/migrate/20170707150520_update_container_template_types.rb b/db/migrate/20170707150520_update_container_template_types.rb deleted file mode 100644 index 901b7c2db..000000000 --- a/db/migrate/20170707150520_update_container_template_types.rb +++ /dev/null @@ -1,11 +0,0 @@ -class UpdateContainerTemplateTypes < ActiveRecord::Migration[5.0] - class ContainerTemplate < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - say_with_time("Updating type column for ContainerTemplate") do - ContainerTemplate.update_all(:type => "ManageIQ::Providers::Openshift::ContainerManager::ContainerTemplate") - end - end -end diff --git a/db/migrate/20170707155809_add_stored_data_to_showback_charge.rb b/db/migrate/20170707155809_add_stored_data_to_showback_charge.rb deleted file mode 100644 index 560b60680..000000000 --- a/db/migrate/20170707155809_add_stored_data_to_showback_charge.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStoredDataToShowbackCharge < ActiveRecord::Migration[5.0] - def change - add_column :showback_charges, :stored_data, :jsonb, :comment => 'Snapshot of the data of showbackevent' - end -end diff --git a/db/migrate/20170707162731_add_columns_unit_time_to_showback_rate.rb b/db/migrate/20170707162731_add_columns_unit_time_to_showback_rate.rb deleted file mode 100644 index cc0ae5e3b..000000000 --- a/db/migrate/20170707162731_add_columns_unit_time_to_showback_rate.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddColumnsUnitTimeToShowbackRate < ActiveRecord::Migration[5.0] - def change - add_column :showback_rates, :fixed_rate_per_unit, :string - add_column :showback_rates, :fixed_rate_per_time, :string - add_column :showback_rates, :variable_rate_per_unit, :string - add_column :showback_rates, :variable_rate_per_time, :string - add_column :showback_rates, :step_value, :float - add_column :showback_rates, :step_time_unit, :string - add_column :showback_rates, :step_time_value, :float - add_column :showback_rates, :step_unit, :string - end -end diff --git a/db/migrate/20170710080149_remove_ems_ref_from_container_image.rb b/db/migrate/20170710080149_remove_ems_ref_from_container_image.rb deleted file mode 100644 index d8d57c3d9..000000000 --- a/db/migrate/20170710080149_remove_ems_ref_from_container_image.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveEmsRefFromContainerImage < ActiveRecord::Migration[5.0] - def change - remove_column :container_images, :ems_ref, :string - end -end diff --git a/db/migrate/20170710132935_convert_custom_button_to_classes.rb b/db/migrate/20170710132935_convert_custom_button_to_classes.rb deleted file mode 100644 index 6c54e53c2..000000000 --- a/db/migrate/20170710132935_convert_custom_button_to_classes.rb +++ /dev/null @@ -1,144 +0,0 @@ -class ConvertCustomButtonToClasses < ActiveRecord::Migration[5.0] - class CustomButton < ActiveRecord::Base - serialize :options - end - - class MiqSet < ActiveRecord::Base - serialize :set_data - end - - def up - say_with_time("Convert old style custom button icons to fonticon classes + hex colors") do - CustomButton.select(:id, :options).each do |button| - next unless button.options[:button_image] - button.options.merge!(convert_up(button.options)) - button.options.delete(:button_image) - button.save - end - end - - say_with_time("Convert old style custom button set icons to fonticon classes + hex colors") do - MiqSet.select(:id, :set_data).where(:set_type => 'CustomButtonSet').each do |button| - next unless button.set_data[:button_image] - button.set_data.merge!(convert_up(button.set_data)) - button.set_data.delete(:button_image) - button.save - end - end - end - - def down - say_with_time("Convert fonticon classes in custom buttons back to old style") do - CustomButton.select(:id, :options).each do |button| - button.options.delete(:button_color) - next unless button.options[:button_icon] - button.options[:button_image] = convert_down(button.options) - button.options.delete(:button_icon) - button.save - end - end - - say_with_time("Convert fonticon classes in custom button sets back to old style") do - MiqSet.select(:id, :set_data).where(:set_type => 'CustomButtonSet').each do |button| - button.set_data.delete(:button_color) - next unless button.set_data[:button_icon] - button.set_data[:button_image] = convert_down(button.set_data) - button.set_data.delete(:button_icon) - button.save - end - end - end - - private - - def convert_up(btn) - icon = {} - - case btn[:button_image] - when 1 - icon[:button_icon] = 'ff ff-hexagon' - icon[:button_color] = '#2d7623' - when 2 - icon[:button_icon] = 'ff ff-wavy-lines' - icon[:button_color] = '#00659c' - when 3 - icon[:button_icon] = 'ff ff-diamond' - icon[:button_color] = '#f5c12e' - when 4 - icon[:button_icon] = 'fa fa-star' - icon[:button_color] = '#2d7623' - when 5 - icon[:button_icon] = 'fa fa-circle' - icon[:button_color] = '#ec7a08' - when 6 - icon[:button_icon] = 'ff ff-database-squeezed' - when 7 - icon[:button_icon] = 'ff ff-broom' - when 8 - icon[:button_icon] = 'ff ff-triangle' - icon[:button_color] = '#cc0000' - when 9 - icon[:button_icon] = 'fa fa-angle-double-down' - icon[:button_color] = '#00659c' - when 10 - icon[:button_icon] = 'fa fa-angle-double-up' - icon[:button_color] = '#00659c' - when 11 - icon[:button_icon] = 'fa fa-angle-double-left' - icon[:button_color] = '#00659c' - when 12 - icon[:button_icon] = 'fa fa-angle-double-right' - icon[:button_color] = '#00659c' - when 13 - icon[:button_icon] = 'ff ff-synchronize' - icon[:button_color] = '#00659c' - when 14 - icon[:button_icon] = 'fa fa-refresh' - icon[:button_color] = '#2d7623' - when 15 - icon[:button_icon] = 'fa fa-power-off' - icon[:button_color] = '#cc0000' - else - icon[:button_icon] = 'ff ff-hexagon' - end - - icon - end - - def convert_down(btn) - case btn[:button_icon] - when 'ff ff-hexagon' - 1 - when 'ff ff-wavy-lines' - 2 - when 'ff ff-diamond' - 3 - when 'fa fa-star' - 4 - when 'fa fa-circle' - 5 - when 'ff ff-database-squeezed' - 6 - when 'ff ff-broom' - 7 - when 'ff ff-triangle' - 8 - when 'fa fa-angle-double-down' - 9 - when 'fa fa-angle-double-up' - 10 - when 'fa fa-angle-double-left' - 11 - when 'fa fa-angle-double-right' - 12 - when 'ff ff-synchronize' - 13 - when 'fa fa-refresh' - 14 - when 'fa fa-power-off' - 15 - else - 1 - end - end -end diff --git a/db/migrate/20170713083836_rename_applies_to_visibility_expression.rb b/db/migrate/20170713083836_rename_applies_to_visibility_expression.rb deleted file mode 100644 index 75155f2df..000000000 --- a/db/migrate/20170713083836_rename_applies_to_visibility_expression.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RenameAppliesToVisibilityExpression < ActiveRecord::Migration[5.0] - def change - rename_column :custom_buttons, :applies_to_exp, :visibility_expression - end -end diff --git a/db/migrate/20170713085859_add_enablement_expression_and_disabled_text.rb b/db/migrate/20170713085859_add_enablement_expression_and_disabled_text.rb deleted file mode 100644 index 4a7334f7b..000000000 --- a/db/migrate/20170713085859_add_enablement_expression_and_disabled_text.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddEnablementExpressionAndDisabledText < ActiveRecord::Migration[5.0] - def change - add_column :custom_buttons, :enablement_expression, :text - add_column :custom_buttons, :disabled_text, :text - end -end diff --git a/db/migrate/20170713144355_create_dialog_field_associations_table.rb b/db/migrate/20170713144355_create_dialog_field_associations_table.rb deleted file mode 100644 index 0e09c4d8b..000000000 --- a/db/migrate/20170713144355_create_dialog_field_associations_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateDialogFieldAssociationsTable < ActiveRecord::Migration[5.0] - def change - create_table :dialog_field_associations do |t| - t.bigint :trigger_id - t.bigint :respond_id - end - end -end diff --git a/db/migrate/20170717084208_add_resource_to_open_scap_result.rb b/db/migrate/20170717084208_add_resource_to_open_scap_result.rb deleted file mode 100644 index 19b1bea9a..000000000 --- a/db/migrate/20170717084208_add_resource_to_open_scap_result.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddResourceToOpenScapResult < ActiveRecord::Migration[5.0] - def change - add_column :openscap_results, :resource_id, :bigint - add_column :openscap_results, :resource_type, :string - end -end diff --git a/db/migrate/20170718111834_unify_container_definition_and_container.rb b/db/migrate/20170718111834_unify_container_definition_and_container.rb deleted file mode 100644 index 83e1a82be..000000000 --- a/db/migrate/20170718111834_unify_container_definition_and_container.rb +++ /dev/null @@ -1,186 +0,0 @@ -class UnifyContainerDefinitionAndContainer < ActiveRecord::Migration[5.0] - class ContainerDefinition < ActiveRecord::Base - has_many :container_port_configs, :class_name => 'UnifyContainerDefinitionAndContainer::ContainerPortConfig' - has_many :container_env_vars, :class_name => 'UnifyContainerDefinitionAndContainer::ContainerEnvVar' - has_one :security_context, :as => :resource - has_one :container, :class_name => 'UnifyContainerDefinitionAndContainer::Container' - end - - class Container < ActiveRecord::Base - self.inheritance_column = :_type_disabled - belongs_to :container_definition, :class_name => 'UnifyContainerDefinitionAndContainer::ContainerDefinition' - end - - class SecurityContext < ActiveRecord::Base - self.inheritance_column = :_type_disabled - belongs_to :resource, :polymorphic => true - end - - class ContainerEnvVar < ActiveRecord::Base - belongs_to :container_definition, :class_name => 'UnifyContainerDefinitionAndContainer::ContainerDefinition' - end - - class ContainerPortConfig < ActiveRecord::Base - belongs_to :container_definition, :class_name => 'UnifyContainerDefinitionAndContainer::ContainerDefinition' - end - - class MiqQueue < ActiveRecord::Base - end - - def up - # attributes - add_column :containers, :image, :string - add_column :containers, :image_pull_policy, :string - add_column :containers, :memory, :string - add_column :containers, :cpu_cores, :float - add_column :containers, :container_group_id, :bigint - add_column :containers, :privileged, :boolean - add_column :containers, :run_as_user, :bigint - add_column :containers, :run_as_non_root, :boolean - add_column :containers, :capabilities_add, :string - add_column :containers, :capabilities_drop, :string - add_column :containers, :command, :text - - say_with_time("Copying over columns from container_definition to container") do - %w(image image_pull_policy memory cpu_cores container_group_id privileged - run_as_user run_as_non_root capabilities_add capabilities_drop command).each do |column| - connection.execute <<-SQL - UPDATE containers SET #{column} = subquery.#{column} - FROM (SELECT id, #{column} FROM container_definitions) AS subquery - WHERE subquery.id = containers.container_definition_id - SQL - end - end - - subquery_containers = <<-SQL - SELECT id, container_definition_id FROM containers - SQL - - say_with_time("switch container_definition_id with container_id for container_port_configs") do - connection.execute <<-SQL - UPDATE container_port_configs - SET container_definition_id = subquery.id - FROM (#{subquery_containers}) AS subquery - WHERE subquery.container_definition_id = container_port_configs.container_definition_id - SQL - end - - say_with_time("switch container_definition_id with container_id for container_port_configs") do - connection.execute <<-SQL - UPDATE container_env_vars SET container_definition_id = subquery.id - FROM (#{subquery_containers}) AS subquery - WHERE subquery.container_definition_id = container_env_vars.container_definition_id - SQL - end - - say_with_time("switch resource_id with container_id, resource_type to 'Container' for security_contexts") do - container_value = connection.quote('Container') - container_definition_value = connection.quote('ContainerDefinition') - - connection.execute <<-SQL - UPDATE security_contexts - SET resource_type = #{container_value}, resource_id = subquery.id - FROM (#{subquery_containers}) AS subquery - WHERE subquery.container_definition_id = security_contexts.resource_id AND security_contexts.resource_type = #{container_definition_value} - SQL - end - - MiqQueue.where(:method_name => "purge_timer", :class_name => 'ContainerDefinition').destroy_all - - # relationships - rename_column :container_port_configs, :container_definition_id, :container_id - rename_column :container_env_vars, :container_definition_id, :container_id - - remove_column :containers, :container_definition_id - drop_table :container_definitions - end - - def down - create_table :container_definitions do |t| - t.belongs_to :ems, :type => :bigint # reconstructed columns - t.string :ems_ref - t.bigint :old_ems_id - t.timestamp :deleted_on - t.string :name - t.string :image # copied over columns - t.string :image_pull_policy - t.string :memory - t.float :cpu_cores - t.belongs_to :container_group, :type => :bigint - t.boolean :privileged - t.bigint :run_as_user - t.boolean :run_as_non_root - t.string :capabilities_add - t.string :capabilities_drop - t.text :command - t.bigint :container_id # temp column - end - - add_index :container_definitions, :deleted_on - - add_column :containers, :container_definition_id, :bigint - - say_with_time("populate container_definitions. use container_id to keep relation to containers") do - insert_statement = "INSERT INTO container_definitions (container_id, ems_id, ems_ref, old_ems_id, deleted_on, name, image, - image_pull_policy, memory, cpu_cores, container_group_id, - privileged, run_as_user, run_as_non_root, capabilities_add, - capabilities_drop, command) - SELECT id, ems_id, ems_ref, old_ems_id, deleted_on, name, image, image_pull_policy, memory, cpu_cores, - container_group_id, privileged, run_as_user, run_as_non_root, capabilities_add, - capabilities_drop, command - FROM containers" - ActiveRecord::Base.connection.execute(insert_statement) - end - - say_with_time("use container_id to join tables and update container_definition_id in containers") do - update_statement = "UPDATE containers - SET container_definition_id = (SELECT container_definitions.id - FROM container_definitions - WHERE containers.id = container_definitions.container_id)" - ActiveRecord::Base.connection.execute(update_statement) - end - - # finally, remove the temp column - remove_column :container_definitions, :container_id - - containers = Arel::Table.new(:containers) - say_with_time("switch container_definition_id with container_id for container_port_configs") do - port_configs = Arel::Table.new(:container_port_configs) - join_sql = containers.project(containers[:container_definition_id]) - .where(containers[:id].eq(port_configs[:container_id])).to_sql - ContainerPortConfig.update_all("container_id = (#{join_sql})") - end - - say_with_time("switch container_definition_id with container_id for for container_env_vars") do - env_vars = Arel::Table.new(:container_env_vars) - join_sql = containers.project(containers[:container_definition_id]) - .where(containers[:id].eq(env_vars[:container_id])).to_sql - ContainerEnvVar.update_all("container_id = (#{join_sql})") - end - - say_with_time("swtich resource_id with container_id, resource_type to 'Container' for security_contexts") do - security_contexts = Arel::Table.new(:security_contexts) - join_sql = containers.project(containers[:container_definition_id]) - .where(containers[:id].eq(security_contexts[:resource_id]) - .and(security_contexts[:resource_type].eq(Arel::Nodes::Quoted.new('Container')))).to_sql - SecurityContext.where(:resource_type => 'Container').update_all("resource_type = 'ContainerDefinition', resource_id = (#{join_sql})") - end - - # relationships - rename_column :container_port_configs, :container_id, :container_definition_id - rename_column :container_env_vars, :container_id, :container_definition_id - - # attributes - remove_column :containers, :image - remove_column :containers, :image_pull_policy - remove_column :containers, :memory - remove_column :containers, :cpu_cores - remove_column :containers, :container_group_id - remove_column :containers, :privileged - remove_column :containers, :run_as_user - remove_column :containers, :run_as_non_root - remove_column :containers, :capabilities_add - remove_column :containers, :capabilities_drop - remove_column :containers, :command - end -end diff --git a/db/migrate/20170720194715_create_middleware_diagnostic_reports.rb b/db/migrate/20170720194715_create_middleware_diagnostic_reports.rb deleted file mode 100644 index d72408003..000000000 --- a/db/migrate/20170720194715_create_middleware_diagnostic_reports.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateMiddlewareDiagnosticReports < ActiveRecord::Migration[5.0] - def change - create_table :middleware_diagnostic_reports do |t| - t.datetime :queued_at - t.string :requesting_user - t.string :status - t.string :error_message - t.references(:middleware_server, :type => :bigint) - t.timestamps - end - end -end diff --git a/db/migrate/20170728223124_add_expression_to_entitlements.rb b/db/migrate/20170728223124_add_expression_to_entitlements.rb deleted file mode 100644 index 60f8dfc24..000000000 --- a/db/migrate/20170728223124_add_expression_to_entitlements.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddExpressionToEntitlements < ActiveRecord::Migration[5.0] - def change - add_column :entitlements, :filter_expression, :text - end -end diff --git a/db/migrate/20170804184133_create_automate_workspaces.rb b/db/migrate/20170804184133_create_automate_workspaces.rb deleted file mode 100644 index 9ac5fc14d..000000000 --- a/db/migrate/20170804184133_create_automate_workspaces.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateAutomateWorkspaces < ActiveRecord::Migration[5.0] - def change - create_table :automate_workspaces do |t| - t.string :guid - t.bigint :user_id - t.bigint :tenant_id - t.jsonb :output - t.jsonb :input - end - end -end diff --git a/db/migrate/20170809191203_metrics_sequences.rb b/db/migrate/20170809191203_metrics_sequences.rb deleted file mode 100644 index b7dcfea8e..000000000 --- a/db/migrate/20170809191203_metrics_sequences.rb +++ /dev/null @@ -1,29 +0,0 @@ -class MetricsSequences < ActiveRecord::Migration[5.0] - include MigrationHelper - def up - change_sequences("metrics", 0..23, false) - change_sequences("metric_rollups", 1..12, false) - end - - def down - change_sequences("metrics", 0..23, true) - change_sequences("metric_rollups", 1..12, true) - end - - # @param table_name [String] base table name to inherit from - # @param range [Range] range of subtables - # @param unique [Boolean] true if each table gets a unique sequence, - # false if they use the base table's sequence - def change_sequences(table_name, range, unique = true) - range.each do |n| - s = subtable_name(table_name, n) - execute("CREATE SEQUENCE #{s}_id_seq") if unique - change_column_default(s, :id, -> { "nextval('#{unique ? s : table_name}_id_seq')" }) - execute("DROP SEQUENCE #{s}_id_seq") unless unique - end - end - - def subtable_name(inherit_from, index) - "#{inherit_from}_#{index.to_s.rjust(2, '0')}" - end -end diff --git a/db/migrate/20170821085511_update_type_of_orchestration_template.rb b/db/migrate/20170821085511_update_type_of_orchestration_template.rb deleted file mode 100644 index a2803ab6c..000000000 --- a/db/migrate/20170821085511_update_type_of_orchestration_template.rb +++ /dev/null @@ -1,45 +0,0 @@ -class UpdateTypeOfOrchestrationTemplate < ActiveRecord::Migration[5.0] - class OrchestrationTemplate < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - say_with_time("Updating type column for OrchestrationTemplate") do - OrchestrationTemplate - .where(:type => 'OrchestrationTemplateCfn') - .update_all(:type => 'ManageIQ::Providers::Amazon::CloudManager::OrchestrationTemplate') - - OrchestrationTemplate - .where(:type => 'OrchestrationTemplateHot') - .update_all(:type => 'ManageIQ::Providers::Openstack::CloudManager::OrchestrationTemplate') - - OrchestrationTemplate - .where(:type => 'OrchestrationTemplateVnfd') - .update_all(:type => 'ManageIQ::Providers::Openstack::CloudManager::VnfdTemplate') - - OrchestrationTemplate - .where(:type => 'OrchestrationTemplateAzure') - .update_all(:type => 'ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate') - end - end - - def down - say_with_time("Reverting type column for OrchestrationTemplate") do - OrchestrationTemplate - .where(:type => 'ManageIQ::Providers::Amazon::CloudManager::OrchestrationTemplate') - .update_all(:type => 'OrchestrationTemplateCfn') - - OrchestrationTemplate - .where(:type => 'ManageIQ::Providers::Openstack::CloudManager::OrchestrationTemplate') - .update_all(:type => 'OrchestrationTemplateHot') - - OrchestrationTemplate - .where(:type => 'ManageIQ::Providers::Openstack::CloudManager::VnfdTemplate') - .update_all(:type => 'OrchestrationTemplateVnfd') - - OrchestrationTemplate - .where(:type => 'ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate') - .update_all(:type => 'OrchestrationTemplateAzure') - end - end -end diff --git a/db/migrate/20170827091406_change_container_quota_items_columns_to_float.rb b/db/migrate/20170827091406_change_container_quota_items_columns_to_float.rb deleted file mode 100644 index 56354e864..000000000 --- a/db/migrate/20170827091406_change_container_quota_items_columns_to_float.rb +++ /dev/null @@ -1,64 +0,0 @@ -class ChangeContainerQuotaItemsColumnsToFloat < ActiveRecord::Migration[5.0] - class ContainerQuotaItem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - def up - add_column :container_quota_items, :quota_desired_float, :float - add_column :container_quota_items, :quota_enforced_float, :float - add_column :container_quota_items, :quota_observed_float, :float - - ContainerQuotaItem.find_each do |item| - item.quota_desired_float = numeric_quantity(item.quota_desired) - item.quota_enforced_float = numeric_quantity(item.quota_enforced) - item.quota_observed_float = numeric_quantity(item.quota_observed) - item.save - end - - remove_column :container_quota_items, :quota_desired - remove_column :container_quota_items, :quota_enforced - remove_column :container_quota_items, :quota_observed - - rename_column :container_quota_items, :quota_desired_float, :quota_desired - rename_column :container_quota_items, :quota_enforced_float, :quota_enforced - rename_column :container_quota_items, :quota_observed_float, :quota_observed - end - - def down - add_column :container_quota_items, :quota_desired_string, :string - add_column :container_quota_items, :quota_enforced_string, :string - add_column :container_quota_items, :quota_observed_string, :string - - ContainerQuotaItem.find_each do |item| - item.quota_desired_string = string_quantity(item.quota_desired) - item.quota_enforced_string = string_quantity(item.quota_enforced) - item.quota_observed_string = string_quantity(item.quota_observed) - item.save - end - - remove_column :container_quota_items, :quota_desired - remove_column :container_quota_items, :quota_enforced - remove_column :container_quota_items, :quota_observed - - rename_column :container_quota_items, :quota_desired_string, :quota_desired - rename_column :container_quota_items, :quota_enforced_string, :quota_enforced - rename_column :container_quota_items, :quota_observed_string, :quota_observed - end - - def numeric_quantity(resource) # parse a string with a suffix into a int\float - return nil if resource.nil? - - begin - resource.iec_60027_2_to_i - rescue - resource.decimal_si_to_f - end - end - - def string_quantity(resource) - return nil if resource.nil? - - val = resource == resource.to_i ? resource.to_i : resource - val.to_s - end -end diff --git a/db/migrate/20170829220132_migrate_database_role_in_settings.rb b/db/migrate/20170829220132_migrate_database_role_in_settings.rb deleted file mode 100644 index 1933bfbff..000000000 --- a/db/migrate/20170829220132_migrate_database_role_in_settings.rb +++ /dev/null @@ -1,16 +0,0 @@ -class MigrateDatabaseRoleInSettings < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - end - - def up - say_with_time("Convert old 'database' role to 'database_operations'") do - SettingsChange.where(:key => "/server/role").each do |s| - s.value.gsub!(/\bdatabase\b/, 'database_operations') - s.save! - end - end - end - - # No down migration, because there was a runtime migration at server - # startup that would have corrected this anyway. -end diff --git a/db/migrate/20170904130801_add_project_id_to_persistent_volume_claims.rb b/db/migrate/20170904130801_add_project_id_to_persistent_volume_claims.rb deleted file mode 100644 index b5999c18d..000000000 --- a/db/migrate/20170904130801_add_project_id_to_persistent_volume_claims.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddProjectIdToPersistentVolumeClaims < ActiveRecord::Migration[5.0] - def change - add_column :persistent_volume_claims, :container_project_id, :bigint - end -end diff --git a/db/migrate/20170905210626_create_configuration_templates.rb b/db/migrate/20170905210626_create_configuration_templates.rb deleted file mode 100644 index b6c016704..000000000 --- a/db/migrate/20170905210626_create_configuration_templates.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateConfigurationTemplates < ActiveRecord::Migration[5.0] - def change - create_table :configuration_templates do |t| - t.bigint :ems_id - t.string :ems_ref - t.string :name - t.string :description - t.boolean :user_defined - t.boolean :in_use - end - end -end diff --git a/db/migrate/20170908130834_add_serial_number_to_hardware.rb b/db/migrate/20170908130834_add_serial_number_to_hardware.rb deleted file mode 100644 index c87cbf561..000000000 --- a/db/migrate/20170908130834_add_serial_number_to_hardware.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSerialNumberToHardware < ActiveRecord::Migration[5.0] - def change - add_column :hardwares, :serial_number, :string - end -end diff --git a/db/migrate/20170914082040_showback_tiers.rb b/db/migrate/20170914082040_showback_tiers.rb deleted file mode 100644 index ea740fc83..000000000 --- a/db/migrate/20170914082040_showback_tiers.rb +++ /dev/null @@ -1,63 +0,0 @@ -class ShowbackTiers < ActiveRecord::Migration[5.0] - def up - create_table :showback_tiers do |t| - t.bigint :tier_start_value - t.bigint :tier_end_value - t.bigint :fixed_rate_subunits # Columns needed by gem money - t.string :fixed_rate_currency - t.string :fixed_rate_per_time - t.bigint :variable_rate_subunits # Columns needed by gem money - t.string :variable_rate_currency - t.string :variable_rate_per_unit - t.string :variable_rate_per_time - t.float :step_value - t.string :step_time_unit - t.float :step_time_value - t.string :step_unit - - t.belongs_to :showback_rates, :type => :bigint - end - - remove_column :showback_rates, :fixed_rate_subunits # Columns needed by gem money - remove_column :showback_rates, :fixed_rate_currency - - remove_column :showback_rates, :variable_rate_subunits # Columns needed by gem money - remove_column :showback_rates, :variable_rate_currency - remove_column :showback_rates, :variable_rate_per_unit - remove_column :showback_rates, :variable_rate_per_time - - remove_column :showback_rates, :step_value - remove_column :showback_rates, :step_time_unit - remove_column :showback_rates, :step_time_value - remove_column :showback_rates, :step_unit - - add_column :showback_rates, :uses_single_tier, :boolean - add_column :showback_rates, :tiers_use_full_value, :boolean - - rename_column :showback_rates, :fixed_rate_per_time, :step_variable - rename_column :showback_rates, :fixed_rate_per_unit, :measure - end - - def down - drop_table :showback_tiers - - add_column :showback_rates, :fixed_rate_subunits, :bigint - add_column :showback_rates, :fixed_rate_currency, :string - - add_column :showback_rates, :variable_rate_subunits, :bigint - add_column :showback_rates, :variable_rate_currency, :string - add_column :showback_rates, :variable_rate_per_unit, :string - add_column :showback_rates, :variable_rate_per_time, :string - - add_column :showback_rates, :step_value, :float - add_column :showback_rates, :step_time_unit, :string - add_column :showback_rates, :step_time_value, :float - add_column :showback_rates, :step_unit, :string - - remove_column :showback_rates, :uses_single_tier - remove_column :showback_rates, :tiers_use_full_value - - rename_column :showback_rates, :step_variable, :fixed_rate_per_time - rename_column :showback_rates, :measure, :fixed_rate_per_unit - end -end diff --git a/db/migrate/20170918190738_issue_showback_tiers.rb b/db/migrate/20170918190738_issue_showback_tiers.rb deleted file mode 100644 index ee10c0e5f..000000000 --- a/db/migrate/20170918190738_issue_showback_tiers.rb +++ /dev/null @@ -1,13 +0,0 @@ -class IssueShowbackTiers < ActiveRecord::Migration[5.0] - def up - rename_column :showback_tiers, :showback_rates_id, :showback_rate_id - change_column :showback_tiers, :tier_start_value, :float - change_column :showback_tiers, :tier_end_value, :float - end - - def down - rename_column :showback_tiers, :showback_rate_id, :showback_rates_id - change_column :showback_tiers, :tier_start_value, :bigint - change_column :showback_tiers, :tier_end_value, :bigint - end -end diff --git a/db/migrate/20170919211256_add_parent_id_to_lans.rb b/db/migrate/20170919211256_add_parent_id_to_lans.rb deleted file mode 100644 index d2e09b0c6..000000000 --- a/db/migrate/20170919211256_add_parent_id_to_lans.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddParentIdToLans < ActiveRecord::Migration[5.0] - def change - add_column :lans, :parent_id, :bigint - end -end diff --git a/db/migrate/20170919211745_create_subnets.rb b/db/migrate/20170919211745_create_subnets.rb deleted file mode 100644 index 911f9695d..000000000 --- a/db/migrate/20170919211745_create_subnets.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateSubnets < ActiveRecord::Migration[5.0] - def change - create_table :subnets do |t| - t.string :ems_ref - t.string :name - t.string :cidr - t.string :type - t.bigint :lan_id - end - end -end diff --git a/db/migrate/20170920212535_add_event_id_to_event_streams.rb b/db/migrate/20170920212535_add_event_id_to_event_streams.rb deleted file mode 100644 index adb67fcdd..000000000 --- a/db/migrate/20170920212535_add_event_id_to_event_streams.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddEventIdToEventStreams < ActiveRecord::Migration[5.0] - def change - add_column :event_streams, :ems_ref, :string - end -end diff --git a/db/migrate/20170922162503_change_dialog_field_description_from_string_to_text.rb b/db/migrate/20170922162503_change_dialog_field_description_from_string_to_text.rb deleted file mode 100644 index a853ad412..000000000 --- a/db/migrate/20170922162503_change_dialog_field_description_from_string_to_text.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ChangeDialogFieldDescriptionFromStringToText < ActiveRecord::Migration[5.0] - def up - change_column :dialog_fields, :description, :text - end - - def down - change_column :dialog_fields, :description, :string - end -end diff --git a/db/migrate/20170922172113_rename_provisioning_manager_id_to_manager_id_in_customization_scripts.rb b/db/migrate/20170922172113_rename_provisioning_manager_id_to_manager_id_in_customization_scripts.rb deleted file mode 100644 index 8ac3f77ed..000000000 --- a/db/migrate/20170922172113_rename_provisioning_manager_id_to_manager_id_in_customization_scripts.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RenameProvisioningManagerIdToManagerIdInCustomizationScripts < ActiveRecord::Migration[5.0] - def change - rename_column :customization_scripts, :provisioning_manager_id, :manager_id - end -end diff --git a/db/migrate/20170922205258_add_config_pattern_fields_to_customization_scripts.rb b/db/migrate/20170922205258_add_config_pattern_fields_to_customization_scripts.rb deleted file mode 100644 index 4c5b797d7..000000000 --- a/db/migrate/20170922205258_add_config_pattern_fields_to_customization_scripts.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddConfigPatternFieldsToCustomizationScripts < ActiveRecord::Migration[5.0] - def change - add_column :customization_scripts, :description, :string - add_column :customization_scripts, :user_defined, :boolean - add_column :customization_scripts, :in_use, :boolean - end -end diff --git a/db/migrate/20170922212510_add_severity_to_miq_alerts.rb b/db/migrate/20170922212510_add_severity_to_miq_alerts.rb deleted file mode 100644 index e515e3bd6..000000000 --- a/db/migrate/20170922212510_add_severity_to_miq_alerts.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSeverityToMiqAlerts < ActiveRecord::Migration[5.0] - def change - add_column :miq_alerts, :severity, :string - end -end diff --git a/db/migrate/20170924102942_add_requests_and_limits_to_persistent_volume_claims.rb b/db/migrate/20170924102942_add_requests_and_limits_to_persistent_volume_claims.rb deleted file mode 100644 index e8bc70926..000000000 --- a/db/migrate/20170924102942_add_requests_and_limits_to_persistent_volume_claims.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddRequestsAndLimitsToPersistentVolumeClaims < ActiveRecord::Migration[5.0] - def change - add_column :persistent_volume_claims, :requests, :text - add_column :persistent_volume_claims, :limits, :text - end -end diff --git a/db/migrate/20170925155201_create_scan_result.rb b/db/migrate/20170925155201_create_scan_result.rb deleted file mode 100644 index cd327e5d5..000000000 --- a/db/migrate/20170925155201_create_scan_result.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateScanResult < ActiveRecord::Migration[5.0] - def change - create_table :scan_results do |t| - t.string :scan_status - t.string :scan_result_message - t.string :scan_type - t.belongs_to :resource, :polymorphic => true, :type => :bigint - end - end -end diff --git a/db/migrate/20170927114802_drop_container_component_statuses.rb b/db/migrate/20170927114802_drop_container_component_statuses.rb deleted file mode 100644 index e8175f064..000000000 --- a/db/migrate/20170927114802_drop_container_component_statuses.rb +++ /dev/null @@ -1,16 +0,0 @@ -class DropContainerComponentStatuses < ActiveRecord::Migration[5.0] - def up - drop_table :container_component_statuses - end - - def down - create_table :container_component_statuses do |t| - t.belongs_to :ems, :type => :bigint - t.string :name - t.string :condition - t.string :status - t.string :message - t.string :error - end - end -end diff --git a/db/migrate/20170927135007_migrate_dialog_field_associations_to_use_new_relationship.rb b/db/migrate/20170927135007_migrate_dialog_field_associations_to_use_new_relationship.rb deleted file mode 100644 index 137cf906b..000000000 --- a/db/migrate/20170927135007_migrate_dialog_field_associations_to_use_new_relationship.rb +++ /dev/null @@ -1,76 +0,0 @@ -class MigrateDialogFieldAssociationsToUseNewRelationship < ActiveRecord::Migration[5.0] - class Dialog < ActiveRecord::Base - end - - class DialogTab < ActiveRecord::Base - belongs_to :dialog, :class_name => "MigrateDialogFieldAssociationsToUseNewRelationship::Dialog" - end - - class DialogGroup < ActiveRecord::Base - belongs_to :dialog_tab, :class_name => "MigrateDialogFieldAssociationsToUseNewRelationship::DialogTab" - end - - class DialogField < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - belongs_to :dialog_group, :class_name => "MigrateDialogFieldAssociationsToUseNewRelationship::DialogGroup" - end - - class DialogFieldAssociation < ActiveRecord::Base - end - - def up - say_with_time("Migrating existing dialog field associations to new relationship") do - dialog_with_fields.each do |_dialog, fields| - dialog_triggers = dialog_fields_with_trigger_auto_refresh(fields).sort_by! { |trigger| trigger[:position] } - dialog_responders = dialog_fields_with_auto_refresh(fields) - dialog_triggers.each_with_index do |trigger, index| - specific_responders = dialog_responders.select { |responder| responder_range(trigger, trigger[index + 1]).cover?(responder[:position]) } - set_associations(trigger, specific_responders) - end - end - end - end - - def down - DialogFieldAssociation.delete_all - end - - private - - def absolute_position(dialog_fields) - dialog_fields.collect do |f| - field_position = f.position - dialog_group_position = f.dialog_group.position - dialog_tab_position = f.dialog_group.dialog_tab.position - index = field_position + dialog_group_position * 1000 + dialog_tab_position * 100_000 - {:id => f.id, :position => index} - end - end - - def dialog_fields_with_auto_refresh(dialog_fields) - absolute_position(dialog_fields.select(&:auto_refresh)) - end - - def dialog_fields_with_trigger_auto_refresh(dialog_fields) - absolute_position(dialog_fields.select(&:trigger_auto_refresh)) - end - - def responder_range(trigger_min, trigger_max) - min = trigger_min[:position] + 1 - max = trigger_max.present? ? trigger_max[:position] - 1 : 100_000_000 - (min..max) - end - - def set_associations(trigger, specific_responders) - specific_responders.each { |responder| DialogFieldAssociation.create!(:trigger_id => trigger[:id], :respond_id => responder[:id]) } - end - - def dialog_with_fields - DialogField - .where(:auto_refresh => true) - .or(DialogField.where(:trigger_auto_refresh => true)) - .includes(:dialog_group => {:dialog_tab => :dialog}) - .group_by { |f| f.dialog_group.try(:dialog_tab).try(:dialog) } - .except(nil) - end -end diff --git a/db/migrate/20170928202851_migrate_middleware_server_to_wildfly_and_eap.rb b/db/migrate/20170928202851_migrate_middleware_server_to_wildfly_and_eap.rb deleted file mode 100644 index 91f0d6e45..000000000 --- a/db/migrate/20170928202851_migrate_middleware_server_to_wildfly_and_eap.rb +++ /dev/null @@ -1,34 +0,0 @@ -class MigrateMiddlewareServerToWildflyAndEap < ActiveRecord::Migration[5.0] - class MiddlewareServer < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - say_with_time('Migrating middleware_server to middleware_server_wildfly') do - MiddlewareServer - .where("type = ? AND product ~* ?", 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer', 'wildfly') - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerWildfly') - end - - say_with_time('Migrating middleware_server to middleware_server_eap') do - MiddlewareServer - .where("type = ? AND product ~* ?", 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer', 'eap') - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerEap') - end - end - - def down - say_with_time('Migrating middleware_server_wildfly to middleware_server') do - MiddlewareServer - .where(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerWildfly') - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer') - end - - say_with_time('Migrating middleware_server_eap to middleware_server') do - MiddlewareServer - .where(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerEap') - .update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer') - end - end - -end diff --git a/db/migrate/20171002181644_add_userid_groupid_tenantid_to_miq_queue.rb b/db/migrate/20171002181644_add_userid_groupid_tenantid_to_miq_queue.rb deleted file mode 100644 index 92db1c7be..000000000 --- a/db/migrate/20171002181644_add_userid_groupid_tenantid_to_miq_queue.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddUseridGroupidTenantidToMiqQueue < ActiveRecord::Migration[5.0] - def change - add_column :miq_queue, :user_id, :bigint - add_column :miq_queue, :group_id, :bigint - add_column :miq_queue, :tenant_id, :bigint - end -end diff --git a/db/migrate/20171003170751_add_middleware_domain_to_event_streams.rb b/db/migrate/20171003170751_add_middleware_domain_to_event_streams.rb deleted file mode 100644 index 853bbf8ed..000000000 --- a/db/migrate/20171003170751_add_middleware_domain_to_event_streams.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddMiddlewareDomainToEventStreams < ActiveRecord::Migration[5.0] - def change - add_column :event_streams, :middleware_domain_id, :bigint - add_column :event_streams, :middleware_domain_name, :string - end -end diff --git a/db/migrate/20171009173946_remove_configuration_templates_table.rb b/db/migrate/20171009173946_remove_configuration_templates_table.rb deleted file mode 100644 index 5b8a7deda..000000000 --- a/db/migrate/20171009173946_remove_configuration_templates_table.rb +++ /dev/null @@ -1,12 +0,0 @@ -class RemoveConfigurationTemplatesTable < ActiveRecord::Migration[5.0] - def change - drop_table :configuration_templates do |t| - t.bigint :ems_id - t.string :ems_ref - t.string :name - t.string :description - t.boolean :user_defined - t.boolean :in_use - end - end -end diff --git a/db/migrate/20171011180000_move_openstack_refresher_settings.rb b/db/migrate/20171011180000_move_openstack_refresher_settings.rb deleted file mode 100644 index 4b5acc06d..000000000 --- a/db/migrate/20171011180000_move_openstack_refresher_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -class MoveOpenstackRefresherSettings < ActiveRecord::Migration[5.0] - class SettingsChange < ActiveRecord::Base - end - - def up - say_with_time('Move Openstack provider refresher settings') do - SettingsChange.where(:key => '/ems/ems_openstack/refresh/inventory_object_refresh').update(:key => '/ems/ems_refresh/openstack/inventory_object_refresh') - SettingsChange.where(:key => '/ems/ems_openstack/refresh/heat/is_global_admin').update(:key => '/ems/ems_refresh/openstack/heat/is_global_admin') - SettingsChange.where(:key => '/ems/ems_openstack/refresh/is_admin').update(:key => '/ems/ems_refresh/openstack/is_admin') - SettingsChange.where(:key => '/ems/ems_openstack/refresh/event_targeted_refresh').update(:key => '/ems/ems_refresh/openstack/allow_targeted_refresh') - end - end -end diff --git a/db/migrate/20171013125651_add_sub_metric_to_chargeback_rate_detail.rb b/db/migrate/20171013125651_add_sub_metric_to_chargeback_rate_detail.rb deleted file mode 100644 index b277ba2e0..000000000 --- a/db/migrate/20171013125651_add_sub_metric_to_chargeback_rate_detail.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSubMetricToChargebackRateDetail < ActiveRecord::Migration[5.0] - def change - add_column :chargeback_rate_details, :sub_metric, :string - end -end diff --git a/db/migrate/20171016192352_add_user_to_event_stream.rb b/db/migrate/20171016192352_add_user_to_event_stream.rb deleted file mode 100644 index baf345a79..000000000 --- a/db/migrate/20171016192352_add_user_to_event_stream.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddUserToEventStream < ActiveRecord::Migration[5.0] - def change - add_column :event_streams, :user_id, :bigint - add_column :event_streams, :group_id, :bigint - add_column :event_streams, :tenant_id, :bigint - end -end diff --git a/db/migrate/20171018081206_showback_fix_and_rename.rb b/db/migrate/20171018081206_showback_fix_and_rename.rb deleted file mode 100644 index 1a7df8d93..000000000 --- a/db/migrate/20171018081206_showback_fix_and_rename.rb +++ /dev/null @@ -1,27 +0,0 @@ -class ShowbackFixAndRename < ActiveRecord::Migration[5.0] - def change - rename_table :showback_events, :showback_data_rollups - rename_table :showback_charges, :showback_data_views - rename_table :showback_pools, :showback_envelopes - rename_table :showback_usage_types, :showback_input_measures - - rename_column :showback_data_views, :showback_event_id, :showback_data_rollup_id - rename_column :showback_data_views, :showback_pool_id, :showback_envelope_id - - rename_column :showback_rates, :category, :entity - rename_column :showback_rates, :dimension, :field - rename_column :showback_rates, :measure, :group - rename_column :showback_rates, :step_variable, :tier_input_variable - rename_column :showback_rates, :date, :start_date - - rename_column :showback_input_measures, :category, :entity - rename_column :showback_input_measures, :dimensions, :fields - rename_column :showback_input_measures, :measure, :group - - rename_column :showback_data_views, :stored_data, :data_snapshot - - add_column :showback_data_views, :context_snapshot, :jsonb - add_column :showback_data_views, :start_time, :timestamp - add_column :showback_data_views, :end_time, :timestamp - end -end diff --git a/db/migrate/20171023170841_ensure_cloud_managers.rb b/db/migrate/20171023170841_ensure_cloud_managers.rb deleted file mode 100644 index c764789f0..000000000 --- a/db/migrate/20171023170841_ensure_cloud_managers.rb +++ /dev/null @@ -1,27 +0,0 @@ -class EnsureCloudManagers < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - - def ensure_managers - ensure_manager("#{name} Network Manager", "ManageIQ::Providers::Amazon::NetworkManager") - ensure_manager("#{name} EBS Storage Manager", "ManageIQ::Providers::Amazon::StorageManager::Ebs") - end - - def ensure_manager(manager_name, manager_type) - self.class.create_with( - :name => manager_name, - :zone_id => zone_id, - :provider_region => provider_region - ).find_or_create_by!( - :parent_ems_id => id, - :type => manager_type - ) - end - end - - def up - say_with_time("Ensuring other managers for all Amazon CloudManagers") do - ExtManagementSystem.where(:type => "ManageIQ::Providers::Amazon::CloudManager").each(&:ensure_managers) - end - end -end diff --git a/db/migrate/20171024144122_add_options_to_miq_ae_method.rb b/db/migrate/20171024144122_add_options_to_miq_ae_method.rb deleted file mode 100644 index 10444be0e..000000000 --- a/db/migrate/20171024144122_add_options_to_miq_ae_method.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddOptionsToMiqAeMethod < ActiveRecord::Migration[5.0] - def change - add_column :miq_ae_methods, :options, :text - end -end diff --git a/db/migrate/20171025122732_move_ems_refresh_args_to_data.rb b/db/migrate/20171025122732_move_ems_refresh_args_to_data.rb deleted file mode 100644 index 40dd150ba..000000000 --- a/db/migrate/20171025122732_move_ems_refresh_args_to_data.rb +++ /dev/null @@ -1,36 +0,0 @@ -class MoveEmsRefreshArgsToData < ActiveRecord::Migration[5.0] - class MiqQueue < ActiveRecord::Base - serialize :args, Array - end - - def up - say_with_time('Move MiqQueue refresh args to data') do - MiqQueue.where(:class_name => 'EmsRefresh', :method_name => 'refresh').each do |queue_item| - begin - targets = queue_item.args.first - data = Marshal.dump(targets) unless targets.nil? - - queue_item.update(:msg_data => data, :args => []) - rescue - # If Marshal.load fails we want to delete the queue item - queue_item.delete - end - end - end - end - - def down - say_with_time('Move MiqQueue refresh data to args') do - MiqQueue.where(:class_name => 'EmsRefresh', :method_name => 'refresh').each do |queue_item| - begin - args = queue_item.msg_data && Marshal.load(queue_item.msg_data) - - queue_item.update(:args => args, :msg_data => nil) - rescue - # If Marshal.load fails we want to delete the queue item - queue_item.delete - end - end - end - end -end diff --git a/db/migrate/20171026103833_add_cores_allocated_rate_detail.rb b/db/migrate/20171026103833_add_cores_allocated_rate_detail.rb deleted file mode 100644 index 597170255..000000000 --- a/db/migrate/20171026103833_add_cores_allocated_rate_detail.rb +++ /dev/null @@ -1,44 +0,0 @@ -class AddCoresAllocatedRateDetail < ActiveRecord::Migration[5.0] - class ChargebackRate < ActiveRecord::Base - has_many :chargeback_rate_details, :class_name => 'AddCoresAllocatedRateDetail::ChargebackRateDetail' - end - - class ChargebackTier < ActiveRecord::Base - FORM_ATTRIBUTES = %i(fixed_rate variable_rate start finish).freeze - end - - class ChargeableField < ActiveRecord::Base; end - - class ChargebackRateDetail < ActiveRecord::Base - belongs_to :chargeback_rate, :class_name => 'AddCoresAllocatedRateDetail::ChargebackRate' - belongs_to :chargeable_field - has_many :chargeback_tiers, :class_name => 'AddCoresAllocatedRateDetail::ChargebackTier' - end - - def up - rate_detail_template = ChargebackRateDetail.where(:description => "Allocated CPU Count").first - return if rate_detail_template.nil? # No rates that need this detail. - rate_detail_template = rate_detail_template.dup - - chargeable_field = ChargeableField.find_or_create_by(:metric => "derived_vm_numvcpu_cores", - :description => "Allocated CPU Cores", - :group => "cpu_cores", - :source => "allocated") - - rate_detail_template.chargeable_field = chargeable_field - rate_detail_template.description = "Allocated CPU Cores" - rate_detail_template.per_unit = "cpu core" - tier_template = {:start => 0, :finish => Float::INFINITY, :fixed_rate => 1.0, :variable_rate => 0.0} - - # Add to cb rates that do not have the "Allocated CPU Cores" cb detail - ChargebackRate.where(:rate_type => "Compute").where.not(:id => ChargebackRateDetail.where(:description => "Allocated CPU Cores").select(:chargeback_rate_id)).each do |rate| - new_rate_detail = rate_detail_template.dup - new_rate_detail.chargeback_tiers << ChargebackTier.new(tier_template.slice(*ChargebackTier::FORM_ATTRIBUTES)) - rate.chargeback_rate_details << new_rate_detail - end - end - - def down - ChargebackRateDetail.where(:description => "Allocated CPU Cores").destroy_all - end -end diff --git a/db/migrate/20171026114327_add_deleted_on_to_container_quota_and_items.rb b/db/migrate/20171026114327_add_deleted_on_to_container_quota_and_items.rb deleted file mode 100644 index c6cdc5f58..000000000 --- a/db/migrate/20171026114327_add_deleted_on_to_container_quota_and_items.rb +++ /dev/null @@ -1,35 +0,0 @@ -class AddDeletedOnToContainerQuotaAndItems < ActiveRecord::Migration[5.0] - class ContainerQuota < ActiveRecord::Base; end - class ContainerQuotaItem < ActiveRecord::Base - belongs_to :container_quota, :class_name => "AddDeletedOnToContainerQuotaAndItems::ContainerQuota" - end - - def change - add_column :container_quotas, :deleted_on, :datetime - add_index :container_quotas, :deleted_on - - add_timestamps :container_quota_items, :null => true # temporarily for backfilling, then disallow nulls - ContainerQuotaItem.reset_column_information - - reversible do |dir| - dir.up do - say_with_time("Backfilling container_quota_items timestamps from parent quotas") do - # All quota items SHOULD have a parent quota, which SHOULD have deleted_on - # but just in case, fallback to current time. - now = Time.zone.now - ContainerQuotaItem.includes(:container_quota).find_each do |item| - # This also sets updated_at to migration time. - item.update!(:created_at => item.container_quota.try(:created_on) || now) - end - end - end - # down: unnecessary, created_at/updated_at columns get deleted. - end - - change_column_null :container_quota_items, :created_at, false - change_column_null :container_quota_items, :updated_at, false - - add_column :container_quota_items, :deleted_on, :datetime - add_index :container_quota_items, :deleted_on - end -end diff --git a/db/migrate/20171026142653_create_container_quota_scopes.rb b/db/migrate/20171026142653_create_container_quota_scopes.rb deleted file mode 100644 index b80b9f811..000000000 --- a/db/migrate/20171026142653_create_container_quota_scopes.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateContainerQuotaScopes < ActiveRecord::Migration[5.0] - def change - create_table :container_quota_scopes do |t| - t.bigint :container_quota_id - t.string :scope - t.timestamps - t.datetime :deleted_on - end - end -end diff --git a/db/migrate/20171026152944_drop_blueprints.rb b/db/migrate/20171026152944_drop_blueprints.rb deleted file mode 100644 index e86be03f9..000000000 --- a/db/migrate/20171026152944_drop_blueprints.rb +++ /dev/null @@ -1,24 +0,0 @@ -class DropBlueprints < ActiveRecord::Migration[5.0] - def up - drop_table :blueprints - remove_column :dialogs, :blueprint_id, :bigint - remove_column :service_templates, :blueprint_id, :bigint - end - - def down - create_table :blueprints do |t| - t.string :name - t.string :description - t.string :status - t.string :version - t.jsonb :ui_properties - - t.timestamps - end - add_index :blueprints, :name - add_index :blueprints, :status - - add_column :dialogs, :blueprint_id, :bigint - add_column :service_templates, :blueprint_id, :bigint - end -end diff --git a/db/migrate/20171026190133_add_mtu_to_switches.rb b/db/migrate/20171026190133_add_mtu_to_switches.rb deleted file mode 100644 index 1cdf1716f..000000000 --- a/db/migrate/20171026190133_add_mtu_to_switches.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddMtuToSwitches < ActiveRecord::Migration[5.0] - def change - add_column :switches, :mtu, :integer - end -end diff --git a/db/migrate/20171030131403_fix_hawkular_endpoints_with_port_nil.rb b/db/migrate/20171030131403_fix_hawkular_endpoints_with_port_nil.rb deleted file mode 100644 index f8415ba7a..000000000 --- a/db/migrate/20171030131403_fix_hawkular_endpoints_with_port_nil.rb +++ /dev/null @@ -1,25 +0,0 @@ -class FixHawkularEndpointsWithPortNil < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - class Endpoint < ActiveRecord::Base - self.inheritance_column = :_type_disabled - end - - def up - container_hawkular_endpoints.where(:port => nil).update_all(:port => 443) - end - - def container_hawkular_endpoints - ems_container_ids = ExtManagementSystem.where( - :type => %w(ManageIQ::Providers::Openshift::ContainerManager ManageIQ::Providers::Kubernetes::ContainerManager) - ).pluck(:id) - - Endpoint.where( - :resource_type => 'ExtManagementSystem', - :resource_id => ems_container_ids, - :role => 'hawkular' - ) - end -end diff --git a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/broker_notify_properties.tmpl.yml b/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/broker_notify_properties.tmpl.yml deleted file mode 100644 index e1b40580d..000000000 --- a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/broker_notify_properties.tmpl.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -exclude: - HostSystem: - - config.consoleReservation - - config.dateTimeInfo - - config.network - - config.service - - summary - - summary.overallStatus - - summary.runtime.bootTime - - summary.runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo - VirtualMachine: - - config.locationId - - config.memoryAllocation.overheadLimit - - config.npivWorldWideNameType - - guest.disk - - guest.guestFamily - - guest.guestFullName - - guest.guestId - - guest.ipStack - - guest.net - - guest.screen - - guest.screen.height - - guest.screen.width - - guest.toolsRunningStatus - - guest.toolsStatus - - resourceConfig - - summary - - summary.guest.guestFullName - - summary.guest.guestId - - summary.guest.toolsRunningStatus - - summary.overallStatus - - summary.runtime.bootTime - - summary.runtime.memoryOverhead - - summary.runtime.numMksConnections - - summary.storage - - summary.storage.committed - - summary.storage.unshared diff --git a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/capacity.tmpl.yml b/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/capacity.tmpl.yml deleted file mode 100644 index 5f41d2514..000000000 --- a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/capacity.tmpl.yml +++ /dev/null @@ -1,17 +0,0 @@ -profile: - 1: - :vcpu_commitment_ratio: 2.0 - :vcpu_method: vcpu_average - :vcpu_method_description: "Average of Allocated vCPU" - :memory_commitment_ratio: 1.2 - :memory_method: mem_average - :memory_method_description: "Average of Allocated Memory" - 2: - :vcpu_commitment_ratio: 1.0 - :vcpu_method: vcpu_high_norm - :vcpu_method_description: "High Normal Range of Allocated vCPU" - :memory_commitment_ratio: 1.0 - :memory_method: mem_high_norm - :memory_method_description: "High Normal Range of Allocated Memory" -failover: - :rule: discovered \ No newline at end of file diff --git a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/event_handling.tmpl.yml b/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/event_handling.tmpl.yml deleted file mode 100644 index af3d04e57..000000000 --- a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/event_handling.tmpl.yml +++ /dev/null @@ -1,758 +0,0 @@ ---- -# -# The bottleneck_event_groups section defines the different groups that -# bottleneck events can fall under, for filtering and reporting purposes. -# See the event_groups section for details. -# -bottleneck_event_groups: - Capacity: - :detail: - - DiskUsage - :name: Capacity - Utilization: - :detail: - - CpuUsage - - MemoryUsage - :name: Utilization - -# -# The event_groups section defines the different groups that events can -# fall under, for filtering and reporting purposes. 'critical' events are -# meant to be shown at all times in reports, whereas 'detail' events can be -# left out of some reports for that category unless specified. -# -event_groups: - addition: - :critical: - - CloneTaskEvent - - ClusterCreatedEvent - - CreateFolder - - DatacenterCreatedEvent - - DatastoreDiscoveredEvent - - HostConnectedEvent - - HOST_DETECTED - - HOST_REGISTER_AUTO_APPROVE_PATTERN - - HOST_REGISTER_ERROR_UPDATING_HOST - - HOST_REGISTER_ERROR_UPDATING_HOST_ALL_TAKEN - - HOST_REGISTER_ERROR_UPDATING_NAME - - HOST_REGISTER_ERROR_UPDATING_NAMES_ALL_TAKEN - - HOST_REGISTER_EXISTING_HOST_UPDATE_FAILED - - HOST_REGISTER_FAILED - - HOST_REGISTER_HOST_IS_ACTIVE - - HOST_REGISTER_NAME_IS_ACTIVE - - HOST_REGISTER_SUCCEEDED - - IMPORTEXPORT_STARTING_EXPORT_TEMPLATE - - IMPORTEXPORT_EXPORT_TEMPLATE - - ResourcePoolCreatedEvent - - TemplateDeployedEvent - - USER_ADD - - USER_ADD_HOST - - USER_ADD_VM - - USER_ADD_VM_FINISHED_FAILURE - - USER_ADD_VM_FINISHED_SUCCESS - - USER_ADD_VM_TEMPLATE - - USER_ADD_VM_TEMPLATE_FINISHED_FAILURE - - USER_ADD_VM_TEMPLATE_FINISHED_SUCCESS - - USER_FAILED_ADD_HOST - - USER_FAILED_ADD_VM_TEMPLATE - - VmConnectedEvent - - VmCreatedEvent - - VmDeployedEvent - - VmRegisteredEvent - - image.update - - image.create - - image.upload - - orchestration.stack.create.end - - orchestration.stack.create.error - - servergroup.create - - REPLICATOR_SUCCESSFULCREATE - - REPLICATOR_FAILEDCREATE - - CONTAINER_CREATED - :detail: - - CloneVM_Task - - CloneVM_Task_Complete - - CreateClusterEx - - CreateClusterEx_Complete - - CreateDatacenter - - CreateDatacenter_Complete - - CreateResourcePool - - CreateResourcePool_Complete - - CreateVM_Task - - CreateVM_Task_Complete - - ReconnectHost_Task - - RegisterVM_Task - - RegisterVM_Task_Complete - - VmBeingClonedEvent - - VmBeingCreatedEvent - - VmBeingDeployedEvent - :name: Creation/Addition - configuration: - :critical: - - ClusterReconfiguredEvent - - EnterMaintenanceMode_Task_Complete - - ExitMaintenanceMode_Task_Complete - - FailoverLevelRestored - - MarkAsTemplate_Complete - - RefreshStorageSystem - - ResourcePoolReconfiguredEvent - - TemplateToVm - - USER_ADD_DISK_TO_VM - - USER_ADD_DISK_TO_VM_FINISHED_FAILURE - - USER_ADD_DISK_TO_VM_FINISHED_SUCCESS - - USER_CHANGE_FLOPPY_VM - - USER_EJECT_VM_DISK - - USER_EJECT_VM_FLOPPY - - USER_FAILED_ADD_DISK_TO_VM - - USER_FAILED_CHANGE_DISK_VM - - USER_FAILED_CHANGE_FLOPPY_VM - - USER_FAILED_REMOVE_DISK_FROM_VM - - USER_FAILED_UPDATE_HOST - - USER_FAILED_UPDATE_VM - - USER_FAILED_UPDATE_VM_DISK - - USER_FAILED_UPDATE_VM_TEMPLATE - - USER_REMOVE_DISK_FROM_VM - - USER_UPDATE_HOST - - USER_UPDATE_VM - - USER_UPDATE_VM_DISK - - USER_UPDATE_VM_TEMPLATE - - VmReconfiguredEvent - - VmResourcePoolMovedEvent - - VmToTemplate - - compute.instance.rebuild.end - - compute.instance.resize.end - - orchestration.stack.update.end - - orchestration.stack.update.error - - orchestration.stack.suspend.end - - orchestration.stack.suspend.error - - orchestration.stack.resume.end - - orchestration.stack.resume.error - - orchestration.autoscaling.end - - orchestration.autoscaling.error - - servergroup.update - - servergroup.addmemeber - :detail: - - EnterMaintenanceMode_Task - - ExitMaintenanceMode_Task - - MarkAsTemplate - - MoveIntoFolder_Task - - MoveInto_Task - - MoveIntoResourcePool - - MoveIntoResourcePool_Complete - - ReconfigVM_Task - - ReconfigVM_Task_Complete - - VmMacAssignedEvent - - VmResourceReallocatedEvent - - VmUuidAssignedEvent - :name: Configuration/Reconfiguration - console: - :critical: - - USER_LOGGED_IN_VM - - USER_LOGGED_OUT_VM - - UserLoginSessionEvent - - UserLogoutSessionEvent - - VmAcquiredMksTicketEvent - - VmRemoteConsoleConnectedEvent - :detail: [] - :name: Console Activity - deletion: - :critical: - - ClusterDestroyedEvent - - DestroyDatacenter_Task - - DestroyFolder_Task - - HostConnectionLostEvent - - HostDisconnectedEvent - - ResourcePoolDestroyedEvent - - UnregisterVM_Complete - - USER_FAILED_REMOVE_HOST - - USER_FAILED_REMOVE_VM - - USER_FAILED_REMOVE_VM_TEMPLATE - - USER_REMOVE_HOST - - USER_REMOVE_VM - - USER_REMOVE_VM_FINISHED - - USER_REMOVE_VM_TEMPLATE - - USER_REMOVE_VM_TEMPLATE_FINISHED - - VmDisconnectedEvent - - VmRemovedEvent - - image.delete - - orchestration.stack.delete.end - - orchestration.stack.delete.error - - servergroup.delete - :detail: - - Destroy_Task - - Destroy_Task_Complete - - DestroyCluster_Task_Complete - - DestroyCluster_Task - - DestroyResourcePool_Task - - DestroyResourcePool_Task_Complete - - DestroyVM_Task - - DestroyVM_Task_Complete - - DisconnectHost_Task - - UnregisterVM - :name: Deletion/Removal - general: - :critical: - - AD_COMPUTER_ACCOUNT_FAILED - - AD_COMPUTER_ACCOUNT_SUCCEEDED - - CPU_FLAGS_NX_IS_MISSING - - HOST_APPROVE - - HOST_APPROVE_FAILED - - HOST_DOMAIN_DELAY_INTERVAL - - HOST_INITIALIZING - - HOST_INSTALL - - HOST_INSTALL_FAILED - - HOST_INSTALL_IN_PROGRESS - - HOST_INSTALL_IN_PROGRESS_ERROR - - HOST_INSTALL_IN_PROGRESS_WARNING - - HOST_RECOVER_FAILED_VMS_UNKNOWN - - HOST_RUN_IN_NO_KVM_MODE - - HOST_SET_NONOPERATIONAL - - HOST_SET_NONOPERATIONAL_DOMAIN - - HOST_SET_NONOPERATIONAL_DOMAIN_FAILED - - HOST_SET_NONOPERATIONAL_FAILED - - HOST_SET_NONOPERATIONAL_IFACE_DOWN - - HOST_SET_NONOPERATIONAL_NETWORK - - HOST_VERSION_NOT_SUPPORTED_FOR_CLUSTER - - IMAGES_SYNCRONIZER_DESKTOP_NOT_EXIST_IN_IRS - - IMAGES_SYNCRONIZER_DESKTOP_NOT_EXIST_IN_VDC - - IMAGES_SYNCRONIZER_DESKTOP_WITHOUT_TEMPLATE_VDC - - IMAGES_SYNCRONIZER_IMAGE_TEMPLATE_NOT_EXIST - - IMAGES_SYNCRONIZER_SNAPSHOT_NOT_EXIST_IN_IRS - - IMAGES_SYNCRONIZER_SNAPSHOT_NOT_EXIST_IN_VDC - - IMAGES_SYNCRONIZER_SNAPSHOTS_NOT_ATTACHED_TO_VM_IN_VDC - - IMAGES_SYNCRONIZER_TEMPLATE_NOT_EXIST_IMAGE_EXIST - - IMAGES_SYNCRONIZER_TEMPLATE_NOT_EXIST_IN_VDC - - IRS_HOSTED_ON_HOST - - RECONSTRUCT_MASTER_DONE - - RECONSTRUCT_MASTER_FAILED - - RECONSTRUCT_MASTER_FAILED_NO_MASTER - - RescanAllHBA - - RescanVMFS - - ScheduledTaskStartedEvent - - SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_SEARCHING_NEW_SPM - - SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_WITH_ERROR - - SYSTEM_UPDATE_HOST_GROUP - - SYSTEM_UPDATE_HOST_GROUP_FAILED - - TaskTimeoutEvent - - TASK_CLEARING_ASYNC_TASK - - TASK_STOPPING_ASYNC_TASK - - UPDATE_TAGS_VM_DEFAULT_DISPLAY_TYPE - - UPDATE_TAGS_VM_DEFAULT_DISPLAY_TYPE_FAILED - - USER_ADD_BOOKMARK - - USER_ADD_BOOKMARK_FAILED - - USER_ADD_HOST_GROUP - - USER_ADD_HOST_GROUP_FAILED - - USER_ADD_PERMISSION - - USER_ADD_PERMISSION_FAILED - - USER_ADD_ROLE - - USER_ADD_ROLE_FAILED - - USER_ADD_ROLE_WITH_ACTION_GROUP - - USER_ADD_ROLE_WITH_ACTION_GROUP_FAILED - - USER_ADD_TAG - - USER_ADD_TAG_FAILED - - USER_ATTACH_TAG_TO_HOST - - USER_ATTACH_TAG_TO_HOST_EXISTS - - USER_ATTACH_TAG_TO_HOST_FAILED - - USER_ATTACH_TAG_TO_USER - - USER_ATTACH_TAG_TO_USER_EXISTS - - USER_ATTACH_TAG_TO_USER_FAILED - - USER_ATTACH_TAG_TO_USER_GROUP - - USER_ATTACH_TAG_TO_USER_GROUP_EXISTS - - USER_ATTACH_TAG_TO_USER_GROUP_FAILED - - USER_ATTACH_TAG_TO_VM - - USER_ATTACH_TAG_TO_VM_EXISTS - - USER_ATTACH_TAG_TO_VM_FAILED - - USER_ATTACHED_ACTION_GROUP_TO_ROLE - - USER_ATTACHED_ACTION_GROUP_TO_ROLE_FAILED - - USER_CHANGE_DISK_VM - - USER_CLEAR_UNKNOWN_VMS - - USER_COPIED_TEMPLATE - - USER_COPIED_TEMPLATE_FINISHED_FAILURE - - USER_COPIED_TEMPLATE_FINISHED_SUCCESS - - USER_DEDICATE_VM_TO_POWERCLIENT - - USER_DEDICATE_VM_TO_POWERCLIENT_FAILED - - USER_DETACH_HOST_FROM_TAG - - USER_DETACH_HOST_FROM_TAG_FAILED - - USER_DETACH_USER_FROM_TAG - - USER_DETACH_USER_FROM_TAG_FAILED - - USER_DETACH_USER_GROUP_FROM_TAG - - USER_DETACH_USER_GROUP_FROM_TAG_FAILED - - USER_DETACH_VM_FROM_TAG - - USER_DETACH_VM_FROM_TAG_FAILED - - USER_DETACHED_ACTION_GROUP_FROM_ROLE - - USER_DETACHED_ACTION_GROUP_FROM_ROLE_FAILED - - USER_FAILED_ADD_ADUSER - - USER_FAILED_CLEAR_UNKNOWN_VMS - - USER_FAILED_COPY_TEMPLATE - - USER_FAILED_REMOVE_ADUSER - - USER_LOCKED_VM - - USER_MOVE_TAG - - USER_MOVE_TAG_FAILED - - USER_PASSWORD_CHANGE_FAILED - - USER_PASSWORD_CHANGED - - USER_REMOVE_ADUSER - - USER_REMOVE_BOOKMARK - - USER_REMOVE_BOOKMARK_FAILED - - USER_REMOVE_HOST_GROUP - - USER_REMOVE_HOST_GROUP_FAILED - - USER_REMOVE_PERMISSION - - USER_REMOVE_PERMISSION_FAILED - - USER_REMOVE_ROLE - - USER_REMOVE_ROLE_FAILED - - USER_REMOVE_TAG - - USER_REMOVE_TAG_FAILED - - USER_UNLOCKED_VM - - USER_UPDATE_BOOKMARK - - USER_UPDATE_BOOKMARK_FAILED - - USER_UPDATE_HOST_GROUP - - USER_UPDATE_HOST_GROUP_FAILED - - USER_UPDATE_ROLE - - USER_UPDATE_ROLE_FAILED - - USER_UPDATE_TAG - - USER_UPDATE_TAG_FAILED - - USER_UPDATE_VM_CLUSTER_DEFAULT_HOST_CLEARED - - USER_VDC_LOGIN_FAILED - - USER_VDC_LOGOUT_FAILED - - VDC_START - - VDC_STOP - - VM_BLK_VIRTIO_NO_CACHE - - VM_CLEARED - - VM_SET_TO_UNKNOWN_STATUS - - VM_WAS_SET_DOWN_DUE_TO_HOST_REBOOT_OR_MANUAL_FENCE - - VM_RENAMED - - hardware.ipmi.metrics.update - :detail: [] - :name: General Activity - import_export: - :critical: - - IMPORTEXPORT_EXPORT_TEMPLATE - - IMPORTEXPORT_EXPORT_TEMPLATE_FAILED - - IMPORTEXPORT_EXPORT_VM - - IMPORTEXPORT_EXPORT_VM_FAILED - - IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE - - IMPORTEXPORT_FAILED_TO_IMPORT_VM - - IMPORTEXPORT_IMPORT_TEMPLATE - - IMPORTEXPORT_IMPORT_TEMPLATE_FAILED - - IMPORTEXPORT_IMPORT_VM - - IMPORTEXPORT_IMPORT_VM_FAILED - - IMPORTEXPORT_REMOVE_TEMPLATE - - IMPORTEXPORT_REMOVE_TEMPLATE_FAILED - - IMPORTEXPORT_REMOVE_VM - - IMPORTEXPORT_REMOVE_VM_FAILED - - IMPORTEXPORT_STARTING_EXPORT_TEMPLATE - - IMPORTEXPORT_STARTING_EXPORT_VM - - IMPORTEXPORT_STARTING_IMPORT_TEMPLATE - - IMPORTEXPORT_STARTING_IMPORT_VM - - IMPORTEXPORT_STARTING_REMOVE_TEMPLATE - - IMPORTEXPORT_STARTING_REMOVE_VM - - TEMPLATE_IMPORT - - TEMPLATE_IMPORT_FAILED - - USER_EXPORT_TEMPLATE - - USER_EXPORT_TEMPLATE_FAILED - - USER_EXPORT_VM - - USER_EXPORT_VM_FAILED - - VM_IMPORT - - VM_IMPORT_FAILED - - VM_IMPORT_INFO - :detail: [] - :name: Import / Export - migration: - :critical: - - DatastoreFileMovedEvent - - DrsMigrateVM_Task - - DrsVmMigratedEvent - - MigrateTaskEvent - - MigrateVM_Task - - RelocateVM_Task - - USER_FAILED_MOVE_TEMPLATE - - USER_FAILED_MOVE_VM - - USER_HOST_MAINTENANCE_MIGRATION_FAILED - - USER_MOVED_TEMPLATE - - USER_MOVED_TEMPLATE_FINISHED_FAILURE - - USER_MOVED_TEMPLATE_FINISHED_SUCCESS - - USER_MOVED_VM - - USER_MOVED_VM_FINISHED_FAILURE - - USER_MOVED_VM_FINISHED_SUCCESS - - VM_MIGRATION_ABORT - - VM_MIGRATION_DONE - - VM_MIGRATION_FAILED - - VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTANANCE - - VM_MIGRATION_FAILED_FROM_TO - - VM_MIGRATION_ON_CONNECT_CHECK_FAILED - - VM_MIGRATION_ON_CONNECT_CHECK_SUCCEEDED - - VM_MIGRATION_START - - VM_MIGRATION_TRYING_RERUN - - VmMigratedEvent - - VmRelocatedEvent - :detail: - - DrsMigrateVM_Task_Complete - - MigrateVM_Task_Complete - - MigrationHostWarningEvent - - Move_Task - - Move_Task_Complete - - RelocateTaskEvent - - RelocateVM_Task_Complete - - VmBeingRelocatedEvent - :name: Migration/Vmotion - network: - :critical: - - HOST_ALERT_FENCING_IS_NOT_CONFIGURED - - HOST_ALERT_FENCING_NO_PROXY_HOST - - HOST_ALERT_FENCING_OPERATION_FAILED - - HOST_ALERT_FENCING_OPERATION_SKIPPED - - HOST_ALERT_FENCING_TEST_FAILED - - HOST_FENCE_STATUS - - HOST_FENCE_STATUS_FAILED - - HOST_MANUAL_FENCE_FAILED_CALL_FENCE_SPM - - HOST_MANUAL_FENCE_STATUS - - HOST_MANUAL_FENCE_STATUS_FAILED - - NETWORK_ADD_BOND - - NETWORK_ADD_BOND_FAILED - - NETWORK_ADD_NETWORK - - NETWORK_ADD_NETWORK_FAILED - - NETWORK_ADD_TEMPLATE_INTERFACE - - NETWORK_ADD_TEMPLATE_INTERFACE_FAILED - - NETWORK_ADD_VM_INTERFACE - - NETWORK_ADD_VM_INTERFACE_FAILED - - NETWORK_INTERFACE_PLUGGED_INTO_VM - - NETWORK_ATTACH_NETWORK_TO_HOST - - NETWORK_ATTACH_NETWORK_TO_HOST_FAILED - - NETWORK_ATTACH_NETWORK_TO_HOST_GROUP - - NETWORK_ATTACH_NETWORK_TO_HOST_GROUP_FAILED - - NETWORK_COMMINT_NETWORK_CHANGES - - NETWORK_COMMINT_NETWORK_CHANGES_FAILED - - NETWORK_DETACH_NETWORK_FROM_HOST - - NETWORK_DETACH_NETWORK_FROM_HOST_FAILED - - NETWORK_DETACH_NETWORK_TO_HOST_GROUP - - NETWORK_DETACH_NETWORK_TO_HOST_GROUP_FAILED - - NETWORK_HOST_MISSING_CLUSER_VLAN - - NETWORK_HOST_NETWORK_MATCH_CLUSTER - - NETWORK_HOST_NETWORK_NOT_MATCH_CLUSTER - - NETWORK_HOST_USING_WRONG_CLUSER_VLAN - - NETWORK_REMOVE_BOND - - NETWORK_REMOVE_BOND_FAILED - - NETWORK_REMOVE_NETWORK - - NETWORK_REMOVE_NETWORK_FAILED - - NETWORK_REMOVE_TEMPLATE_INTERFACE - - NETWORK_REMOVE_TEMPLATE_INTERFACE_FAILED - - NETWORK_REMOVE_VM_INTERFACE - - NETWORK_REMOVE_VM_INTERFACE_FAILED - - NETWORK_UPDATE_DISPLAY_TO_HOST_GROUP - - NETWORK_UPDATE_DISPLAY_TO_HOST_GROUP_FAILED - - NETWORK_UPDATE_NETWORK_TO_HOST_INTERFACE - - NETWORK_UPDATE_NETWORK_TO_HOST_INTERFACE_FAILED - - NETWORK_UPDATE_TEMPLATE_INTERFACE - - NETWORK_UPDATE_TEMPLATE_INTERFACE_FAILED - - NETWORK_UPDATE_VM_INTERFACE - - NETWORK_UPDATE_VM_INTERFACE_FAILED - - network.floating_ip.allocate - - network.floating_ip.deallocate - - network.floating_ip.associate - - network.floating_ip.disassociate - - POD_HOSTPORTCONFLICT - :detail: [] - :name: Network - power: - :critical: - - AUTO_FAILED_SUSPEND_VM - - AUTO_SUSPEND_VM - - AUTO_SUSPEND_VM_FINISH_FAILURE - - AUTO_SUSPEND_VM_FINISH_SUCCESS - - DrsVmPoweredOnEvent - - HOST_FAILED_TO_RUN_VMS - - HOST_INITIATED_RUN_VM - - HOST_INITIATED_RUN_VM_FAILED - - RebootGuest_Complete - - RecommendHostsForVm - - RUN_VM_FAILED - - SYSTEM_HOST_RESTART - - SYSTEM_FAILED_HOST_RESTART - - ShutdownGuest - - USER_ADD_VM_STARTED - - USER_FAILED_ADD_VM - - USER_FAILED_HOST_RESTART - - USER_FAILED_HOST_SHUTDOWN - - USER_FAILED_HOST_START - - USER_FAILED_HOST_STOP - - USER_FAILED_PAUSE_VM - - USER_FAILED_RESUME_VM - - USER_FAILED_RUN_VM - - USER_FAILED_SHUTDOWN_VM - - USER_FAILED_STOP_VM - - USER_FAILED_STOPPING_VM_INSTEAD_OF_SHUTDOWN - - USER_FAILED_SUSPEND_VM - - USER_HOST_MAINTENANCE - - USER_HOST_RESTART - - USER_HOST_SHUTDOWN - - USER_HOST_START - - USER_HOST_STOP - - USER_INITIATED_RUN_VM - - USER_INITIATED_RUN_VM_FAILED - - USER_INITIATED_SHUTDOWN_VM - - USER_PAUSE_VM - - USER_RESUME_VM - - USER_RUN_VM - - USER_RUN_VM_AS_STATELESS_FINISHED_FAILURE - - USER_RUN_VM_ON_NON_DEFAULT_HOST - - USER_STARTED_VM - - USER_STOP_VM - - USER_STOP_SUSPENDED_VM - - USER_STOP_SUSPENDED_VM_FAILED - - USER_STOPPED_VM_INSTEAD_OF_SHUTDOWN - - USER_SUSPEND_VM - - USER_SUSPEND_VM_FINISH_FAILURE - - USER_SUSPEND_VM_FINISH_SUCCESS - - USER_SUSPEND_VM_OK - - VM_DOWN - - VM_DOWN_ERROR - - VM_PAUSED_ENOSPC - - VM_PAUSED_ERROR - - VM_SHUTDOWN_FAILED - - VmGuestRebootEvent - - VmGuestShutdownEvent - - VmPoweredOffEvent - - VmPoweredOnEvent - - VmResumingEvent - - VmStartedOnEvent - - VmStoppedEvent - - VmSuspendedEvent - - compute.instance.create.end - - compute.instance.create.error - - compute.instance.shutdown.end - - compute.instance.shutdown.error - - compute.instance.delete.end - - compute.instance.power_off.end - - compute.instance.power_on.end - - compute.instance.soft_delete.end - - compute.instance.reboot.end - - compute.instance.suspend - - compute.instance.resume - - compute.instance.pause.end - - compute.instance.unpause.end - - compute.instance.shelve.end - - compute.instance.unshelve.end - - compute.instance.shelve_offload.end - - NODE_REBOOT - - NODE_NODESCHEDULABLE - - NODE_NODENOTSCHEDULABLE - :detail: - - PowerOffVM_Task - - PowerOffVM_Task_Complete - - PowerOnMultiVM_Task - - PowerOnVM_Task - - PowerOnVM_Task_Complete - - RebootGuest - - ResetVM_Task - - ResetVM_Task_Complete - - ShutdownGuest_Complete - - SuspendVM_Task - - SuspendVM_Task_Complete - - VmStartingEvent - - VmStoppingEvent - - VmSuspendingEvent - :name: Power Activity - snapshot: - :critical: - - CreateSnapshot_Task - - RemoveAllSnapshots_Task - - RemoveSnapshot_Task - - RevertToSnapshot_Task - - USER_CREATE_SNAPSHOT - - USER_CREATE_SNAPSHOT_FINISHED_FAILURE - - USER_CREATE_SNAPSHOT_FINISHED_SUCCESS - - USER_FAILED_CREATE_SNAPSHOT - - USER_FAILED_MERGE_SNAPSHOT - - USER_FAILED_RESTORE_FROM_SNAPSHOT - - USER_FAILED_TRY_BACK_TO_SNAPSHOT - - USER_MERGE_SNAPSHOT - - USER_MERGE_SNAPSHOT_FINISHED_FAILURE - - USER_MERGE_SNAPSHOT_FINISHED_SUCCESS - - USER_RESTORE_FROM_SNAPSHOT - - USER_RESTORE_FROM_SNAPSHOT_FINISH_FAILURE - - USER_RESTORE_FROM_SNAPSHOT_FINISH_SUCCESS - - USER_TRY_BACK_TO_SNAPSHOT - - USER_TRY_BACK_TO_SNAPSHOT_FINISH_FAILURE - - USER_TRY_BACK_TO_SNAPSHOT_FINISH_SUCCESS - - compute.instance.snapshot.end - :detail: [] - :name: Snapshot Activity - status: - :critical: - - AlarmCreatedEvent - - AlarmRemovedEvent - - AlarmStatusChangedEventVm - - CERTIFICATE_FILE_NOT_FOUND - - ClusterStatusChangedEvent - - DasHostFailedEvent - - DuplicateIpDetectedEvent - - EVMAlertEvent - - GeneralHostWarningEvent - - HostDasErrorEvent - - HOST_ACTIVATE - - HOST_ACTIVATE_FAILED - - HOST_CPU_LOWER_THAN_CLUSTER - - HOST_CPU_RETRIEVE_FAILED - - HOST_FAILURE - - HOST_LOW_MEM - - HOST_MAINTENANCE - - HOST_MAINTENANCE_FAILED - - HOST_RECOVER - - HOST_RECOVER_FAILED - - HOST_SLOW_STORAGE_RESPONSE_TIME - - IRS_DISK_SPACE_LOW - - IRS_DISK_SPACE_LOW_ERROR - - IRS_FAILURE - - MAC_ADDRESS_IS_IN_USE - - MAC_POOL_EMPTY - - RemoveAlarm - - SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_FROM_NON_OPERATIONAL - - SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_WITH_ERROR - - SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC - - USER_FAILED_ATTACH_USER_TO_VM - - VM_FAILURE - - VM_NOT_RESPONDING - - VmConfigMissingEvent - - NODE_NODEREADY - - NODE_NODENOTREADY - - POD_FAILEDVALIDATION - - POD_DEADLINEEXCEEDED - - POD_FAILEDSYNC - - POD_INSUFFICIENTFREECPU - - CONTAINER_UNHEALTHY - - POD_NODESELECTORMISMATCHING - - CONTAINER_KILLING - - CONTAINER_STARTED - - CONTAINER_STOPPED - - POD_SCHEDULED - - POD_FAILEDSCHEDULING - :detail: - - DatacenterRenamedEvent - - GeneralUserEvent - - LicenseServerUnavailableEvent - - Rename_Task - - Rename_Task_Complete - - RenameCluster_Task - - RenameDatacenter_Task - - RenameDatacenter_Task_Complete - - RenameFolder_Task - - RenameResourcePool_Task - - RenameVM_Task - - RenameVM_Task_Complete - - VmRenamedEvent - :name: Alarm/Status change/Errors - storage: - :critical: - - CONNECT_STORAGE_POOL_FAILED - - CONNECT_STORAGE_SERVERS_FAILED - - RECOVERY_STORAGE_POOL - - RECOVERY_STORAGE_POOL_FAILED - - STORAGE_DOMAIN_ERROR - - SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM - - SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC - - SYSTEM_CHANGE_STORAGE_POOL_STATUS_RESET_IRS - - SYSTEM_DEACTIVATE_STORAGE_DOMAIN_FAILED - - SYSTEM_DEACTIVATED_STORAGE_DOMAIN - - SYSTEM_FAILED_CHANGE_STORAGE_POOL_STATUS - - USER_ACTIVATE_STORAGE_DOMAIN_FAILED - - USER_ACTIVATE_STORAGE_POOL - - USER_ACTIVATE_STORAGE_POOL_FAILED - - USER_ACTIVATED_STORAGE_DOMAIN - - USER_ADD_STORAGE_DOMAIN - - USER_ADD_STORAGE_DOMAIN_FAILED - - USER_ADD_STORAGE_POOL - - USER_ADD_STORAGE_POOL_FAILED - - USER_ATTACH_STORAGE_DOMAIN_TO_POOL - - USER_ATTACH_STORAGE_DOMAIN_TO_POOL_FAILED - - USER_CONNECT_HOSTS_TO_LUN_FAILED - - USER_DEACTIVATE_STORAGE_DOMAIN_FAILED - - USER_DEACTIVATED_STORAGE_DOMAIN - - USER_DETACH_STORAGE_DOMAIN_FROM_POOL - - USER_DETACH_STORAGE_DOMAIN_FROM_POOL_FAILED - - USER_EXTENDED_STORAGE_DOMAIN - - USER_EXTENDED_STORAGE_DOMAIN_FAILED - - USER_FORCE_REMOVE_STORAGE_DOMAIN - - USER_FORCE_REMOVE_STORAGE_DOMAIN_FAILED - - USER_REMOVE_STORAGE_DOMAIN - - USER_REMOVE_STORAGE_DOMAIN_FAILED - - USER_REMOVE_STORAGE_POOL - - USER_REMOVE_STORAGE_POOL_FAILED - - USER_UPDATE_STORAGE_DOMAIN - - USER_UPDATE_STORAGE_DOMAIN_FAILED - - USER_UPDATE_STORAGE_POOL - - USER_UPDATE_STORAGE_POOL_FAILED - - volume.create.end - - volume.delete.end - - POD_OUTOFDISK - - POD_INSUFFICIENTFREEMEMORY - - NODE_FAILEDMOUNT - - NODE_INVALIDDISKCAPACITY - :detail: [] - :name: Storage - -# -# The task_final_events section defines which events could be the final event -# for a task, and the list of those tasks for which that event is a final event. -# When the final event is encountered, and if the first event in the -# chain is one of the specified tasks, a rollup task is created with the name -# #{event}_Complete. -# -task_final_events: - ClusterCreatedEvent: - - CreateClusterEx - ClusterDestroyedEvent: - - DestroyCluster_Task - DatacenterCreatedEvent: - - CreateDatacenter - DatacenterRenamedEvent: - - RenameDatacenter_Task - DatastoreFileMovedEvent: - - Move_Task - DrsVmMigratedEvent: - - DrsMigrateVM_Task - DrsVmPoweredOnEvent: - - PowerOnVM_Task - EnteredMaintenanceModeEvent: - - EnterMaintenanceMode_Task - ExitMaintenanceModeEvent: - - ExitMaintenanceMode_Task - ResourcePoolCreatedEvent: - - CreateResourcePool - ResourcePoolDestroyedEvent: - - DestroyResourcePool_Task - ResourcePoolMovedEvent: - - MoveIntoResourcePool - VmClonedEvent: - - CloneVM_Task - VmCreatedEvent: - - CreateVM_Task - VmDeployedEvent: - - CloneVM_Task - VmGuestRebootEvent: - - RebootGuest - VmGuestShutdownEvent: - - ShutdownGuest - VmGuestStandbyEvent: - - StandbyGuest - VmMigratedEvent: - - MigrateVM_Task - - RelocateVM_Task - VmPoweredOffEvent: - - PowerOffVM_Task - VmPoweredOnEvent: - - PowerOnVM_Task - - ResetVM_Task - VmReconfiguredEvent: - - ReconfigVM_Task - VmRegisteredEvent: - - RegisterVM_Task - VmRelocatedEvent: - - RelocateVM_Task - VmRemovedEvent: - - DestroyVM_Task - - UnregisterVM - VmRenamedEvent: - - RenameVM_Task - VmResourcePoolMovedEvent: - - MarkAsTemplate - - MoveIntoResourcePool - VmSuspendedEvent: - - SuspendVM_Task diff --git a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/storage.tmpl.yml b/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/storage.tmpl.yml deleted file mode 100644 index 776c353d5..000000000 --- a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/storage.tmpl.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -:alignment: - :boundary: 4.kilobytes -:collection: - :timeout: 1800 -:debris: - :filters: - :ext_name: - - log - - nvram - - vmdk - - vmsn - - vmx - - vmsd - - vmxf - - vmtx - - vswp - - ! '%redo%' diff --git a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/vmdb.tmpl.yml b/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/vmdb.tmpl.yml deleted file mode 100644 index 310012080..000000000 --- a/db/migrate/data/20160127210624_convert_configurations_to_settings_changes/vmdb.tmpl.yml +++ /dev/null @@ -1,601 +0,0 @@ -# NOTE: Please do not hand edit this file. -# -# Accepted values for some settings: -# authentication: -# mode: ldap, database, none -# log: -# level: fatal, error, warn, info, debug -# server: -# session_store: cache, memory, sql -# web_services: -# mode: invoke, disable -# -# Explanations for some settings: -# session: -# interval: Time interval for checking for inactive sessions, in seconds -# timeout: Time period in which inactive console sessions are deleted, in seconds -# server: -# listening_port: Tells vmdb the port number on which the web server is listening. -# NOTE: This does not assign the listen_port. -# ---- -api: - token_ttl: 10.minutes - authentication_timeout: 30.seconds -authentication: - basedn: - bind_dn: - bind_pwd: - get_direct_groups: true - group_memberships_max_depth: 2 - ldaphost: - ldapport: '389' - mode: database - user_suffix: - user_type: userprincipalname - amazon_key: - amazon_secret: -coresident_miqproxy: - concurrent_per_ems: 1 - concurrent_per_host: 1 - scan_via_host: true - use_vim_broker: true -database: - metrics_collection: - :collection_schedule: "1 * * * *" - :daily_rollup_schedule: "23 0 * * *" - metrics_history: - :keep_daily_metrics: 6.months - :keep_hourly_metrics: 6.months - :purge_schedule: "50 * * * *" - :purge_window_size: 100000 -ldap_synchronization: - ldap_synchronization_schedule: "0 2 * * *" -drift_states: - history: - :keep_drift_states: 6.months - :purge_window_size: 10000 -ems: - ems_redhat: - :service: - :read_timeout: 1.hour - ems_kubernetes: - :miq_namespace: management-infra -ems_events: - history: - :keep_ems_events: 6.months - :purge_window_size: 1000 -ems_refresh: - capture_vm_created_on_date: false - ec2: - get_private_images: true - get_shared_images: true - get_public_images: false - ignore_terminated_instances: true - ansible_tower_configuration: - :refresh_interval: 15.minutes - foreman_configuration: - :refresh_interval: 15.minutes - foreman_provisioning: - :refresh_interval: 1.hour - full_refresh_threshold: 100 - kubernetes: - :refresh_interval: 15.minutes - openshift: - :refresh_interval: 15.minutes - atomic: - :refresh_interval: 15.minutes - openshift_enterprise: - :refresh_interval: 15.minutes - atomic_enterprise: - :refresh_interval: 15.minutes - raise_vm_snapshot_complete_if_created_within: 15.minutes - refresh_interval: 24.hours - scvmm: - :refresh_interval: 15.minutes -host_scan: - queue_timeout: 20.minutes -http_proxy: - :host: - :password: - :port: - :user: -log: - collection: - :archive: - :pattern: - :current: - :pattern: - - log/*.log - - log/apache/*.log - - log/*.txt - - config/* - - /var/log/syslog* - - /var/log/daemon.log* - - /etc/default/ntp* - - /var/log/messages* - - /var/log/cron* - - BUILD - - GUID - - VERSION - :ping_depot: true - :ping_depot_timeout: 20 - level: info - level_rails: info - level_aws: info - level_aws_in_evm: error - level_kube: info - level_kube_in_evm: error - level_api: info - level_api_in_evm: error - level_fog: info - level_fog_in_evm: error - level_rhevm: info - level_rhevm_in_evm: error - level_scvmm: info - level_scvmm_in_evm: error - level_vim: warn - level_vim_in_evm: error -management_system: - power_operation_expiration: 10.minutes -performance: - capture_threshold: - :ems_cluster: 50.minutes - :host: 50.minutes - :storage: 60.minutes - :vm: 50.minutes - capture_threshold_with_alerts: - :host: 20.minutes - :vm: 20.minutes - concurrent_requests: - :hourly: 1 - :realtime: 20 - history: - :initial_capture_days: 0 - :keep_daily_performances: 6.months - :keep_hourly_performances: 6.months - :keep_realtime_performances: 4.hours - :purge_window_size: 1000 - host_overhead: - :memory: 2.01.percent - :cpu: 0.15.percent -policy_events: - history: - :keep_policy_events: 6.months - :purge_window_size: 1000 -product: - maindb: ExtManagementSystem -reporting: - format_by_class: - :Fixnum: - :function: - :name: number_with_delimiter - :Float: - :function: - :name: number_with_delimiter - format_by_column: {} - history: - :keep_reports: 6.months - :purge_window_size: 100 - precision: - :default: 2 - precision_by_column: - :slope: 4 - queue_timeout: 1.hour -repository_scanning: - defaultsmartproxy: -server: - case_sensitive_name_search: false - company: My Company - custom_logo: false - events: - :disk_usage_gt_percent: 80 - host: - listening_port: '443' - mks_classid: 338095E4-1806-4BA3-AB51-38A3179200E9 - mks_version: 2.1.0.0 - monitor_poll: 5.seconds - name: EVM - rails_server: "thin" - remote_console_type: VMRC - role: database_operations,event,reporting,scheduler,smartstate,ems_operations,ems_inventory,user_interface,web_services,automate - server_dequeue_frequency: 5.seconds - session_store: cache - startup_timeout: 300 - timezone: UTC - :worker_monitor: - :kill_algorithm: - :name: :used_swap_percent_gt_value - :value: 80 - :miq_server_time_threshold: 2.minutes - :nice_delta: 1 - :poll: 2.seconds - :start_algorithm: - :name: :used_swap_percent_lt_value - :value: 60 - :sync_interval: 30.minutes - :wait_for_started_timeout: 10.minutes - zone: default -session: - interval: 60 - memcache_server: 127.0.0.1:11211 - memcache_server_opts: '-l 127.0.0.1' - show_login_info: true - timeout: 3600 -smartproxy_deploy: - queue_timeout: 30.minutes -smtp: - authentication: login - domain: mydomain.com - from: cfadmin@cfserver.com - host: localhost - password: '' - port: '25' - user_name: evmadmin -snapshots: - :create_free_percent: 100 - :remove_free_percent: 100 -ssl: - :ssl_ca_file: - :ssl_ca_path: -storage: - inventory: - :full_refresh_schedule: "38 * * * *" - metrics_collection: - :collection_schedule: "0,15,30,45 * * * *" - :hourly_rollup_schedule: "8 * * * *" - :daily_rollup_schedule: "23 0 * * *" - :collection_interval: 15.minutes - :max_gap_to_fill: 6.hours - metrics_history: - :purge_schedule: "50 * * * *" - :keep_daily_metrics: 6.months - :keep_hourly_metrics: 6.months - :keep_realtime_metrics: 4.hours - :purge_window_size: 1000 -ui: - mark_translated_strings: false -webservices: - consume_protocol: https - contactwith: ipaddress - integrate: - :security: basic - mode: invoke - nameresolution: false - provide_protocol: https - security: none - timeout: 120 - use_vim_broker: true - authentication_timeout: 30.seconds -workers: - worker_base: - :defaults: - :count: 1 - :gc_interval: 15.minutes - :heartbeat_freq: 60.seconds - :heartbeat_timeout: 2.minutes - :memory_threshold: 200.megabytes - :nice_delta: 10 - :parent_time_threshold: 3.minutes - :poll: 3.seconds - :poll_escalate_max: 30.seconds - :poll_method: :normal - :restart_interval: 0.hours - :starting_timeout: 10.minutes - :ems_refresh_core_worker: - :poll: 1.seconds - :memory_threshold: 400.megabytes - :nice_delta: 1 - :thread_shutdown_timeout: 10.seconds - :event_catcher: - :defaults: - :ems_event_page_size: 100 - :ems_event_thread_shutdown_timeout: 10.seconds - :memory_threshold: 2.gigabytes - :nice_delta: 1 - :poll: 1.seconds - :event_catcher_redhat: - :poll: 15.seconds - :event_catcher_vmware: - :poll: 1.seconds - :ems_event_max_wait: 60 - :event_catcher_openstack: - :poll: 15.seconds - :topics: - :nova: "notifications.*" - :cinder: "notifications.*" - :glance: "notifications.*" - :heat: "notifications.*" - :duration: 10.seconds - :capacity: 50 - :amqp_port: 5672 - :amqp_heartbeat: 30 - :event_catcher_openstack_network: - :poll: 15.seconds - :topics: - :neutron: "notifications.*" - :duration: 10.seconds - :capacity: 50 - :amqp_port: 5672 - :amqp_heartbeat: 30 - :event_catcher_openstack_infra: - :poll: 15.seconds - :topics: - :nova: "notifications.*" - :cinder: "notifications.*" - :glance: "notifications.*" - :heat: "notifications.*" - :ironic: "notifications.*" - :duration: 10.seconds - :capacity: 50 - :amqp_port: 5672 - :amqp_heartbeat: 30 - :event_catcher_amazon: - :poll: 15.seconds - :event_catcher_kubernetes: - :poll: 1.seconds - :event_catcher_openshift: - :poll: 1.seconds - :event_catcher_atomic: - :poll: 1.seconds - :event_catcher_openshift_enterprise: - :poll: 1.seconds - :event_catcher_atomic_enterprise: - :poll: 1.seconds - :queue_worker_base: - :defaults: - :cpu_usage_threshold: 100.percent - :dequeue_method: :drb - :memory_threshold: 400.megabytes - :poll_method: :normal - :queue_timeout: 10.minutes - :ems_metrics_collector_worker: - :defaults: - :count: 2 - :nice_delta: 3 - :poll_method: :escalate - :ems_metrics_collector_worker_amazon: - :poll_method: :escalate - :ems_metrics_collector_worker_redhat: - :poll_method: :escalate - :ems_metrics_collector_worker_vmware: - :poll_method: :escalate - :ems_metrics_collector_worker_openstack: - :poll_method: :escalate - :ems_metrics_collector_worker_openstack_network: - :poll_method: :escalate - :ems_metrics_collector_worker_openstack_infra: - :poll_method: :escalate - :ems_metrics_collector_worker_kubernetes: - :poll_method: :escalate - :metrics_port: 5000 - :metrics_path: '/hawkular/metrics' - :ems_metrics_collector_worker_openshift: - :poll_method: :escalate - :ems_metrics_collector_worker_atomic: - :poll_method: :escalate - :ems_metrics_collector_worker_openshift_enterprise: - :poll_method: :escalate - :ems_metrics_collector_worker_atomic_enterprise: - :poll_method: :escalate - :ems_metrics_processor_worker: - :count: 2 - :memory_threshold: 400.megabytes - :nice_delta: 7 - :poll_method: :escalate - :ems_refresh_worker: - :defaults: - :memory_threshold: 2.gigabytes - :nice_delta: 7 - :poll: 10.seconds - :poll_method: :normal - :queue_timeout: 120.minutes - :restart_interval: 2.hours - :ems_refresh_worker_amazon: {} - :ems_refresh_worker_ansible_tower_configuration: {} - :ems_refresh_worker_azure: {} - :ems_refresh_worker_foreman_configuration: {} - :ems_refresh_worker_foreman_provisioning: {} - :ems_refresh_worker_google: {} - :ems_refresh_worker_hawkular: {} - :ems_refresh_worker_kubernetes: {} - :ems_refresh_worker_openshift: {} - :ems_refresh_worker_atomic: {} - :ems_refresh_worker_openshift_enterprise: {} - :ems_refresh_worker_atomic_enterprise: {} - :ems_refresh_worker_microsoft: {} - :ems_refresh_worker_redhat: {} - :ems_refresh_worker_openstack: {} - :ems_refresh_worker_openstack_network: {} - :ems_refresh_worker_openstack_infra: {} - :ems_refresh_worker_vmware: {} - :event_handler: - :cpu_usage_threshold: 0.percent - :nice_delta: 7 - :generic_worker: - :count: 2 - :netapp_refresh_worker: - :memory_threshold: 2.gigabytes - :nice_delta: 7 - :poll: 10.seconds - :poll_method: :normal - :queue_timeout: 60.minutes - :priority_worker: - :count: 2 - :nice_delta: 1 - :poll: 1.seconds - :reporting_worker: - :count: 2 - :nice_delta: 7 - :smart_proxy_worker: - :count: 2 - :memory_threshold: 600.megabytes - :queue_timeout: 20.minutes - :restart_interval: 2.hours - :storage_metrics_collector_worker: - :count: 2 - :nice_delta: 3 - :poll_method: :escalate - :vmdb_storage_bridge_worker: - :memory_threshold: 2.gigabytes - :nice_delta: 7 - :poll: 10.seconds - :poll_method: :normal - :queue_timeout: 120.minutes - :replication_worker: - :connection_pool_size: 5 - :poll: 1.seconds - :replication: - :destination: - :database: vmdb_production - :username: root - :exclude_tables: - - ar_internal_metadata - - assigned_server_roles - - audit_events - - binary_blobs - - binary_blob_parts - - chargeback_rate_details - - chargeback_rates - - conditions - - conditions_miq_policies - - configurations - - custom_buttons - - customization_specs - - database_backups - - event_logs - - file_depots - - jobs - - log_files - - metrics - - metrics_00 - - metrics_01 - - metrics_02 - - metrics_03 - - metrics_04 - - metrics_05 - - metrics_06 - - metrics_07 - - metrics_08 - - metrics_09 - - metrics_10 - - metrics_11 - - metrics_12 - - metrics_13 - - metrics_14 - - metrics_15 - - metrics_16 - - metrics_17 - - metrics_18 - - metrics_19 - - metrics_20 - - metrics_21 - - metrics_22 - - metrics_23 - - metric_rollups - - miq_actions - - miq_ae_classes - - miq_ae_fields - - miq_ae_instances - - miq_ae_methods - - miq_ae_namespaces - - miq_ae_values - - miq_ae_workspaces - - miq_alert_statuses - - miq_alerts - - miq_databases - - miq_enterprises - - miq_event_definitions - - miq_globals - - miq_groups - - miq_policies - - miq_policy_contents - - miq_product_features - - miq_queue - - miq_roles_features - - miq_report_result_details - - miq_report_results - - miq_reports - - miq_searches - - miq_servers_product_updates - - miq_sets - - miq_schedules - - miq_shortcuts - - miq_tasks - - miq_user_roles - - miq_widgets - - miq_widget_contents - - miq_workers - - rss_feeds - - scan_items - - schema_migrations - - server_roles - - sessions - - vim_performance_states - - vim_performance_tag_values - - vmdb_database_metrics - - vmdb_databases - - vmdb_indexes - - vmdb_metrics - - vmdb_tables - :options: - :replication_trace: false - :debug_sql: false - :heartbeat_threshold: 300 - :database_connection_timeout: 15 - :schedule_worker: - :authentication_check_interval: 1.day - :db_diagnostics_interval: 30.minutes - :ems_events_purge_interval: 1.day - :evm_snapshot_delete_delay_for_job_not_found: 1.hour - :evm_snapshot_interval: 1.hour - :job_proxy_dispatcher_interval: 15.seconds - :job_proxy_dispatcher_stale_message_check_interval: 60.seconds - :job_proxy_dispatcher_stale_message_timeout: 2.minutes - :job_timeout_interval: 60.seconds - :log_active_configuration_interval: 1.days - :log_database_statistics_interval: 1.days - :memory_threshold: 300.megabytes - :nice_delta: 3 - :orchestration_stack_retired_interval: 10.minutes - :performance_collection_interval: 3.minutes - :performance_collection_start_delay: 5.minutes - :performance_realtime_purging_interval: 15.minutes - :performance_realtime_purging_start_delay: 5.minutes - :performance_rollup_purging_interval: 4.hours - :performance_rollup_purging_start_delay: 5.minutes - :policy_events_purge_interval: 1.day - :poll: 15.seconds - :server_log_stats_interval: 5.minutes - :server_stats_interval: 60.seconds - :service_retired_interval: 10.minutes - :session_timeout_interval: 30.seconds - :storage_file_collection_interval: 1.days - :storage_file_collection_time_utc: 06:00 - :vm_retired_interval: 10.minutes - :smis_refresh_worker: - :connection_pool_size: 5 - :memory_threshold: 1.gigabytes - :nice_delta: 3 - :poll: 15.seconds - :smis_update_period: 1.hours - :stats_update_period: 10.minutes - :status_update_period: 5.minutes - :ui_worker: - :connection_pool_size: 5 - :memory_threshold: 1.gigabytes - :nice_delta: 1 - :poll: 60.seconds - :vim_broker_worker: - :heartbeat_freq: 15.seconds - :memory_threshold: 2.gigabytes - :nice_delta: 3 - :poll: 1.seconds - :reconnect_retry_interval: 5.minutes - :vim_broker_status_interval: 15.minutes - :vim_broker_update_interval: 0.seconds - :web_service_worker: - :connection_pool_size: 5 - :memory_threshold: 1.gigabytes - :nice_delta: 1 - :poll: 60.seconds diff --git a/spec/migrations/20131107000917_expand_dialog_field_default_value_size_spec.rb b/spec/migrations/20131107000917_expand_dialog_field_default_value_size_spec.rb deleted file mode 100644 index 3ecb67e0e..000000000 --- a/spec/migrations/20131107000917_expand_dialog_field_default_value_size_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -require_migration - -describe ExpandDialogFieldDefaultValueSize do - let(:dialog_field_stub) { migration_stub(:DialogField) } - let(:reserve_stub) { Spec::Support::MigrationStubs.reserved_stub } - - migration_context :up do - it "should convert default_value to text type" do - expect(dialog_field_stub.columns_hash['default_value'].type).to eq(:string) - migrate - expect(dialog_field_stub.columns_hash['default_value'].type).to eq(:text) - end - - it "should migrate default_value from the reserved table" do - val1 = "default value 1" - field1 = dialog_field_stub.create! - reserved1 = reserve_stub.create!(:resource_id => field1.id, - :resource_type => 'DialogField', - :reserved => {:default_value => val1}) - val2 = "default value 2" - field2 = dialog_field_stub.create!(:default_value => val2) - reserved2 = reserve_stub.create!(:resource_id => field2.id, - :resource_type => 'DialogField', - :reserved => {:some_field => 1}) - val3 = "default value 3" - field3 = dialog_field_stub.create!(:default_value => val3) - - migrate - - expect { reserved1.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { reserved2.reload }.to_not raise_error - expect(field1.reload.default_value).to eq(val1) - expect(field2.reload.default_value).to eq(val2) - expect(field3.reload.default_value).to eq(val3) - end - end - - migration_context :down do - it "should convert default_value to string type" do - expect(dialog_field_stub.columns_hash['default_value'].type).to eq(:text) - migrate - expect(dialog_field_stub.columns_hash['default_value'].type).to eq(:string) - end - - it "should migrate default_value to the reserved table" do - val1 = "default value 1" - field1 = dialog_field_stub.create!(:default_value => val1) - field2 = dialog_field_stub.create! - - migrate - - reserve1 = reserve_stub.where(:resource_id => field1.id, - :resource_type => 'DialogField').first! - expect(reserve1.reserved).to eq(:default_value => val1) - expect(reserve_stub.where(:resource_id => field2.id, - :resource_type => 'DialogField')).not_to exist - end - end -end diff --git a/spec/migrations/20131118232818_encrypt_miq_database_registration_http_proxy_password_field_spec.rb b/spec/migrations/20131118232818_encrypt_miq_database_registration_http_proxy_password_field_spec.rb deleted file mode 100644 index 22eeeac26..000000000 --- a/spec/migrations/20131118232818_encrypt_miq_database_registration_http_proxy_password_field_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -require_migration - -describe EncryptMiqDatabaseRegistrationHttpProxyPasswordField do - let(:miq_database_stub) { migration_stub(:MiqDatabase) } - let(:password) { "password" } - let(:enc_pass) { ManageIQ::Password.encrypt(password) } - - migration_context :up do - it "should encrypt unencrypted password" do - miq_database_stub.create!(:registration_http_proxy_password => password) - - migrate - - encrypted = miq_database_stub.first.registration_http_proxy_password - expect(encrypted).to be_encrypted(password) - end - end - - migration_context :down do - it "should decrypt encrypted password" do - miq_database_stub.create!(:registration_http_proxy_password => enc_pass) - - migrate - - expect(miq_database_stub.first.registration_http_proxy_password).to eq(password) - end - - it "should not modify clear text password" do - miq_database_stub.create!(:registration_http_proxy_password => password) - - migrate - - expect(miq_database_stub.first.registration_http_proxy_password).to eq(password) - end - end -end diff --git a/spec/migrations/20131121211455_change_options_in_miq_alert_spec.rb b/spec/migrations/20131121211455_change_options_in_miq_alert_spec.rb deleted file mode 100644 index 6bb51a0cc..000000000 --- a/spec/migrations/20131121211455_change_options_in_miq_alert_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_migration - -describe ChangeOptionsInMiqAlert do - migration_context :up do - let(:miq_alert_stub) { migration_stub(:MiqAlert) } - - it 'default miq_alert email gets updated' do - options = {:notifications => {:email => {:to => ['alert@manageiq.com']}}} - alert = miq_alert_stub.create!(:description => 'Test Alert', :options => options) - - migrate - - alert.reload - expect(alert.options).to eq(:notifications => {:email => {:to => ''}}) - end - - it 'non-default miq_alert email is ignored' do - options = {:notifications => {:email => {:to => ['alert@redhat.com']}}} - alert = miq_alert_stub.create!(:description => 'Test Alert', :options => options) - - migrate - - alert.reload - expect(alert.options).to eq(options) - end - end -end diff --git a/spec/migrations/20131125153220_import_provision_dialogs_spec.rb b/spec/migrations/20131125153220_import_provision_dialogs_spec.rb deleted file mode 100644 index dc7441a1e..000000000 --- a/spec/migrations/20131125153220_import_provision_dialogs_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_migration - -describe ImportProvisionDialogs do - let(:miq_dialog_stub) { migration_stub(:MiqDialog) } - - migration_context :up do - before do - dialog_file = File.join(File.dirname(__FILE__), "data/20131125153220_import_provision_dialogs_spec/miq_provision_dialogs.rb") - allow(Dir).to receive(:glob).and_yield(dialog_file) - end - - it "import dialog file into database" do - migrate - - expect(miq_dialog_stub.count).to eq(1) - - dialog = miq_dialog_stub.first - expect(dialog.name).to eq("miq_provision_dialogs") - expect(dialog.dialog_type).to eq("MiqProvisionWorkflow") - expect(dialog.default).to be_falsey - expect(dialog.content).to be_kind_of(Hash) - expect(dialog.content).to include(:dialog_order, :buttons, :dialogs) - expect(dialog.content[:buttons]).to include(:submit, :cancel) - end - - it "skip dialog file if already in database" do - miq_dialog_stub.create!(:name => "miq_provision_dialogs") - expect(miq_dialog_stub).to receive(:create).never - - migrate - end - end -end diff --git a/spec/migrations/20131210202928_update_log_collection_path_in_configurations_settings_spec.rb b/spec/migrations/20131210202928_update_log_collection_path_in_configurations_settings_spec.rb deleted file mode 100644 index 58adf5e0f..000000000 --- a/spec/migrations/20131210202928_update_log_collection_path_in_configurations_settings_spec.rb +++ /dev/null @@ -1,115 +0,0 @@ -require_migration - -describe UpdateLogCollectionPathInConfigurationsSettings do - let(:configuration_stub) { migration_stub(:Configuration) } - - migration_context :up do - it "updates the configuration to have the new PG settings" do - old_settings = { - "log" => { - "collection" => { - :current => { - :pattern => [ - "log/*.log", - "log/apache/*.log", - "log/*.txt", - "config/*", - "/var/lib/pgsql/data/*.conf", - "/var/lib/pgsql/data/serverlog*", - "/var/log/syslog*", - "/var/log/daemon.log*", - "/etc/default/ntp*", - "/var/log/messages*", - "/var/log/cron*", - "BUILD", - "GUID", - "VERSION" - ] - } - } - } - } - configuration_stub.create!(:typ => 'vmdb', :settings => old_settings) - - migrate - - settings = configuration_stub.first.settings - expect(settings.fetch_path("log", "collection", :current, :pattern, 4)) - .to eq("/opt/rh/postgresql92/root/var/lib/pgsql/data/*.conf") - expect(settings.fetch_path("log", "collection", :current, :pattern, 5)) - .to eq("/opt/rh/postgresql92/root/var/lib/pgsql/data/pg_log/*") - end - - it "ignores changes when expected path doesn't exist" do - old_settings = { - "log" => { - "collection" => { - :current => { - :pattern => [] - } - } - } - } - configuration_stub.create!(:typ => 'vmdb', :settings => old_settings) - - migrate - - settings = configuration_stub.first.settings - expect(settings.fetch_path("log", "collection", :current, :pattern)).to be_empty - end - end - - migration_context :down do - it "updates the configuration to have the old PG settings" do - new_settings = { - "log" => { - "collection" => { - :current => { - :pattern => [ - "log/*.log", - "log/apache/*.log", - "log/*.txt", - "config/*", - "/opt/rh/postgresql92/root/var/lib/pgsql/data/*.conf", - "/opt/rh/postgresql92/root/var/lib/pgsql/data/pg_log/*", - "/var/log/syslog*", - "/var/log/daemon.log*", - "/etc/default/ntp*", - "/var/log/messages*", - "/var/log/cron*", - "BUILD", - "GUID", - "VERSION" - ] - } - } - } - } - configuration_stub.create!(:typ => 'vmdb', :settings => new_settings) - - migrate - - settings = configuration_stub.first.settings - expect(settings.fetch_path("log", "collection", :current, :pattern, 4)).to eq("/var/lib/pgsql/data/*.conf") - expect(settings.fetch_path("log", "collection", :current, :pattern, 5)).to eq("/var/lib/pgsql/data/serverlog*") - end - - it "ignores changes when expected path doesn't exist" do - new_settings = { - "log" => { - "collection" => { - :current => { - :pattern => [] - } - } - } - } - configuration_stub.create!(:typ => 'vmdb', :settings => new_settings) - - migrate - - settings = configuration_stub.first.settings - expect(settings.fetch_path("log", "collection", :current, :pattern)).to be_empty - end - end -end diff --git a/spec/migrations/20131216214850_fix_replication_on_upgrade_from_version_four_spec.rb b/spec/migrations/20131216214850_fix_replication_on_upgrade_from_version_four_spec.rb deleted file mode 100644 index 3329d7a28..000000000 --- a/spec/migrations/20131216214850_fix_replication_on_upgrade_from_version_four_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require_migration - -describe FixReplicationOnUpgradeFromVersionFour do - let(:configuration_stub) { migration_stub(:Configuration) } - - migration_context :up do - it "updates the configuration to have the new replication settings" do - old_settings = { - "workers" => { - "worker_base" => { - :replication_worker => { - :replication => { - :include_tables => ["."], - :exclude_tables => [ - "doesn't", - "really", - "matter" - ] - } - } - } - } - } - configuration_stub.create!(:typ => 'vmdb', :settings => old_settings) - - migrate - - settings = configuration_stub.first.settings - expect(settings.key_path?("workers", "worker_base", :replication_worker, :replication, :include_tables)) - .to be_falsey - expect(settings.fetch_path("workers", "worker_base", :replication_worker, :replication, :exclude_tables)) - .to eq(described_class::V5_DEFAULT_EXCLUDE_TABLES) - end - end -end diff --git a/spec/migrations/20140121213913_split_widget_set_name_to_three_columns_spec.rb b/spec/migrations/20140121213913_split_widget_set_name_to_three_columns_spec.rb deleted file mode 100644 index 1912ffb20..000000000 --- a/spec/migrations/20140121213913_split_widget_set_name_to_three_columns_spec.rb +++ /dev/null @@ -1,82 +0,0 @@ -require_migration - -describe SplitWidgetSetNameToThreeColumns do - migration_context :up do - let(:miq_set_stub) { migration_stub(:MiqSet) } - - it "splits name value into 3 columns: name, userid and group_id" do - miq_set_stub.create!(:set_type => 'MiqWidgetSet', :name => "admin|123|my board") - - migrate - - ws = miq_set_stub.first - expect(ws.name).to eq("my board") - expect(ws.userid).to eq("admin") - expect(ws.group_id).to eq(123) - end - - it "deletes the record with name like userid|db_name" do - miq_set_stub.create!(:set_type => 'MiqWidgetSet', :name => "admin|my board") - - migrate - - expect(miq_set_stub.count).to eq(0) - end - - it "keeps the record with name like db_name" do - miq_set_stub.create!(:set_type => 'MiqWidgetSet', :name => "my board") - - migrate - - ws = miq_set_stub.first - expect(ws.name).to eq("my board") - expect(ws.userid).to be_nil - expect(ws.group_id).to be_nil - end - - it "deletes the record with name like userid|group_id|db_name|whatever" do - miq_set_stub.create!(:set_type => 'MiqWidgetSet', :name => "admin|123|my board|whatever") - - migrate - - expect(miq_set_stub.count).to eq(0) - end - end - - migration_context :down do - let(:miq_set_stub) { migration_stub(:MiqSet) } - - it "puts userid, group_id into name value" do - miq_set_stub.create!(:set_type => 'MiqWidgetSet', :name => "my board", :userid => "test", :group_id => 99) - - migrate - - ws = miq_set_stub.first - expect(ws.name).to eq("test|99|my board") - expect { ws.userid }.to raise_error(NoMethodError) - expect { ws.group_id }.to raise_error(NoMethodError) - end - - it "leaves the record as is when group_id = nil" do - miq_set_stub.create!(:set_type => 'MiqWidgetSet', :name => "my board", :userid => "test") - - migrate - - ws = miq_set_stub.first - expect(ws.name).to eq("my board") - expect { ws.userid }.to raise_error(NoMethodError) - expect { ws.group_id }.to raise_error(NoMethodError) - end - - it "leaves the record as is when userid = nil" do - miq_set_stub.create!(:set_type => 'MiqWidgetSet', :name => "my board", :group_id => 123) - - migrate - - ws = miq_set_stub.first - expect(ws.name).to eq("my board") - expect { ws.userid }.to raise_error(NoMethodError) - expect { ws.group_id }.to raise_error(NoMethodError) - end - end -end diff --git a/spec/migrations/20140201040548_add_update_repo_name_to_miq_database_spec.rb b/spec/migrations/20140201040548_add_update_repo_name_to_miq_database_spec.rb deleted file mode 100644 index 19cd2a2dc..000000000 --- a/spec/migrations/20140201040548_add_update_repo_name_to_miq_database_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require_migration - -describe AddUpdateRepoNameToMiqDatabase do - let(:db_stub) { migration_stub(:MiqDatabase) } - let(:reserve_stub) { Spec::Support::MigrationStubs.reserved_stub } - - migration_context :up do - it "Migrates :update_repo_name from Reserves table to new column on MiqDatabase" do - db = db_stub.create! - reserve_stub.create!( - :resource_type => "MiqDatabase", - :resource_id => db.id, - :reserved => { - :update_repo_name => "abc" - } - ) - - migrate - - # Expect counts - expect(reserve_stub.count).to be(0) - expect(db_stub.count).to be(1) - - # Expect data - expect(db.reload.update_repo_name).to eq("abc") - end - end - - migration_context :down do - it "Migrates :update_repo_name from column on MiqDatabase to Reserves table" do - db = db_stub.create!(:update_repo_name => "abc") - - migrate - - # Expect counts - expect(reserve_stub.count).to be(1) - expect(db_stub.count).to be(1) - - # Expect data - expect(reserve_stub.first.resource_id).to eq(db.id) - expect(reserve_stub.first.resource_type).to eq("MiqDatabase") - expect(reserve_stub.first.reserved).to eq(:update_repo_name => "abc") - end - end -end diff --git a/spec/migrations/20140214191729_enhance_firewall_rules_for_neutron_networking_spec.rb b/spec/migrations/20140214191729_enhance_firewall_rules_for_neutron_networking_spec.rb deleted file mode 100644 index ee9284c7b..000000000 --- a/spec/migrations/20140214191729_enhance_firewall_rules_for_neutron_networking_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -require_migration - -describe EnhanceFirewallRulesForNeutronNetworking do - let(:firewall_rule_stub) { migration_stub(:FirewallRule) } - let(:reserve_stub) { Spec::Support::MigrationStubs.reserved_stub } - - migration_context :up do - it "Migrates Reserves data to columns on FirewallRule" do - fr = firewall_rule_stub.create! - reserve_stub.create!( - :resource_type => "FirewallRule", - :resource_id => fr.id, - :reserved => { - :ems_ref => "10075435-0ef2-4b46-aa10-0b78f70715d9", - :network_protocol => "IPV4" - } - ) - - migrate - - # Expect counts - expect(reserve_stub.count).to eq(0) - expect(firewall_rule_stub.count).to eq(1) - - # Expect data - expect(fr.reload.ems_ref).to eq("10075435-0ef2-4b46-aa10-0b78f70715d9") - expect(fr.reload.network_protocol).to eq("IPV4") - end - end - - migration_context :down do - it "Migrates Reserves data to Reserves table" do - data = { - :ems_ref => "10075435-0ef2-4b46-aa10-0b78f70715d9", - :network_protocol => "IPV4" - } - - fr = firewall_rule_stub.create!(data) - - migrate - - # Expect counts - expect(reserve_stub.count).to eq(1) - expect(firewall_rule_stub.count).to eq(1) - - # Expect data - r = reserve_stub.first - expect(r.resource_id).to eq(fr.id) - expect(r.resource_type).to eq("FirewallRule") - expect(r.reserved).to eq(data) - end - end -end diff --git a/spec/migrations/20140218232357_add_group_and_user_columns_to_miq_widget_contents_spec.rb b/spec/migrations/20140218232357_add_group_and_user_columns_to_miq_widget_contents_spec.rb deleted file mode 100644 index f4759005e..000000000 --- a/spec/migrations/20140218232357_add_group_and_user_columns_to_miq_widget_contents_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require_migration - -describe AddGroupAndUserColumnsToMiqWidgetContents do - shared_examples "removing widget contents" do - let(:miq_widget_content_stub) { migration_stub(:MiqWidgetContent) } - - it "removes all existing widget content" do - miq_widget_content_stub.create! - - migrate - - expect(miq_widget_content_stub.all).to be_empty - end - end - - migration_context :up do - include_examples "removing widget contents" - end - - migration_context :down do - include_examples "removing widget contents" - end -end diff --git a/spec/migrations/20140301034340_leverage_authentications_for_registration_http_proxy_credentials_spec.rb b/spec/migrations/20140301034340_leverage_authentications_for_registration_http_proxy_credentials_spec.rb deleted file mode 100644 index 55a465e29..000000000 --- a/spec/migrations/20140301034340_leverage_authentications_for_registration_http_proxy_credentials_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -require_migration - -describe LeverageAuthenticationsForRegistrationHttpProxyCredentials do - let(:auth_stub) { migration_stub(:Authentication) } - let(:db_stub) { migration_stub(:MiqDatabase) } - - migration_context :up do - it "Moves registration_http_proxy credentials to an authentication" do - db_stub.create!( - :registration_http_proxy_username => "abc", - :registration_http_proxy_password => ManageIQ::Password.encrypt("def") - ) - - migrate - - # Expect counts - expect(auth_stub.count).to eq(1) - expect(db_stub.count).to eq(1) - - # Expect data - auth = auth_stub.first - db = db_stub.first - - expect(auth.userid).to eq("abc") - expect(auth.password).to be_encrypted("def") - expect { db.registration_http_proxy_username }.to raise_error(NoMethodError) - expect { db.registration_http_proxy_password }.to raise_error(NoMethodError) - end - end - - migration_context :down do - it "Moves registration_http_proxy credentials from Authentications to MiqDatabases" do - db = db_stub.create! - auth_stub.create!( - :authtype => "registration_http_proxy", - :name => "MiqDatabase vmdb_development", - :userid => "abc", - :password => ManageIQ::Password.encrypt("def"), - :resource_id => db.id, - :resource_type => "MiqDatabase", - :type => "AuthUseridPassword" - ) - - migrate - - # Expect counts - expect(auth_stub.count).to eq(0) - expect(db_stub.count).to eq(1) - - # Expect data - db = db.reload - expect(db.registration_http_proxy_username).to eq("abc") - expect(db.registration_http_proxy_password).to be_encrypted("def") - end - end -end diff --git a/spec/migrations/20140402134329_change_utc_time_profile_type_to_global_spec.rb b/spec/migrations/20140402134329_change_utc_time_profile_type_to_global_spec.rb deleted file mode 100644 index ff650d494..000000000 --- a/spec/migrations/20140402134329_change_utc_time_profile_type_to_global_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_migration - -describe ChangeUtcTimeProfileTypeToGlobal do - migration_context :up do - let(:time_profile_stub) { migration_stub(:TimeProfile) } - - it 'default UTC Time Profile gets updated' do - tp = time_profile_stub.create!(:description => 'UTC', :profile_type => nil) - - migrate - - tp.reload - expect(tp.profile_type).to eq('global') - end - end -end diff --git a/spec/migrations/20140409134713_move_log_collection_depot_settings_to_file_depot_spec.rb b/spec/migrations/20140409134713_move_log_collection_depot_settings_to_file_depot_spec.rb deleted file mode 100644 index 35a5f9a6b..000000000 --- a/spec/migrations/20140409134713_move_log_collection_depot_settings_to_file_depot_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require_migration - -describe MoveLogCollectionDepotSettingsToFileDepot do - let(:authentication_stub) { migration_stub(:Authentication) } - let(:configuration_stub) { migration_stub(:Configuration) } - let(:file_depot_stub) { migration_stub(:FileDepot) } - let(:zone_stub) { migration_stub(:Zone) } - - migration_context :up do - it "Moves log depot settings to FileDepot table" do - server_settings = { - "log_depot" => { - "username" => "user", - "password" => "pass", - "uri" => "ftp://ftp.example.com/dir" - } - } - - zone_settings = { - :log_depot => { - :username => "user", - :password => "pass", - :uri => "smb://server.example.com/path" - } - } - - configuration_stub.create!(:typ => 'vmdb', :settings => server_settings) - zone_stub.create!(:name => "default", :settings => zone_settings) - - migrate - - expect(authentication_stub.count).to eq(2) - expect(configuration_stub.count).to eq(1) - expect(file_depot_stub.count).to eq(2) - expect(zone_stub.count).to eq(1) - - expect(configuration_stub.first.settings).to be_blank - expect(zone_stub.first.settings).to be_blank - end - end -end diff --git a/spec/migrations/20140410132430_subclass_file_depot_by_protocol_spec.rb b/spec/migrations/20140410132430_subclass_file_depot_by_protocol_spec.rb deleted file mode 100644 index 863b5d8ee..000000000 --- a/spec/migrations/20140410132430_subclass_file_depot_by_protocol_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_migration - -describe SubclassFileDepotByProtocol do - let(:file_depot_stub) { migration_stub(:FileDepot) } - - migration_context :up do - it "Sets type on existing FileDepot records" do - ["ftp", "nfs", "smb"].each { |type| file_depot_stub.create!(:name => "#{type} depot", :uri => "#{type}://example.com/share") } - - expect(file_depot_stub.count).to eq(3) - - migrate - - expect(file_depot_stub.where(:type => "FileDepotFtp").count).to eq(1) - expect(file_depot_stub.where(:type => "FileDepotNfs").count).to eq(1) - expect(file_depot_stub.where(:type => "FileDepotSmb").count).to eq(1) - end - - it "Removes invalid records" do - [nil, "", "aaa"].each { |type| file_depot_stub.create!(:uri => type) } - - expect(file_depot_stub.count).to eq(3) - - migrate - - expect(file_depot_stub.count).to eq(0) - end - end -end diff --git a/spec/migrations/20140421150958_create_miq_groups_users_join_table_spec.rb b/spec/migrations/20140421150958_create_miq_groups_users_join_table_spec.rb deleted file mode 100644 index 273a235ce..000000000 --- a/spec/migrations/20140421150958_create_miq_groups_users_join_table_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_migration - -describe CreateMiqGroupsUsersJoinTable do - migration_context :up do - let(:user_stub) { migration_stub(:User) } - let(:join_table_stub) { migration_stub(:MiqGroupsUsers) } - let(:reserve_stub) { Spec::Support::MigrationStubs.reserved_stub } - - it "migrates eligible_miq_group_ids from reserved column" do - user = user_stub.create! - reserve_stub.create!(:resource_type => "User", - :resource_id => user.id, - :reserved => {:eligible_miq_group_ids => [101, 108, 111]} - ) - expect(reserve_stub.count).to eq(1) - - migrate - - expect(reserve_stub.count).to eq(0) - expect(join_table_stub.where(:user_id => user.id).pluck(:miq_group_id)).to match_array [101, 108, 111] - end - - it "ignores users with no eligible_miq_group_ids" do - user = user_stub.create!(:userid => "test") - - migrate - - expect(join_table_stub.where(:user_id => user.id).count).to eq(0) - end - end -end diff --git a/spec/migrations/20140424173120_migrate_automate_to_customer_domain_spec.rb b/spec/migrations/20140424173120_migrate_automate_to_customer_domain_spec.rb deleted file mode 100644 index 8ed5a793e..000000000 --- a/spec/migrations/20140424173120_migrate_automate_to_customer_domain_spec.rb +++ /dev/null @@ -1,150 +0,0 @@ -require_migration - -describe MigrateAutomateToCustomerDomain do - let(:miq_ae_namespace_stub) { migration_stub(:MiqAeNamespace) } - let(:miq_ae_class_stub) { migration_stub(:MiqAeClass) } - - migration_context :up do - before do - migration_stub(:MiqAeNamespace).create!(:name => '$') - end - - context 'migrates root namespace to customer domain' do - it 'with a single namespace' do - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test') - - migrate - - test_ns.reload - - expect(miq_ae_namespace_stub.where(:name => '$').first).not_to be_nil - - domain = miq_ae_namespace_stub.where(:name => 'Customer').first - expect(test_ns.parent_id).to eq(domain.id) - end - - it 'with existing Customer namespace' do - customer_ns = miq_ae_namespace_stub.create!(:name => 'Customer') - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test') - - migrate - - domain = miq_ae_namespace_stub.where(:name => 'Customer', :priority => 1).first - - test_ns.reload - customer_ns.reload - - expect(test_ns.parent_id).to eq(domain.id) - expect(customer_ns.parent_id).to eq(domain.id) - end - - it 'with existing domain' do - miq_ae_namespace_stub.create!(:name => 'ManageIQ', :priority => 0) - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test') - - migrate - - domain = miq_ae_namespace_stub.where(:name => 'Customer', :priority => 1).first - - test_ns.reload - - expect(test_ns.parent_id).to eq(domain.id) - end - - it 'with inherited class' do - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test') - ae_class = miq_ae_class_stub.create!(:inherits => 'ns_test/class1', :namespace_id => test_ns) - - migrate - - ae_class.reload - expect(ae_class.inherits).to eq('Customer/ns_test/class1') - end - - it 'with inherited class from another domain' do - miq_ae_namespace_stub.create!(:name => 'domain2', :priority => 2) - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test') - ae_class = miq_ae_class_stub.create!(:inherits => 'domain2/ns_test/class1', :namespace_id => test_ns) - - migrate - - ae_class.reload - expect(ae_class.inherits).to eq('domain2/ns_test/class1') - end - end - end - - migration_context :down do - before do - migration_stub(:MiqAeNamespace).create!(:name => '$') - end - - context 'migrates customer domain to root namespaces' do - it 'with a single namespace' do - domain = miq_ae_namespace_stub.create!(:name => 'Customer', :priority => 1) - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test', :parent_id => domain.id) - - migrate - - expect(miq_ae_namespace_stub.where(:name => '$').first).not_to be_nil - expect(miq_ae_namespace_stub.where(:name => 'Customer').first).to be_nil - - test_ns.reload - expect(test_ns.parent_id).to be_nil - end - - it 'with existing Customer namespace' do - domain = miq_ae_namespace_stub.create!(:name => 'Customer', :priority => 1) - customer_ns = miq_ae_namespace_stub.create!(:name => 'Customer', :parent_id => domain.id) - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test', :parent_id => domain.id) - - migrate - - expect(miq_ae_namespace_stub.where(:name => 'Customer').first).not_to be_nil - expect(miq_ae_namespace_stub.where(:name => 'Customer', :priority => 1).first).to be_nil - - test_ns.reload - customer_ns.reload - - expect(test_ns.parent_id).to be_nil - expect(customer_ns.parent_id).to be_nil - end - - it 'with existing domain' do - miq_ae_namespace_stub.create!(:name => 'ManageIQ', :priority => 0) - domain = miq_ae_namespace_stub.create!(:name => 'Customer', :priority => 1) - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test', :parent_id => domain.id) - - migrate - - expect(miq_ae_namespace_stub.where(:name => 'Customer').first).to be_nil - expect(miq_ae_namespace_stub.where(:name => 'ManageIQ').first).not_to be_nil - - test_ns.reload - expect(test_ns.parent_id).to be_nil - end - - it 'with inherited class' do - domain = miq_ae_namespace_stub.create!(:name => 'Customer', :priority => 1) - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test', :parent_id => domain.id) - ae_class = miq_ae_class_stub.create!(:inherits => 'Customer/ns_test/class1', :namespace_id => test_ns) - - migrate - - ae_class.reload - expect(ae_class.inherits).to eq('ns_test/class1') - end - - it 'with inherited class from another domain' do - miq_ae_namespace_stub.create!(:name => 'domain2', :priority => 2) - test_ns = miq_ae_namespace_stub.create!(:name => 'ns_test') - ae_class = miq_ae_class_stub.create!(:inherits => 'domain2/ns_test/class1', :namespace_id => test_ns) - - migrate - - ae_class.reload - expect(ae_class.inherits).to eq('domain2/ns_test/class1') - end - end - end -end diff --git a/spec/migrations/20140519211930_add_user_current_group_to_miq_groups_spec.rb b/spec/migrations/20140519211930_add_user_current_group_to_miq_groups_spec.rb deleted file mode 100644 index e122bc55a..000000000 --- a/spec/migrations/20140519211930_add_user_current_group_to_miq_groups_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -require_migration - -describe AddUserCurrentGroupToMiqGroups do - migration_context :up do - let(:miq_group_stub) { migration_stub(:MiqGroup) } - let(:user_stub) { migration_stub(:User) } - - it "add current_group to miq_groups if miq_groups empty" do - group = miq_group_stub.create! - user = user_stub.create!(:current_group => group) - - migrate - - expect(user.miq_groups).to match_array [group] - end - - it "add current_group to miq_groups if miq_groups not empty" do - group1 = miq_group_stub.create! - group2 = miq_group_stub.create! - user = user_stub.create!(:current_group => group2, :miq_groups => [group1, group2]) - - migrate - - expect(user.miq_groups).to match_array [group1, group2] - end - - it "skip if current_group is present in miq_groups" do - group = miq_group_stub.create! - user = user_stub.create!(:current_group => group, :miq_groups => [group]) - - migrate - - expect(user.miq_groups).to match_array [group] - end - - it "user's current_group is orphaned" do - # model code was broken and could leave the current group orphaned - group = miq_group_stub.create! - user = user_stub.create!(:current_group_id => (group.id + 1), :miq_groups => [group]) - - migrate - - user.reload - expect(user.miq_groups).to eq [group] - expect(user.current_group).to be_nil - expect(user.current_group_id).to be_nil - end - - it "current group is valid but not in miq_groups" do - group1 = miq_group_stub.create! - group2 = miq_group_stub.create! - user = user_stub.create!(:current_group => group2, :miq_groups => [group1]) - - migrate - - user.reload - expect(user.miq_groups).to match_array [group1, group2] - expect(user.current_group).to eql group2 - end - end -end diff --git a/spec/migrations/20140611194007_change_options_in_miq_alert_for_email_to_spec.rb b/spec/migrations/20140611194007_change_options_in_miq_alert_for_email_to_spec.rb deleted file mode 100644 index c02bea5e0..000000000 --- a/spec/migrations/20140611194007_change_options_in_miq_alert_for_email_to_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require_migration - -describe ChangeOptionsInMiqAlertForEmailTo do - migration_context :up do - let(:miq_alert_stub) { migration_stub(:MiqAlert) } - - it 'default string type miq_alert email is converted to the empty array' do - options = {:notifications => {:email => {:to => ''}}} - alert = miq_alert_stub.create!(:description => 'Test Alert', :options => options) - - migrate - - alert.reload - expect(alert.options).to eq(:notifications => {:email => {:to => []}}) - end - - it 'existing string type miq_alert emails are converted to an array' do - options = {:notifications => {:email => {:to => "mail1\nmail2\n"}}} - alert = miq_alert_stub.create!(:description => 'Test Alert', :options => options) - - migrate - - alert.reload - expect(alert.options).to eq(:notifications => {:email => {:to => %w(mail1 mail2)}}) - end - - it 'existing array type miq_alert emails remain unchanged' do - options = {:notifications => {:email => {:to => []}}} - alert = miq_alert_stub.create!(:description => 'Test Alert', :options => options) - - migrate - - alert.reload - expect(alert.options).to eq(options) - end - end -end diff --git a/spec/migrations/20140715200621_set_default_for_pxe_server_customization_directory_spec.rb b/spec/migrations/20140715200621_set_default_for_pxe_server_customization_directory_spec.rb deleted file mode 100644 index 3e3cdd7c6..000000000 --- a/spec/migrations/20140715200621_set_default_for_pxe_server_customization_directory_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require_migration - -describe SetDefaultForPxeServerCustomizationDirectory do - let(:pxe_server_stub) { migration_stub(:PxeServer) } - - migration_context :up do - it "Sets customization_directory to '' if nil" do - pxe_server_stub.create!(:name => "pxe_server_a", :uri => "nfs://example.com/share") - - expect(pxe_server_stub.count).to eq(1) - - migrate - - expect(pxe_server_stub.first.customization_directory).to eq('') - end - end -end diff --git a/spec/migrations/20140905020643_update_default_registration_channel_names_spec.rb b/spec/migrations/20140905020643_update_default_registration_channel_names_spec.rb deleted file mode 100644 index 83f24e50f..000000000 --- a/spec/migrations/20140905020643_update_default_registration_channel_names_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_migration - -describe UpdateDefaultRegistrationChannelNames do - let(:miq_database_stub) { migration_stub(:MiqDatabase) } - - migration_context :up do - it "Updates the default registration channel names for v5.3" do - miq_database_stub.create!(:update_repo_name => "cf-me-5.2-for-rhel-6-rpms") - - expect(miq_database_stub.count).to eq(1) - expect(miq_database_stub.first.update_repo_name).to eq("cf-me-5.2-for-rhel-6-rpms") - - migrate - - expect(miq_database_stub.first.update_repo_name).to eq("cf-me-5.3-for-rhel-6-rpms rhel-server-rhscl-6-rpms") - end - - it "Skips non-default channels" do - miq_database_stub.create!(:update_repo_name => "not-default") - - expect(miq_database_stub.count).to eq(1) - expect(miq_database_stub.first.update_repo_name).to eq("not-default") - - migrate - - expect(miq_database_stub.first.update_repo_name).to eq("not-default") - end - end -end diff --git a/spec/migrations/20140918140859_add_cloud_tenant_sti_column_spec.rb b/spec/migrations/20140918140859_add_cloud_tenant_sti_column_spec.rb deleted file mode 100644 index 46cd5f731..000000000 --- a/spec/migrations/20140918140859_add_cloud_tenant_sti_column_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_migration - -describe AddCloudTenantStiColumn do - let(:cloud_tenant_stub) { migration_stub(:CloudTenant) } - - migration_context :up do - it "Sets the default type for Cloud Tenant records to 'CloudTenantOpenstack'" do - cloud_tenant_stub.create!(:name => "tenant 1") - cloud_tenant_stub.create!(:name => "tenant 2") - - migrate - - cloud_tenant_stub.all.each { |tenant| expect(tenant.type).to eq("CloudTenantOpenstack") } - end - end -end diff --git a/spec/migrations/20140918154013_add_provider_region_to_ext_management_systems_spec.rb b/spec/migrations/20140918154013_add_provider_region_to_ext_management_systems_spec.rb deleted file mode 100644 index c16da1ef2..000000000 --- a/spec/migrations/20140918154013_add_provider_region_to_ext_management_systems_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -require_migration - -describe AddProviderRegionToExtManagementSystems do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it "Updates the provider_region and hostname columns" do - e1 = ems_stub.create!(:type => "EmsAmazon", :hostname => "us-east-1") - e2 = ems_stub.create!(:type => "EmsAmazon", :hostname => "us-west-1") - e3 = ems_stub.create!(:type => "EmsOther", :hostname => "my.org") - - migrate - - e1.reload - e2.reload - e3.reload - - expect(e1.provider_region).to eq("us-east-1") - expect(e1.hostname).to be_nil - expect(e2.provider_region).to eq("us-west-1") - expect(e2.hostname).to be_nil - expect(e3.provider_region).to be_nil - expect(e3.hostname).to eq("my.org") - end - end - - migration_context :down do - it "Updates the hostname columns" do - e1 = ems_stub.create!(:type => "EmsAmazon", :provider_region => "us-east-1", :hostname => nil) - e2 = ems_stub.create!(:type => "EmsAmazon", :provider_region => "us-west-1", :hostname => nil) - e3 = ems_stub.create!(:type => "EmsOther", :provider_region => nil, :hostname => "my.org") - - migrate - - e1.reload - e2.reload - e3.reload - - expect(e1.hostname).to eq("us-east-1") - expect(e2.hostname).to eq("us-west-1") - expect(e3.hostname).to eq("my.org") - end - end -end diff --git a/spec/migrations/20141015170920_remove_vdi_tab_from_miq_dialogs_spec.rb b/spec/migrations/20141015170920_remove_vdi_tab_from_miq_dialogs_spec.rb deleted file mode 100644 index 29961b544..000000000 --- a/spec/migrations/20141015170920_remove_vdi_tab_from_miq_dialogs_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_migration - -describe RemoveVdiTabFromMiqDialogs do - let(:miq_dialog_stub) { migration_stub(:MiqDialog) } - - migration_context :up do - it "Remove VDI tab from Provision dialogs" do - d1 = miq_dialog_stub.create!( - :name => 'test', - :dialog_type => 'MiqProvisionWorkflow', - :content => { - :dialogs => { - :requester => {}, - :vdi => {} - }, - :dialog_order => [:requester, :vdi] - } - ) - - migrate - - d1.reload - expect(d1.content[:dialogs].keys).to eq([:requester]) - expect(d1.content[:dialog_order]).to eq([:requester]) - end - end -end diff --git a/spec/migrations/20141021103820_remove_miq_search_vdi_instances_spec.rb b/spec/migrations/20141021103820_remove_miq_search_vdi_instances_spec.rb deleted file mode 100644 index f8a527209..000000000 --- a/spec/migrations/20141021103820_remove_miq_search_vdi_instances_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require_migration - -describe RemoveMiqSearchVdiInstances do - let(:miq_search_stub) { migration_stub(:MiqSearch) } - - migration_context :up do - it 'Remove MiqSearch instance for VdiUser' do - miq_search_stub.create!(:db => 'VdiUser') - miq_search_stub.create!(:db => 'Vm') - - migrate - - rows = miq_search_stub.all - expect(rows.length).to eq(1) - expect(rows.first.db).to eq('Vm') - end - end -end diff --git a/spec/migrations/20141121200153_migrate_ems_attributes_to_endpoints_spec.rb b/spec/migrations/20141121200153_migrate_ems_attributes_to_endpoints_spec.rb deleted file mode 100644 index bf3ad2043..000000000 --- a/spec/migrations/20141121200153_migrate_ems_attributes_to_endpoints_spec.rb +++ /dev/null @@ -1,85 +0,0 @@ -require_migration - -describe MigrateEmsAttributesToEndpoints do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:endpoint_stub) { migration_stub(:Endpoint) } - - migration_context :up do - it 'migrates EMS attributes to endpoints' do - ems = ems_stub.create!( - :ipaddress => "1.2.3.4", - :hostname => "example.org", - :port => "123" - ) - - migrate - - expect(endpoint_stub.count).to eq(1) - expect(endpoint_stub.first).to have_attributes( - :role => "default", - :ipaddress => "1.2.3.4", - :hostname => "example.org", - :port => 123, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - end - - it 'handles nil port value properly' do - ems_stub.create!( - :ipaddress => "1.2.3.4", - :hostname => "example.org", - ) - - migrate - - expect(endpoint_stub.first).to have_attributes( - :ipaddress => "1.2.3.4", - :hostname => "example.org", - :port => nil, - ) - end - end - - migration_context :down do - it 'migrates endpoints to EMS attributes' do - ems = ems_stub.create! - endpoint_stub.create!( - :role => "default", - :ipaddress => "1.2.3.4", - :hostname => "example.org", - :port => 123, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - - migrate - - expect(endpoint_stub.count).to eq(0) - expect(ems.reload).to have_attributes( - :ipaddress => "1.2.3.4", - :hostname => "example.org", - :port => "123", - ) - end - - it 'handles nil port value properly' do - ems = ems_stub.create! - endpoint_stub.create!( - :role => "default", - :ipaddress => "1.2.3.4", - :hostname => "example.org", - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - - migrate - - expect(ems.reload).to have_attributes( - :ipaddress => "1.2.3.4", - :hostname => "example.org", - :port => nil, - ) - end - end -end diff --git a/spec/migrations/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields_spec.rb b/spec/migrations/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields_spec.rb deleted file mode 100644 index de74145bb..000000000 --- a/spec/migrations/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields_spec.rb +++ /dev/null @@ -1,63 +0,0 @@ -require_migration - -describe ConvertShowRefreshButtonAndLoadValuesOnInitToRealColumnsForDialogFields do - let(:dialog_field_stub) { migration_stub(:DialogField) } - - migration_context :up do - it "migrates options[:show_refresh_button] to a column and removes that option" do - dialog_field = dialog_field_stub.create!( - :name => "test", - :options => {:show_refresh_button => true, :load_values_on_init => true} - ) - - migrate - - dialog_field.reload - expect(dialog_field.options[:show_refresh_button]).to be_nil - expect(dialog_field.show_refresh_button).to be(true) - end - - it "migrates options[:load_values_on_init] to a column and removes that option" do - dialog_field = dialog_field_stub.create!( - :name => "test", - :options => {:show_refresh_button => true, :load_values_on_init => true} - ) - - migrate - - dialog_field.reload - expect(dialog_field.options[:load_values_on_init]).to be_nil - expect(dialog_field.load_values_on_init).to be(true) - end - end - - migration_context :down do - it "migrates the column back to options[:show_refresh_button]" do - dialog_field = dialog_field_stub.create!( - :name => "test", - :show_refresh_button => true, - :load_values_on_init => true, - :options => {} - ) - - migrate - - dialog_field.reload - expect(dialog_field.options[:show_refresh_button]).to be(true) - end - - it "migrates the column back to options[:load_values_on_init]" do - dialog_field = dialog_field_stub.create!( - :name => "test", - :show_refresh_button => true, - :load_values_on_init => true, - :options => {} - ) - - migrate - - dialog_field.reload - expect(dialog_field.options[:load_values_on_init]).to be(true) - end - end -end diff --git a/spec/migrations/20141219222843_remove_miq_worker_rows_without_model_spec.rb b/spec/migrations/20141219222843_remove_miq_worker_rows_without_model_spec.rb deleted file mode 100644 index b05c4b6bf..000000000 --- a/spec/migrations/20141219222843_remove_miq_worker_rows_without_model_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -require_migration - -describe RemoveMiqWorkerRowsWithoutModel do - migration_context :up do - let(:worker_stub) { migration_stub(:MiqWorker) } - - it "Removes rows where the model was deleted" do - worker_stub.create!(:type => "MiqWorkerMonitor") - worker_stub.create!(:type => "MiqStorageStatsCollectorWorker") - worker_stub.create!(:type => "MiqPerfCollectorWorker") - worker_stub.create!(:type => "MiqPerfProcessorWorker") - not_orphaned = worker_stub.create! - - expect(worker_stub.count).to eql 5 - - migrate - - expect(worker_stub.first).to eql not_orphaned - expect(worker_stub.count).to eql 1 - end - end -end diff --git a/spec/migrations/20150109142457_namespace_ems_classes_spec.rb b/spec/migrations/20150109142457_namespace_ems_classes_spec.rb deleted file mode 100644 index 785603e76..000000000 --- a/spec/migrations/20150109142457_namespace_ems_classes_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_migration - -describe NamespaceEmsClasses do - class NamespaceEmsClasses::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it "migrates a representative row" do - ems = ems_stub.create!(:type => "EmsInfra") - - migrate - - expect(ems.reload).to have_attributes(:type => "ManageIQ::Providers::InfraManager") - end - end - - migration_context :down do - it "migrates a representative row" do - ems = ems_stub.create!(:type => "ManageIQ::Providers::InfraManager") - - migrate - - expect(ems.reload).to have_attributes(:type => "EmsInfra") - end - end -end diff --git a/spec/migrations/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves_spec.rb b/spec/migrations/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves_spec.rb deleted file mode 100644 index d81ae40c7..000000000 --- a/spec/migrations/20150206150955_migrate_miq_database_registration_organization_display_name_out_of_reserves_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require_migration - -describe MigrateMiqDatabaseRegistrationOrganizationDisplayNameOutOfReserves do - let(:db_stub) { migration_stub(:MiqDatabase) } - let(:reserve_stub) { Spec::Support::MigrationStubs.reserved_stub } - - migration_context :up do - it "Migrates :registration_organization_display_name from Reserves table to new column on MiqDatabase" do - db = db_stub.create! - reserve_stub.create!( - :resource_type => "MiqDatabase", - :resource_id => db.id, - :reserved => { - :registration_organization_display_name => "abc" - } - ) - - migrate - - # Expect counts - expect(reserve_stub.count).to eq(0) - expect(db_stub.count).to eq(1) - - # Expect data - expect(db.reload.registration_organization_display_name).to eq("abc") - end - end - - migration_context :down do - it "Migrates :registration_organization_display_name from column on MiqDatabase to Reserves table" do - db = db_stub.create!(:registration_organization_display_name => "abc") - - migrate - - # Expect counts - expect(reserve_stub.count).to eq(1) - expect(db_stub.count).to eq(1) - - # Expect data - expect(reserve_stub.first.resource_id).to eq(db.id) - expect(reserve_stub.first.resource_type).to eq("MiqDatabase") - expect(reserve_stub.first.reserved).to eq(:registration_organization_display_name => "abc") - end - end -end diff --git a/spec/migrations/20150224164512_add_loopback_to_memcache_server_opts_in_configuration_spec.rb b/spec/migrations/20150224164512_add_loopback_to_memcache_server_opts_in_configuration_spec.rb deleted file mode 100644 index 1e8d6b60e..000000000 --- a/spec/migrations/20150224164512_add_loopback_to_memcache_server_opts_in_configuration_spec.rb +++ /dev/null @@ -1,49 +0,0 @@ -require_migration - -describe AddLoopbackToMemcacheServerOptsInConfiguration do - let(:configuration_stub) { migration_stub(:Configuration) } - - migration_context :up do - it "leaves custom memcache_server_opts" do - custom_binding = "-l 0.0.0.0" - with_custom = {"session" => {"memcache_server_opts" => custom_binding}} - config = configuration_stub.create!(:typ => 'vmdb', :settings => with_custom) - - migrate - - expect(config.reload.settings.fetch_path("session", "memcache_server_opts")).to eq(custom_binding) - end - - it "adds listen on localhost binding to memcache_server_opts" do - default_binding = "-l 127.0.0.1" - with_blank = {"session" => {"memcache_server_opts" => ""}} - config = configuration_stub.create!(:typ => 'vmdb', :settings => with_blank) - - migrate - - expect(config.reload.settings.fetch_path("session", "memcache_server_opts")).to eq(default_binding) - end - end - - migration_context :down do - it "leaves custom memcache_server_opts" do - custom_binding = "-l 0.0.0.0" - with_custom = {"session" => {"memcache_server_opts" => custom_binding}} - config = configuration_stub.create!(:typ => 'vmdb', :settings => with_custom) - - migrate - - expect(config.reload.settings.fetch_path("session", "memcache_server_opts")).to eq(custom_binding) - end - - it "reverts listen on localhost binding to blank option" do - default_binding = "-l 127.0.0.1" - with_blank = {"session" => {"memcache_server_opts" => default_binding}} - config = configuration_stub.create!(:typ => 'vmdb', :settings => with_blank) - - migrate - - expect(config.reload.settings.fetch_path("session", "memcache_server_opts")).to eq("") - end - end -end diff --git a/spec/migrations/20150224192716_migrate_configuration_manager_to_ems_spec.rb b/spec/migrations/20150224192716_migrate_configuration_manager_to_ems_spec.rb deleted file mode 100644 index 4ffb6eb89..000000000 --- a/spec/migrations/20150224192716_migrate_configuration_manager_to_ems_spec.rb +++ /dev/null @@ -1,77 +0,0 @@ -require_migration - -describe MigrateConfigurationManagerToEms do - let(:config_manager_stub) { migration_stub(:ConfigurationManager) } - let(:config_system_stub) { migration_stub(:ConfiguredSystem) } - let(:config_profile_stub) { migration_stub(:ConfigurationProfile) } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it "migrates configuration_managers to ext_management_systems" do - manager = config_manager_stub.create!( - :type => "ConfigurationManagerForeman", - :provider_id => 99, - :last_refresh_error => "xxx", - :last_refresh_date => Time.now.utc - ) - systems = 2.times.collect do - config_system_stub.create!(:configuration_manager_id => manager.id) - end - profiles = 2.times.collect do - config_profile_stub.create!(:configuration_manager_id => manager.id) - end - - migrate - - expect(ems_stub.count).to eq(1) - ems = ems_stub.first - expect(ems).to have_attributes( - manager.attributes.slice("type", "provider_id", "last_refresh_error") - ) - expect(manager.last_refresh_date).to be_within(0.001.seconds).of(ems.last_refresh_date) - expect(ems.guid).to_not be_nil - - systems.each do |s| - expect(s.reload.configuration_manager_id).to eq(ems.id) - end - - profiles.each do |p| - expect(p.reload.configuration_manager_id).to eq(ems.id) - end - end - end - - migration_context :down do - it "migrates ext_management_systems to configuration_managers" do - ems = ems_stub.create!( - :type => "ConfigurationManagerForeman", - :provider_id => 99, - :last_refresh_error => "xxx", - :last_refresh_date => Time.now.utc - ) - systems = 2.times.collect do - config_system_stub.create!(:configuration_manager_id => ems.id) - end - profiles = 2.times.collect do - config_profile_stub.create!(:configuration_manager_id => ems.id) - end - - migrate - - expect(config_manager_stub.count).to eq(1) - manager = config_manager_stub.first - expect(manager).to have_attributes( - ems.attributes.slice("type", "provider_id", "last_refresh_error") - ) - expect(manager.last_refresh_date).to be_within(0.001.seconds).of(ems.last_refresh_date) - - systems.each do |s| - expect(s.reload.configuration_manager_id).to eq(manager.id) - end - - profiles.each do |p| - expect(p.reload.configuration_manager_id).to eq(manager.id) - end - end - end -end diff --git a/spec/migrations/20150224192816_migrate_provisioning_manager_to_ems_spec.rb b/spec/migrations/20150224192816_migrate_provisioning_manager_to_ems_spec.rb deleted file mode 100644 index 3bf781b7c..000000000 --- a/spec/migrations/20150224192816_migrate_provisioning_manager_to_ems_spec.rb +++ /dev/null @@ -1,77 +0,0 @@ -require_migration - -describe MigrateProvisioningManagerToEms do - let(:prov_manager_stub) { migration_stub(:ProvisioningManager) } - let(:os_flavor_stub) { migration_stub(:OperatingSystemFlavor) } - let(:cust_script_stub) { migration_stub(:CustomizationScript) } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it "migrates provisioning_managers to ext_management_systems" do - manager = prov_manager_stub.create!( - :type => "ProvisioningManagerForeman", - :provider_id => 99, - :last_refresh_error => "xxx", - :last_refresh_date => Time.now.utc - ) - os_flavors = 2.times.collect do - os_flavor_stub.create!(:provisioning_manager_id => manager.id) - end - scripts = 2.times.collect do - cust_script_stub.create!(:provisioning_manager_id => manager.id) - end - - migrate - - expect(ems_stub.count).to eq(1) - ems = ems_stub.first - expect(ems).to have_attributes( - manager.attributes.slice("type", "provider_id", "last_refresh_error") - ) - expect(manager.last_refresh_date).to be_within(0.001.seconds).of(ems.last_refresh_date) - expect(ems.guid).to_not be_nil - - os_flavors.each do |f| - expect(f.reload.provisioning_manager_id).to eq(ems.id) - end - - scripts.each do |s| - expect(s.reload.provisioning_manager_id).to eq(ems.id) - end - end - end - - migration_context :down do - it "migrates ext_management_systems to provisioning_managers" do - ems = ems_stub.create!( - :type => "ProvisioningManagerForeman", - :provider_id => 99, - :last_refresh_error => "xxx", - :last_refresh_date => Time.now.utc - ) - os_flavors = 2.times.collect do - os_flavor_stub.create!(:provisioning_manager_id => ems.id) - end - scripts = 2.times.collect do - cust_script_stub.create!(:provisioning_manager_id => ems.id) - end - - migrate - - expect(prov_manager_stub.count).to eq(1) - manager = prov_manager_stub.first - expect(manager).to have_attributes( - ems.attributes.slice("type", "provider_id", "last_refresh_error") - ) - expect(manager.last_refresh_date).to be_within(0.001.seconds).of(ems.last_refresh_date) - - os_flavors.each do |f| - expect(f.reload.provisioning_manager_id).to eq(manager.id) - end - - scripts.each do |s| - expect(s.reload.provisioning_manager_id).to eq(manager.id) - end - end - end -end diff --git a/spec/migrations/20150311181430_add_draft_to_orchestration_templates_spec.rb b/spec/migrations/20150311181430_add_draft_to_orchestration_templates_spec.rb deleted file mode 100644 index 2b39a3a1a..000000000 --- a/spec/migrations/20150311181430_add_draft_to_orchestration_templates_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe AddDraftToOrchestrationTemplates do - let(:orchestration_template_stub) { migration_stub(:OrchestrationTemplate) } - - migration_context :up do - it "sets false to draft column" do - orchestration_template = orchestration_template_stub.create! - - migrate - - expect(orchestration_template.reload.draft).to be_falsey - end - end -end diff --git a/spec/migrations/20150316175916_update_miq_database_default_update_repo_name_spec.rb b/spec/migrations/20150316175916_update_miq_database_default_update_repo_name_spec.rb deleted file mode 100644 index 19fec7edf..000000000 --- a/spec/migrations/20150316175916_update_miq_database_default_update_repo_name_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -require_migration - -describe UpdateMiqDatabaseDefaultUpdateRepoName do - let(:db_stub) { migration_stub(:MiqDatabase) } - - migration_context :up do - [ - ["Satellite 5 without scl repo", "rhel-x86_64-server-6-cf-me-3", "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1"], - ["Satellite 5 with scl repo", "rhel-x86_64-server-6-cf-me-3.1 rhel-x86_64-server-6-rhscl-1", "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1"], - ["Satellite 6", "cf-me-5.3-for-rhel-6-rpms rhel-server-rhscl-6-rpms", "cf-me-5.4-for-rhel-6-rpms rhel-server-rhscl-6-rpms"], - ].each do |name, existing_repo, desired_repo| - it name do - db = db_stub.create!(:update_repo_name => existing_repo) - - migrate - - expect(db.reload.update_repo_name).to eq(desired_repo) - end - end - end - - migration_context :down do - [ - ["Satellite 5", "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1", "rhel-x86_64-server-6-cf-me-3.1 rhel-x86_64-server-6-rhscl-1"], - ["Satellite 6", "cf-me-5.4-for-rhel-6-rpms rhel-server-rhscl-6-rpms", "cf-me-5.3-for-rhel-6-rpms rhel-server-rhscl-6-rpms"], - ].each do |name, existing_repo, desired_repo| - it name do - db = db_stub.create!(:update_repo_name => existing_repo) - - migrate - - expect(db.reload.update_repo_name).to eq(desired_repo) - end - end - end -end diff --git a/spec/migrations/20150330214408_add_file_depot_id_to_miq_schedule_spec.rb b/spec/migrations/20150330214408_add_file_depot_id_to_miq_schedule_spec.rb deleted file mode 100644 index 20f1ba9d7..000000000 --- a/spec/migrations/20150330214408_add_file_depot_id_to_miq_schedule_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_migration - -describe AddFileDepotIdToMiqSchedule do - let(:depot_stub) { migration_stub(:FileDepot) } - let(:schedule_stub) { migration_stub(:MiqSchedule) } - - migration_context :up do - it "up" do - schedule = schedule_stub.create! - depot = depot_stub.create!(:resource_type => "MiqSchedule", :resource_id => schedule.id) - - migrate - - expect(schedule.reload.file_depot_id).to eq(depot.id) - end - end - - migration_context :down do - it "down" do - depot = depot_stub.create! - schedule = schedule_stub.create!(:file_depot_id => depot.id) - - migrate - - expect(depot.reload.resource_id).to eq(schedule.id) - expect(depot.reload.resource_type).to eq("MiqSchedule") - end - end -end diff --git a/spec/migrations/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag_spec.rb b/spec/migrations/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag_spec.rb deleted file mode 100644 index c42f0b538..000000000 --- a/spec/migrations/20150331104323_change_dialog_field_dynamic_lists_to_dialog_field_drop_down_list_with_dynamic_flag_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_migration - -describe ChangeDialogFieldDynamicListsToDialogFieldDropDownListWithDynamicFlag do - let(:dialog_field_stub) { migration_stub(:DialogField) } - - migration_context :up do - it "migrates existing dynamic lists to drop down lists" do - dialog_field = dialog_field_stub.create!(:type => "DialogFieldDynamicList") - - migrate - - dialog_field.reload - expect(dialog_field.type).to eq("DialogFieldDropDownList") - expect(dialog_field.dynamic).to be_truthy - end - end - - migration_context :down do - it "migrates existing drop down lists with dynamic flag to dynamic lists" do - dialog_field = dialog_field_stub.create!(:type => "DialogFieldDropDownList") - dialog_field_2 = dialog_field_stub.create!(:dynamic => true, :type => "DialogFieldDropDownList") - - migrate - - dialog_field.reload - dialog_field_2.reload - expect(dialog_field.type).to eq("DialogFieldDropDownList") - expect(dialog_field.dynamic).to be_falsey - expect(dialog_field_2.type).to eq("DialogFieldDynamicList") - expect(dialog_field_2.dynamic).to be_falsey - end - end -end diff --git a/spec/migrations/20150405141637_remove_port_config_from_container_service_spec.rb b/spec/migrations/20150405141637_remove_port_config_from_container_service_spec.rb deleted file mode 100644 index b908045b7..000000000 --- a/spec/migrations/20150405141637_remove_port_config_from_container_service_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require_migration - -describe RemovePortConfigFromContainerService do - let(:container_service_stub) { migration_stub(:ContainerService) } - let(:container_service_port_config_stub) { migration_stub(:ContainerServicePortConfig) } - - migration_context :up do - it 'Moves port, protocol and host(target)-port to container_service_port_config table' do - service = container_service_stub.create!(:ems_ref => "test_ref", - :name => "test_service", - :protocol => "TCP", - :port => 1111, - :container_port => 2222) - migrate - pconfig = container_service_port_config_stub.where(:container_service_id => service.id).first - expect(pconfig.protocol).to eq("TCP") - expect(pconfig.port).to eq(1111) - expect(pconfig.target_port).to eq("2222") # container_port:integer turns into target_port:string - end - end - - migration_context :down do - it 'Moves port, protocol and target_port back to container_service table' do - service = container_service_stub.create!(:ems_ref => "test_ref", - :name => "test_service") - container_service_port_config_stub.create!(:container_service_id => service.id, - :protocol => "TCP", - :port => 1111, - :target_port => "2222") - migrate - service.reload - expect(service.protocol).to eq("TCP") - expect(service.port).to eq(1111) - expect(service.container_port).to eq(2222) - end - end -end diff --git a/spec/migrations/20150407144345_add_kerberos_to_ext_management_system_spec.rb b/spec/migrations/20150407144345_add_kerberos_to_ext_management_system_spec.rb deleted file mode 100644 index 507f562d8..000000000 --- a/spec/migrations/20150407144345_add_kerberos_to_ext_management_system_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -require_migration - -describe AddKerberosToExtManagementSystem do - let(:reserve_stub) { Spec::Support::MigrationStubs.reserved_stub } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it "Migrates Reserves data to columns on ExtManagementSystem" do - ems = ems_stub.create! - reserve_stub.create!( - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :reserved => { - :security_protocol => "kerberos", - :realm => "pretendrealm" - } - ) - - migrate - - # Expect counts - expect(reserve_stub.count).to eq(0) - expect(ems_stub.count).to eq(1) - - # Expect data - expect(ems.reload.security_protocol).to eq("kerberos") - expect(ems.reload.realm).to eq("pretendrealm") - end - end - - migration_context :down do - it "Migrates Reserves data to Reserves table" do - data = { - :security_protocol => "kerberos", - :realm => "pretendrealm" - } - - ems = ems_stub.create!(data) - - migrate - - # Expect counts - expect(reserve_stub.count).to eq(1) - expect(ems_stub.count).to eq(1) - - # Expect data - r = reserve_stub.first - expect(r.resource_id).to eq(ems.id) - expect(r.resource_type).to eq("ExtManagementSystem") - expect(r.reserved).to eq(data) - end - end -end diff --git a/spec/migrations/20150501193927_default_provider_verify_ssl_spec.rb b/spec/migrations/20150501193927_default_provider_verify_ssl_spec.rb deleted file mode 100644 index ebbeeb116..000000000 --- a/spec/migrations/20150501193927_default_provider_verify_ssl_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require_migration - -describe DefaultProviderVerifySsl do - migration_context :up do - let(:provider_stub) { migration_stub(:Provider) } - - it "resets nil values to OpenSSL::SSL::VERIFY_PEER" do - changed = provider_stub.create!(:verify_ssl => nil) - ignored = provider_stub.create!(:verify_ssl => OpenSSL::SSL::VERIFY_NONE) - - migrate - - expect(changed.reload.verify_ssl).to eq OpenSSL::SSL::VERIFY_PEER - expect(ignored.reload.verify_ssl).to eq OpenSSL::SSL::VERIFY_NONE - end - end -end diff --git a/spec/migrations/20150522161336_add_container_entities_type_spec.rb b/spec/migrations/20150522161336_add_container_entities_type_spec.rb deleted file mode 100644 index 20dd6340c..000000000 --- a/spec/migrations/20150522161336_add_container_entities_type_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require_migration - -describe AddContainerEntitiesType do - let(:container_node_stub) { migration_stub(:ContainerNode) } - let(:container_stub) { migration_stub(:Container) } - let(:container_group_stub) { migration_stub(:ContainerGroup) } - - migration_context :up do - it "up" do - container_node = container_node_stub.create! - container = container_stub.create! - container_group = container_group_stub.create! - - migrate - - expect(container_node.reload).to have_attributes(:type => "ContainerNodeKubernetes") - expect(container.reload).to have_attributes(:type => "ContainerKubernetes") - expect(container_group.reload).to have_attributes(:type => "ContainerGroupKubernetes") - end - end - - migration_context :down do - it "down" do - container_node = container_node_stub.create!(:type => "ContainerNodeKubernetes") - container = container_stub.create!(:type => "ContainerKubernetes") - container_group = container_group_stub.create!(:type => "ContainerGroupKubernetes") - - migrate - - expect(container_node_stub.find(container_node.id)).not_to respond_to(:type) - expect(container_stub.find(container.id)).not_to respond_to(:type) - expect(container_group_stub.find(container_group.id)).not_to respond_to(:type) - end - end -end diff --git a/spec/migrations/20150604154825_rename_container_node_conditions_to_container_conditions_spec.rb b/spec/migrations/20150604154825_rename_container_node_conditions_to_container_conditions_spec.rb deleted file mode 100644 index c8529234d..000000000 --- a/spec/migrations/20150604154825_rename_container_node_conditions_to_container_conditions_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require_migration - -describe RenameContainerNodeConditionsToContainerConditions do - class RenameContainerNodeConditionsToContainerConditions::ContainerNodeCondition < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - let(:container_node_condition_stub) { migration_stub(:ContainerNodeCondition)} - let(:container_condition_stub) { migration_stub(:ContainerCondition) } - - migration_context :up do - it "defaults all container_entity_type to 'ContainerNode'" do - cnc = container_node_condition_stub.create! - - migrate - - cc = container_condition_stub.find_by(:id => cnc.id) - expect(cc.container_entity_type).to eq("ContainerNode") - end - end - - migration_context :down do - it "removes all 'ContainerGroup' conditions" do - cc_node = container_condition_stub.create!(:container_entity_type => 'ContainerNode') - cc_group = container_condition_stub.create!(:container_entity_type => 'ContainerGroup') - - migrate - - cnc_node = container_node_condition_stub.find_by(:id => cc_node.id) - expect(cnc_node).to_not be_nil - - cnc_group = container_node_condition_stub.find_by(:id => cc_group.id) - expect(cnc_group).to be_nil - end - end -end diff --git a/spec/migrations/20150625220141_fix_serialized_reports_for_rails_four_spec.rb b/spec/migrations/20150625220141_fix_serialized_reports_for_rails_four_spec.rb deleted file mode 100644 index e17464150..000000000 --- a/spec/migrations/20150625220141_fix_serialized_reports_for_rails_four_spec.rb +++ /dev/null @@ -1,139 +0,0 @@ -require_migration - -describe FixSerializedReportsForRailsFour do - before do - # Create the various classes that are represented in the serialized data - stub_const("MiqReport", Class.new(ActiveRecord::Base)) - stub_const("Ruport", Module.new) - stub_const("Ruport::Data", Module.new) - stub_const("Ruport::Data::Table", Class.new) - stub_const("Ruport::Data::Record", Class.new) - end - - let(:report_result_stub) { migration_stub(:MiqReportResult) } - let(:binary_blob) { migration_stub(:BinaryBlob) } - let(:data_dir) { File.expand_path(File.join("data", File.basename(__FILE__, '.rb')), __dir__) } - - migration_context :up do - before(:each) do - @raw_report = File.read(File.join(data_dir, 'miq_report_obj.yaml')) - @raw_blob = File.read(File.join(data_dir, 'binary_blob_obj.yaml')) - @raw_blob_csv = File.read(File.join(data_dir, 'binary_blob_csv.yaml')) - - allow_any_instance_of(FixSerializedReportsForRailsFour::BinaryBlob).to receive(:resource).and_return(true) - end - - it "migrates existing reports serialized as MiqReport objects to Hashes" do - rr = report_result_stub.create!( - :db => 'Chargeback', - :report => @raw_report - ) - - migrate - - rr.reload - - raw_report = YAML.load(rr.read_attribute(:report)) - expect(raw_report).to be_a(Hash) - end - - it "migrates existing binary blobs serialized as MiqReport objects to Hashes" do - bb = binary_blob.create!( - :resource_type => "MiqReportResult", - :md5 => "b540c6aec8a7726c1154d71c06017150", - :size => 67_124, - :part_size => 1_048_576, - :name => "report_results", - :data_type => "YAML" - ) - bb.binary = @raw_blob - - migrate - - bb.reload - - raw_report = YAML.load(bb.binary) - expect(raw_report).to be_a(Hash) - end - - it "skips existing binary blobs serialized as CSV" do - bb = binary_blob.create!( - :resource_type => "MiqReportResult", - :md5 => "b540c6aec8a7726c1154d71c06017150", - :size => 67_124, - :part_size => 1_048_576, - :name => "report_results", - :data_type => "YAML" - ) - bb.binary = @raw_blob_csv.dup - - migrate - - bb.reload - - expect(bb.binary).to eq(@raw_blob_csv) - end - end - - migration_context :down do - before(:each) do - @raw_report = File.read(File.join(data_dir, 'miq_report_hash.yaml')) - @raw_blob = File.read(File.join(data_dir, 'binary_blob_hash.yaml')) - @raw_blob_csv = File.read(File.join(data_dir, 'binary_blob_csv.yaml')) - - allow_any_instance_of(FixSerializedReportsForRailsFour::BinaryBlob).to receive(:resource).and_return(true) - end - - it "migrates existing reports serialized as Hashes objects to MiqReports" do - rr = report_result_stub.create!( - :db => 'Chargeback', - :report => @raw_report - ) - - migrate - - rr.reload - - raw_report = YAML.load(rr.read_attribute(:report)) - expect(raw_report).to be_a(Array) - expect(raw_report.first).to be_a(MiqReport) - end - - it "migrates existing binary blobs serialized as Hashes objects to MiqReports" do - bb = binary_blob.create!( - :resource_type => "MiqReportResult", - :md5 => "b540c6aec8a7726c1154d71c06017150", - :size => 67_124, - :part_size => 1_048_576, - :name => "report_results", - :data_type => "YAML" - ) - bb.binary = @raw_blob - - migrate - - bb.reload - - raw_report = YAML.load(bb.binary) - expect(raw_report).to be_a(MiqReport) - end - - it "skips existing binary blobs serialized as CSV" do - bb = binary_blob.create!( - :resource_type => "MiqReportResult", - :md5 => "b540c6aec8a7726c1154d71c06017150", - :size => 67_124, - :part_size => 1_048_576, - :name => "report_results", - :data_type => "YAML" - ) - bb.binary = @raw_blob_csv.dup - - migrate - - bb.reload - - expect(bb.binary).to eq(@raw_blob_csv) - end - end -end diff --git a/spec/migrations/20150630100251_namespace_ems_amazon_spec.rb b/spec/migrations/20150630100251_namespace_ems_amazon_spec.rb deleted file mode 100644 index 89509a19d..000000000 --- a/spec/migrations/20150630100251_namespace_ems_amazon_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsAmazon do - class NamespaceEmsAmazon::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150714053019_namespace_ems_redhat_spec.rb b/spec/migrations/20150714053019_namespace_ems_redhat_spec.rb deleted file mode 100644 index 9a7bba16d..000000000 --- a/spec/migrations/20150714053019_namespace_ems_redhat_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsRedhat do - class NamespaceEmsRedhat::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150714143821_remove_ui_tasks_and_ui_task_sets_spec.rb b/spec/migrations/20150714143821_remove_ui_tasks_and_ui_task_sets_spec.rb deleted file mode 100644 index cda1d0b4f..000000000 --- a/spec/migrations/20150714143821_remove_ui_tasks_and_ui_task_sets_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_migration - -describe RemoveUiTasksAndUiTaskSets do - let(:miq_set_stub) { migration_stub(:MiqSet) } - let(:relationship_stub) { migration_stub(:Relationship) } - - migration_context :up do - it "removes MiqSet instances for UiTaskSets" do - deleted = miq_set_stub.create!(:set_type => "UiTaskSet", :name => "super_administrator", :description => "Super Administrator") - ignored = miq_set_stub.create!(:set_type => "MiqWidgetSet", :name => "default", :description => "Default Dashboard") - - migrate - - expect { deleted.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { ignored.reload }.to_not raise_error - end - - it "removes Relationship instances for UiTaskSets" do - deleted = relationship_stub.create!(:resource_type => "UiTaskSet", :relationship => "membership") - ignored = relationship_stub.create!(:resource_type => "MiqWidgetSet", :relationship => "membership") - - migrate - - expect { deleted.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { ignored.reload }.to_not raise_error - end - end -end diff --git a/spec/migrations/20150716021334_fix_redhat_namespace_spec.rb b/spec/migrations/20150716021334_fix_redhat_namespace_spec.rb deleted file mode 100644 index 39973e3eb..000000000 --- a/spec/migrations/20150716021334_fix_redhat_namespace_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe FixRedhatNamespace do - class FixRedhatNamespace::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150724030353_namespace_ems_foreman_spec.rb b/spec/migrations/20150724030353_namespace_ems_foreman_spec.rb deleted file mode 100644 index 6101d26ab..000000000 --- a/spec/migrations/20150724030353_namespace_ems_foreman_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsForeman do - class NamespaceEmsForeman::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150731025210_namespace_ems_openstack_spec.rb b/spec/migrations/20150731025210_namespace_ems_openstack_spec.rb deleted file mode 100644 index f9412fce7..000000000 --- a/spec/migrations/20150731025210_namespace_ems_openstack_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsOpenstack do - class NamespaceEmsOpenstack::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150806190149_rename_miq_event_table_to_miq_event_definition_spec.rb b/spec/migrations/20150806190149_rename_miq_event_table_to_miq_event_definition_spec.rb deleted file mode 100644 index cfdebc236..000000000 --- a/spec/migrations/20150806190149_rename_miq_event_table_to_miq_event_definition_spec.rb +++ /dev/null @@ -1,63 +0,0 @@ -require_migration - -describe RenameMiqEventTableToMiqEventDefinition do - migration_context :up do - let(:miq_set_stub) { migration_stub(:MiqSet) } - let(:relationship_stub) { migration_stub(:Relationship) } - - it 'renames MiqEventSet to MiqEventDefinitionSet in miq_sets' do - changed = miq_set_stub.create!(:set_type => 'MiqEventSet') - ignored = miq_set_stub.create!(:set_type => 'SomeOtherSet') - - migrate - - expect(changed.reload.set_type).to eq('MiqEventDefinitionSet') - expect(ignored.reload.set_type).to eq('SomeOtherSet') - end - - it 'renames MiqEvent/Set to MiqEventDefinition/Set in relationships' do - changed_event = relationship_stub.create!(:resource_type => 'MiqEvent') - changed_set = relationship_stub.create!(:resource_type => 'MiqEventSet') - ignored = relationship_stub.create!(:resource_type => 'SomeOtherType') - - migrate - - expect(changed_event.reload.resource_type).to eq('MiqEventDefinition') - expect(changed_set.reload.resource_type).to eq('MiqEventDefinitionSet') - expect(ignored.reload.resource_type).to eq('SomeOtherType') - end - end - - migration_context :down do - let(:miq_set_stub) { migration_stub(:MiqSet) } - let(:relationship_stub) { migration_stub(:Relationship) } - - it 'renames MiqEventDefinitionSet to MiqEventSet in miq_sets' do - changed = miq_set_stub.create!(:set_type => 'MiqEventDefinitionSet') - ignored = miq_set_stub.create!(:set_type => 'SomeOtherSet') - - migrate - - expect(changed.reload.set_type).to eq('MiqEventSet') - expect(ignored.reload.set_type).to eq('SomeOtherSet') - end - - it 'renames MiqEventDefinition/Set to MiqEvent/Set in relationships' do - changed_event = relationship_stub.create!(:resource_type => 'MiqEventDefinition') - ignored = relationship_stub.create!(:resource_type => 'SomeOtherType') - - migrate - - expect(changed_event.reload.resource_type).to eq('MiqEvent') - expect(ignored.reload.resource_type).to eq('SomeOtherType') - end - - it 'renames MiqEventDefinitionSet to MiqEventSet in relationships' do - changed = relationship_stub.create!(:resource_type => 'MiqEventDefinitionSet') - - migrate - - expect(changed.reload.resource_type).to eq('MiqEventSet') - end - end -end diff --git a/spec/migrations/20150806194147_migrate_filtered_events_to_blacklisted_events_spec.rb b/spec/migrations/20150806194147_migrate_filtered_events_to_blacklisted_events_spec.rb deleted file mode 100644 index 4459aca7e..000000000 --- a/spec/migrations/20150806194147_migrate_filtered_events_to_blacklisted_events_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -require_migration - -describe MigrateFilteredEventsToBlacklistedEvents do - let(:configuration_stub) { migration_stub(:Configuration) } - let(:blacklisted_event_stub) { migration_stub(:BlacklistedEvent) } - - migration_context :up do - it 'when filtered events section exists with system events' do - event_settings = { - 'filtered_events' => { - :AlarmActionTriggeredEvent => nil, - :AlarmCreatedEvent => nil - } - } - configuration_stub.create!(:typ => 'event_handling', :settings => event_settings) - - migrate - - expect(configuration_stub.first.settings.fetch_path('filtered_events')).to be_blank - expect(blacklisted_event_stub.count).to eq(0) - end - - it 'when filtered events section exists with user added events' do - event_settings = { - 'filtered_events' => { - :SomeNewEvent => nil - } - } - configuration_stub.create!(:typ => 'event_handling', :settings => event_settings) - - migrate - - expect(configuration_stub.first.settings.fetch_path('filtered_events')).to be_blank - expect(blacklisted_event_stub.count).to eq(described_class::PROVIDER_NAMES.size) - end - - it 'when filtered events section does not exist in configuration' do - configuration_stub.create!(:typ => 'event_handling', :settings => {:event_groups => {'a' => nil}}) - - migrate - - expect(configuration_stub.first.settings.fetch_path('filtered_events')).to be_blank - expect(blacklisted_event_stub.count).to eq(0) - end - - it 'when event handling configuration does not exist' do - migrate - - expect(blacklisted_event_stub.count).to eq(0) - end - - it 'when multiple event handling configurations exist' do - configuration_stub.create!(:typ => 'event_handling', :settings => {'filtered_events' => {:user_event_1 => nil}}) - configuration_stub.create!(:typ => 'event_handling', :settings => {'filtered_events' => {:user_event_2 => nil}}) - - migrate - - expect(configuration_stub.first.settings.fetch_path('filtered_events')).to be_blank - expect(blacklisted_event_stub.count).to eq(2 * described_class::PROVIDER_NAMES.size) - end - end -end diff --git a/spec/migrations/20150806211453_rename_ems_event_table_to_event_stream_spec.rb b/spec/migrations/20150806211453_rename_ems_event_table_to_event_stream_spec.rb deleted file mode 100644 index a90b1fd79..000000000 --- a/spec/migrations/20150806211453_rename_ems_event_table_to_event_stream_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -require_migration - -describe RenameEmsEventTableToEventStream do - let(:ems_event_stub) { migration_stub(:EmsEvent) } - let(:event_stream_stub) { migration_stub(:EventStream) } - - migration_context :up do - it 'adds two columns' do - ems_event_stub.create! - - migrate - - event_stream = event_stream_stub.first - expect(event_stream.type).to eq('EmsEvent') - expect(event_stream.target_id).to be_nil - end - - it 'updates in batches' do - stub_const("#{described_class}::BATCH_SIZE", 5) - - ems_event_stub.transaction do - 14.times { ems_event_stub.create! } - end - - migrate - - expect(event_stream_stub.distinct.pluck(:type)).to eq ["EmsEvent"] - expect(event_stream_stub.distinct.pluck(:target_id)).to eq [nil] - end - end - - migration_context :down do - it 'deletes two columns' do - event_stream_stub.create! - - migrate - - event = ems_event_stub.first - expect(event).not_to respond_to(:type) - expect(event).not_to respond_to(:target_id) - end - end -end diff --git a/spec/migrations/20150807165254_namespace_ems_container_spec.rb b/spec/migrations/20150807165254_namespace_ems_container_spec.rb deleted file mode 100644 index e51bc7127..000000000 --- a/spec/migrations/20150807165254_namespace_ems_container_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsContainer do - class NamespaceEmsContainer::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150815051916_namespace_ems_microsoft_spec.rb b/spec/migrations/20150815051916_namespace_ems_microsoft_spec.rb deleted file mode 100644 index c87395acc..000000000 --- a/spec/migrations/20150815051916_namespace_ems_microsoft_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsMicrosoft do - class NamespaceEmsMicrosoft::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150815052719_fix_foreman_provider_type_spec.rb b/spec/migrations/20150815052719_fix_foreman_provider_type_spec.rb deleted file mode 100644 index c36fbb456..000000000 --- a/spec/migrations/20150815052719_fix_foreman_provider_type_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe FixForemanProviderType do - class FixForemanProviderType::Provider < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :Provider, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :Provider, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150817213409_clear_tenant_seed_spec.rb b/spec/migrations/20150817213409_clear_tenant_seed_spec.rb deleted file mode 100644 index 8256c0567..000000000 --- a/spec/migrations/20150817213409_clear_tenant_seed_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require_migration - -describe ClearTenantSeed do - migration_context :up do - it "works with one tenants" do - tenant = migration_stub(:Tenant).create(:name => 'My Company') - migrate - expect(tenant.reload.name).to be_nil - end - end -end diff --git a/spec/migrations/20150818181427_update_tenant_divisible_on_existing_rows_spec.rb b/spec/migrations/20150818181427_update_tenant_divisible_on_existing_rows_spec.rb deleted file mode 100644 index ad23b1028..000000000 --- a/spec/migrations/20150818181427_update_tenant_divisible_on_existing_rows_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_migration - -describe UpdateTenantDivisibleOnExistingRows do - let(:tenant_stub) { migration_stub(:Tenant) } - - migration_context :up do - it "updates nil values to true" do - t_nil = tenant_stub.create!(:divisible => nil) - expect(t_nil.divisible).to be_nil - - migrate - - t_nil.reload - expect(t_nil.divisible).to be_truthy - end - - it "leaves true and false values alone" do - t_true = tenant_stub.create!(:divisible => true) - t_false = tenant_stub.create!(:divisible => false) - - expect(t_true.divisible).to be_truthy - expect(t_false.divisible).to be_falsey - - migrate - - t_true.reload - t_false.reload - - expect(t_true.divisible).to be_truthy - expect(t_false.divisible).to be_falsey - end - end -end diff --git a/spec/migrations/20150822102141_fix_more_foreman_types_spec.rb b/spec/migrations/20150822102141_fix_more_foreman_types_spec.rb deleted file mode 100644 index e1f099a96..000000000 --- a/spec/migrations/20150822102141_fix_more_foreman_types_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe FixMoreForemanTypes do - class FixMoreForemanTypes::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150823120001_namespace_ems_openstack_availability_zones_null_spec.rb b/spec/migrations/20150823120001_namespace_ems_openstack_availability_zones_null_spec.rb deleted file mode 100644 index effbf677d..000000000 --- a/spec/migrations/20150823120001_namespace_ems_openstack_availability_zones_null_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsOpenstackAvailabilityZonesNull do - class NamespaceEmsOpenstackAvailabilityZonesNull::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150824130000_update_tenant_override_settings_spec.rb b/spec/migrations/20150824130000_update_tenant_override_settings_spec.rb deleted file mode 100644 index 365d49ab8..000000000 --- a/spec/migrations/20150824130000_update_tenant_override_settings_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require_migration - -describe UpdateTenantOverrideSettings do - let(:tenant_stub) { migration_stub(:Tenant) } - - migration_context :up do - it "updates root_value" do - root_tenant = tenant_stub.create! - expect(root_tenant).not_to be_use_config_for_attributes - - migrate - - expect(root_tenant.reload).to be_use_config_for_attributes - end - - it "leaves other tenants alone" do - root_tenant = tenant_stub.create! - child_tenant = tenant_stub.create!(:ancestry => root_tenant.id.to_s) - expect(child_tenant).not_to be_use_config_for_attributes - - migrate - - expect(child_tenant).not_to be_use_config_for_attributes - end - end -end diff --git a/spec/migrations/20150903162623_assign_tenant_spec.rb b/spec/migrations/20150903162623_assign_tenant_spec.rb deleted file mode 100644 index 8884ca27e..000000000 --- a/spec/migrations/20150903162623_assign_tenant_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -require_migration - -describe AssignTenant do - let(:tenant_stub) { migration_stub(:Tenant) } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:miq_ae_namespace_stub) { migration_stub(:MiqAeNamespace) } - let(:miq_group_stub) { migration_stub(:MiqGroup) } - let(:provider_stub) { migration_stub(:Provider) } - let(:tenant_quota_stub) { migration_stub(:TenantQuota) } - let(:vm_stub) { migration_stub(:Vm) } - - let(:stubs) { [ems_stub, miq_ae_namespace_stub, miq_group_stub, provider_stub, tenant_quota_stub, vm_stub] } - - migration_context :up do - describe "#root_tenant" do - it "doesnt create tenant if no records exist" do - migrate - - expect(tenant_stub.count).to eq(0) - end - - it "creates tenant if needed" do - miq_group_stub.create! - migrate - - expect(tenant_stub.count).to eq(1) - expect(tenant_stub.first).to be_use_config_for_attributes - expect(tenant_stub.first).to be_divisible - end - - it "doesnt creates additional root_tenant" do - tenant_stub.create! - miq_group_stub.create! - - migrate - - expect(tenant_stub.count).to eq(1) - # make sure tenant was not modified - expect(tenant_stub.first).not_to be_use_config_for_attributes - expect(tenant_stub.first).not_to be_divisible - end - end - - it "updates existing records" do - tenant_stub.root_tenant - - stubs.map(&:create!) - - migrate - - expect(tenant_stub.count).to eq(1) - stubs.each do |stub| - expect(stub.where(:tenant_id => nil).exists?).to be_falsey - end - end - end -end diff --git a/spec/migrations/20150904181202_miq_groups_add_ldap_role_spec.rb b/spec/migrations/20150904181202_miq_groups_add_ldap_role_spec.rb deleted file mode 100644 index a20cb6a71..000000000 --- a/spec/migrations/20150904181202_miq_groups_add_ldap_role_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require_migration - -describe MiqGroupsAddLdapRole do - migration_context :up do - let(:miq_user_role_stub) { migration_stub(:MiqUserRole) } - let(:miq_group_stub) { migration_stub(:MiqGroup) } - - it "migrates ldap groups" do - role = miq_user_role_stub.create!(:name => "EvmRole-my_group") - unchanged_group = miq_group_stub.create!(:description => "EvmGroup-super_administrator", :group_type => "abc") - changed_group = miq_group_stub.create!(:description => "EvmGroup-my_group", :group_type => "ldap") - - migrate - changed_group.reload - - expect(unchanged_group.reload.group_type).to eq("abc") - expect(changed_group.group_type).to eq("system") - expect(changed_group.miq_user_role_id).to eq(role.id) - end - end -end diff --git a/spec/migrations/20150907095639_add_container_image_digest_spec.rb b/spec/migrations/20150907095639_add_container_image_digest_spec.rb deleted file mode 100644 index 39042f165..000000000 --- a/spec/migrations/20150907095639_add_container_image_digest_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -require_migration - -describe AddContainerImageDigest do - let(:container_image_stub) { migration_stub(:ContainerImage) } - - let(:row_entries) do - [ - {:tag_in => 'sha256', :tag_out => 'sha256', :digest => nil}, - {:tag_in => 'sha384', :tag_out => 'sha384', :digest => nil}, - {:tag_in => 'sha512', :tag_out => 'sha512', :digest => nil}, - {:tag_in => 'sha256abc', :tag_out => 'sha256abc', :digest => nil}, - {:tag_in => 'sha384abc', :tag_out => 'sha384abc', :digest => nil}, - {:tag_in => 'sha512abc', :tag_out => 'sha512abc', :digest => nil}, - {:tag_in => 'sha256:abc', :tag_out => nil, :digest => 'sha256:abc'}, - {:tag_in => 'sha384:abc', :tag_out => nil, :digest => 'sha384:abc'}, - {:tag_in => 'sha512:abc', :tag_out => nil, :digest => 'sha512:abc'} - ] - end - - migration_context :up do - it "migrates a series of representative row" do - row_entries.each do |x| - x[:image] = container_image_stub.create!(:tag => x[:tag_in]) - end - - migrate - - row_entries.each do |x| - expect(x[:image].reload).to have_attributes( - :tag => x[:tag_out], - :digest => x[:digest] - ) - end - end - end - - migration_context :down do - it "migrates a series of representative row" do - row_entries.each do |x| - x[:image] = container_image_stub.create!( - :tag => x[:tag_out], - :digest => x[:digest] - ) - end - - migrate - - row_entries.each do |x| - expect(x[:image].reload).to have_attributes(:tag => x[:tag_in]) - end - end - end -end diff --git a/spec/migrations/20150907163347_confirm_all_class_renames_spec.rb b/spec/migrations/20150907163347_confirm_all_class_renames_spec.rb deleted file mode 100644 index 9d0bb5bc7..000000000 --- a/spec/migrations/20150907163347_confirm_all_class_renames_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe ConfirmAllClassRenames do - class ConfirmAllClassRenames::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150909023532_namespace_ems_azure_spec.rb b/spec/migrations/20150909023532_namespace_ems_azure_spec.rb deleted file mode 100644 index 7690a3019..000000000 --- a/spec/migrations/20150909023532_namespace_ems_azure_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe NamespaceEmsAzure do - class NamespaceEmsAzure::ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - - migration_context :up do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.first - end - - migration_context :down do - include_examples "column migration", :type, :ExtManagementSystem, described_class::NAME_MAP.invert.first - end -end diff --git a/spec/migrations/20150914202922_correct_user_created_role_feature_sets_spec.rb b/spec/migrations/20150914202922_correct_user_created_role_feature_sets_spec.rb deleted file mode 100644 index 1369efd90..000000000 --- a/spec/migrations/20150914202922_correct_user_created_role_feature_sets_spec.rb +++ /dev/null @@ -1,124 +0,0 @@ -require_migration - -RSpec.describe CorrectUserCreatedRoleFeatureSets do - migration_context :up do - let(:user_role_stub) { migration_stub(:MiqUserRole) } - let(:product_feature_stub) { migration_stub(:MiqProductFeature) } - - it "adds 'instance' and 'image' to user roles product features with 'vm_cloud_explorer'" do - instances = product_feature_stub.create!( - :name => "Instance Access Rules", - :description => "Access Rules for Instances", - :feature_type => "node", - :identifier => "instance" - ) - images = product_feature_stub.create!( - :name => "Image Access Rules", - :description => "Access Rules for Images", - :feature_type => "node", - :identifier => "image" - ) - vm_cloud_explorer = product_feature_stub.create!( - :name => "Instances", - :description => "Instance Views", - :feature_type => "node", - :identifier => "vm_cloud_explorer" - ) - user_role = user_role_stub.create!(:miq_product_features => [vm_cloud_explorer], :read_only => false) - - expect(user_role.miq_product_features).not_to include(instances) - expect(user_role.miq_product_features).not_to include(images) - - migrate - user_role.reload - - expect(user_role.miq_product_features).to include(instances) - expect(user_role.miq_product_features).to include(images) - end - - it "adds 'vm' and 'miq_template' to user roles product features with 'vm_infra_explorer'" do - vms = product_feature_stub.create!( - :name => "VM Access Rules", - :description => "Access Rules for Virtual Machines", - :feature_type => "node", - :identifier => "vm" - ) - templates = product_feature_stub.create!( - :name => "Template Access Rules", - :description => "Access Rules for Templates", - :feature_type => "node", - :identifier => "miq_template" - ) - vm_infra_explorer = product_feature_stub.create!( - :name => "Virtual Machines", - :description => "Virtual Machine Views", - :feature_type => "node", - :identifier => "vm_infra_explorer" - ) - user_role = user_role_stub.create!(:miq_product_features => [vm_infra_explorer], :read_only => false) - - expect(user_role.miq_product_features).not_to include(vms) - expect(user_role.miq_product_features).not_to include(templates) - - migrate - user_role.reload - - expect(user_role.miq_product_features).to include(vms) - expect(user_role.miq_product_features).to include(templates) - end - - it "leaves user roles with neither feature set alone" do - product_feature_stub.create!( - :name => "VM Access Rules", - :description => "Access Rules for Virtual Machines", - :feature_type => "node", - :identifier => "vm" - ) - product_feature_stub.create!( - :name => "Template Access Rules", - :description => "Access Rules for Templates", - :feature_type => "node", - :identifier => "miq_template" - ) - product_feature_stub.create!( - :name => "Virtual Machines", - :description => "Virtual Machine Views", - :feature_type => "node", - :identifier => "vm_infra_explorer" - ) - user_role = user_role_stub.create!(:miq_product_features => [], :read_only => false) - - migrate - - expect(user_role.reload.miq_product_features).to be_empty - end - - it "leaves read only user roles alone" do - product_feature_stub.create!( - :name => "VM Access Rules", - :description => "Access Rules for Virtual Machines", - :feature_type => "node", - :identifier => "vm" - ) - product_feature_stub.create!( - :name => "Template Access Rules", - :description => "Access Rules for Templates", - :feature_type => "node", - :identifier => "miq_template" - ) - vm_infra_explorer = product_feature_stub.create!( - :name => "Virtual Machines", - :description => "Virtual Machine Views", - :feature_type => "node", - :identifier => "vm_infra_explorer" - ) - user_role = user_role_stub.create!(:miq_product_features => [vm_infra_explorer], :read_only => true) - - migrate - user_role.reload - - expect(user_role.miq_product_features.size).to eq(1) - expect(user_role.miq_product_features[0].id).to eq(vm_infra_explorer.id) - end - end -end diff --git a/spec/migrations/20150915001329_assign_tenant_to_miq_request_spec.rb b/spec/migrations/20150915001329_assign_tenant_to_miq_request_spec.rb deleted file mode 100644 index 29729ea17..000000000 --- a/spec/migrations/20150915001329_assign_tenant_to_miq_request_spec.rb +++ /dev/null @@ -1,67 +0,0 @@ -require_migration - -describe AssignTenantToMiqRequest do - let(:tenant_stub) { migration_stub(:Tenant) } - let(:miq_group_stub) { migration_stub(:MiqGroup) } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:miq_ae_namespace_stub) { migration_stub(:MiqAeNamespace) } - let(:provider_stub) { migration_stub(:Provider) } - let(:vm_stub) { migration_stub(:Vm) } - let(:miq_request_stub) { migration_stub(:MiqRequest) } - let(:miq_request_task_stub) { migration_stub(:MiqRequestTask) } - let(:service_stub) { migration_stub(:Service) } - let(:service_template_stub) { migration_stub(:ServiceTemplate) } - let(:service_catalog_stub) { migration_stub(:ServiceTemplateCatalog) } - - let(:stubs) do - [ - ems_stub, miq_ae_namespace_stub, miq_group_stub, provider_stub, vm_stub, - miq_request_stub, miq_request_task_stub, service_stub, service_template_stub, service_catalog_stub - ] - end - - migration_context :up do - describe "tenant_stub.root_tenant" do - it "doesnt create tenant if no records exist" do - migrate - - expect(tenant_stub.count).to eq(0) - end - - it "creates tenant if needed" do - miq_group_stub.create! - migrate - - expect(tenant_stub.count).to eq(1) - expect(tenant_stub.first).to be_use_config_for_attributes - expect(tenant_stub.first).to be_divisible - end - - it "doesnt creates additional root_tenant" do - tenant_stub.create! - miq_group_stub.create! - - migrate - - expect(tenant_stub.count).to eq(1) - # make sure tenant was not modified - expect(tenant_stub.first).not_to be_use_config_for_attributes - expect(tenant_stub.first).not_to be_divisible - end - end - - it "updates existing records" do - tenant_stub.root_tenant - miq_group_stub.create! - - stubs.map(&:create!) - - migrate - - expect(tenant_stub.count).to eq(1) - stubs.each do |stub| - expect(stub.where(:tenant_id => nil).exists?).to be_falsey - end - end - end -end diff --git a/spec/migrations/20150921204114_add_vmware_ro_datastores_to_hosts_storages_spec.rb b/spec/migrations/20150921204114_add_vmware_ro_datastores_to_hosts_storages_spec.rb deleted file mode 100644 index 4ded3275b..000000000 --- a/spec/migrations/20150921204114_add_vmware_ro_datastores_to_hosts_storages_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require_migration - -describe AddVmwareRoDatastoresToHostsStorages do - let(:hosts_storages_stub) { migration_stub(:HostsStorage) } - - migration_context :up do - it "Adds ID in correct region" do - migrate - end - end -end diff --git a/spec/migrations/20151019194111_tenant_cfg_not_nil_spec.rb b/spec/migrations/20151019194111_tenant_cfg_not_nil_spec.rb deleted file mode 100644 index 50f7af55b..000000000 --- a/spec/migrations/20151019194111_tenant_cfg_not_nil_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_migration - -describe TenantCfgNotNil do - let(:tenant_stub) { migration_stub(:Tenant) } - - migration_context :up do - it "doesnt change false" do - tenant = tenant_stub.create(:use_config_for_attributes => false) - migrate - - expect(tenant.reload.use_config_for_attributes).to be_falsey - end - - it "doesnt change false" do - tenant = tenant_stub.create(:use_config_for_attributes => true) - migrate - - expect(tenant.reload.use_config_for_attributes).to be_truthy - end - - it "doesnt changes nil" do - tenant = tenant_stub.create(:use_config_for_attributes => nil) - migrate - - expect(tenant.reload.use_config_for_attributes).to be_falsey - end - end -end diff --git a/spec/migrations/20151021093644_set_correct_sti_type_on_cloud_network_spec.rb b/spec/migrations/20151021093644_set_correct_sti_type_on_cloud_network_spec.rb deleted file mode 100644 index d435e2fa3..000000000 --- a/spec/migrations/20151021093644_set_correct_sti_type_on_cloud_network_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require_migration - -describe SetCorrectStiTypeOnCloudNetwork do - let(:cloud_manager_stub) { migration_stub(:CloudManager) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - - let!(:empty_cloud_network) { cloud_network_stub.create! } - - let!(:ems_cloud) { cloud_manager_stub.create!(:type => "ManageIQ::Providers::Openstack::CloudManager") } - let!(:cloud_cloud_network) { cloud_network_stub.create!(:external_facing => true, :ems_id => ems_cloud.id) } - - let!(:ems_infra) { cloud_manager_stub.create!(:type => "ManageIQ::Providers::Openstack::InfraManager") } - let!(:infra_cloud_network) { cloud_network_stub.create!(:external_facing => false, :ems_id => ems_infra.id) } - - migration_context :up do - it "sets correct type to cloud_network objects according to cloud_manager" do - migrate - - expect(empty_cloud_network.reload.type).to eq(described_class::CLOUD_TEMPLATE_CLASS) - expect(cloud_cloud_network.reload.type).to eq(described_class::CLOUD_PUBLIC_CLASS) - expect(infra_cloud_network.reload.type).to eq(described_class::CLOUD_PRIVATE_CLASS) - end - end - - migration_context :down do - it "sets type = nil for all cloud_networks" do - cloud_cloud_network.type = described_class::CLOUD_PUBLIC_CLASS - cloud_cloud_network.save! - - infra_cloud_network.type = described_class::CLOUD_PRIVATE_CLASS - infra_cloud_network.save! - - migrate - - expect(cloud_cloud_network.reload.type).to be_nil - expect(infra_cloud_network.reload.type).to be_nil - end - end -end diff --git a/spec/migrations/20151021095831_set_correct_sti_type_on_cloud_subnet_spec.rb b/spec/migrations/20151021095831_set_correct_sti_type_on_cloud_subnet_spec.rb deleted file mode 100644 index ca30d4fbc..000000000 --- a/spec/migrations/20151021095831_set_correct_sti_type_on_cloud_subnet_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require_migration - -describe SetCorrectStiTypeOnCloudSubnet do - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - - let!(:empty_cloud_subnet) { cloud_subnet_stub.create! } - - let!(:private_cloud_network) { cloud_network_stub.create!(:type => described_class::CLOUD_PRIVATE_CLASS) } - let!(:private_cloud_subnet) { cloud_subnet_stub.create!(:cloud_network_id => private_cloud_network.id) } - - let!(:public_cloud_network) { cloud_network_stub.create!(:type => described_class::CLOUD_PUBLIC_CLASS) } - let!(:public_cloud_subnet) { cloud_subnet_stub.create!(:cloud_network_id => public_cloud_network.id) } - - migration_context :up do - it "migrates a series of representative row" do - migrate - - expect(empty_cloud_subnet.reload.type).to eq("CloudSubnet") - expect(private_cloud_subnet.reload.type).to eq(described_class::CLOUD_SUBNET) - expect(public_cloud_subnet.reload.type).to eq(described_class::CLOUD_SUBNET) - end - end - - migration_context :down do - it "migrates a series of representative row" do - private_cloud_subnet.type = described_class::CLOUD_SUBNET - private_cloud_subnet.save! - - public_cloud_subnet.type = described_class::CLOUD_SUBNET - public_cloud_subnet.save! - - migrate - - expect(private_cloud_subnet.reload.type).to be_nil - expect(public_cloud_subnet.reload.type).to be_nil - end - end -end diff --git a/spec/migrations/20151021104529_add_persistent_volumes_to_container_volumes_spec.rb b/spec/migrations/20151021104529_add_persistent_volumes_to_container_volumes_spec.rb deleted file mode 100644 index 3e88b37f6..000000000 --- a/spec/migrations/20151021104529_add_persistent_volumes_to_container_volumes_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_migration - -describe AddPersistentVolumesToContainerVolumes do - let(:container_volume_stub) { migration_stub(:ContainerVolume) } - - migration_context :up do - it "up" do - container_volume = container_volume_stub.create! - - migrate - - expect(container_volume.reload).to have_attributes(:parent_type => "ContainerGroup") - end - end - - migration_context :down do - it "down" do - container_volume = container_volume_stub.create!(:parent_type => "ContainerGroup") - persistent_volume = container_volume_stub.create!(:parent_type => "ManageIQ::Providers::Kubernetes::ContainerManager") - - migrate - - expect(container_volume_stub.find(container_volume.id)).not_to respond_to(:parent_type) - expect(container_volume_stub.exists?(persistent_volume.id)).to be false - end - end -end diff --git a/spec/migrations/20151021174140_assign_tenant_default_group_spec.rb b/spec/migrations/20151021174140_assign_tenant_default_group_spec.rb deleted file mode 100644 index df1ed171e..000000000 --- a/spec/migrations/20151021174140_assign_tenant_default_group_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -require_migration - -describe AssignTenantDefaultGroup do - let(:tenant_stub) { migration_stub(:Tenant) } - let(:group_stub) { migration_stub(:MiqGroup) } - let(:role_stub) { migration_stub(:MiqUserRole) } - let(:tenant_role) { role_stub.create!(:name => role_stub::DEFAULT_TENANT_ROLE_NAME) } - - migration_context :up do - context "role exists" do - before do - tenant_role # make sure it exists - end - - it "creates a group (and assigns the role)" do - t = tenant_stub.create! - expect(t.default_miq_group_id).not_to be - - migrate - - t.reload - expect(t.default_miq_group_id).to be_truthy - g = group_stub.find(t.default_miq_group_id) - expect(g.miq_user_role_id).to eq(tenant_role.id) - expect(g.sequence).to be_truthy - end - - it "skips tenants that already have a group" do - g = group_stub.create!(:description => "custom group") - t = tenant_stub.create! - t.update(:default_miq_group_id => g.id) - - migrate - - expect(t.reload.default_miq_group_id).to eq(g.id) - end - end - - it "creates a group (even though group role is not defined yet)" do - t = tenant_stub.create! - migrate - - t.reload - expect(t.default_miq_group_id).to be_truthy - expect(group_stub.find(t.default_miq_group_id).miq_user_role_id).to be_nil - end - end -end diff --git a/spec/migrations/20151026170631_set_miq_groups_group_type_spec.rb b/spec/migrations/20151026170631_set_miq_groups_group_type_spec.rb deleted file mode 100644 index 7baccdad7..000000000 --- a/spec/migrations/20151026170631_set_miq_groups_group_type_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require_migration - -describe SetMiqGroupsGroupType do - let(:group_stub) { migration_stub(:MiqGroup) } - - migration_context :up do - it "sets groups with no type to user" do - g = group_stub.create - - migrate - - expect(g.reload.group_type).to eq("user") - end - - it "does not change system groups" do - g = group_stub.create(:group_type => "system") - - migrate - - expect(g.reload.group_type).to eq("system") - end - end - - migration_context :down do - it "clears groups with user type" do - g = group_stub.create(:group_type => "user") - - migrate - - expect(g.reload.group_type).to be_nil - end - - it "does not change system groups" do - g = group_stub.create(:group_type => "system") - - migrate - - expect(g.reload.group_type).to eq("system") - end - end -end diff --git a/spec/migrations/20151026220722_assign_vm_group_spec.rb b/spec/migrations/20151026220722_assign_vm_group_spec.rb deleted file mode 100644 index 9f3a06348..000000000 --- a/spec/migrations/20151026220722_assign_vm_group_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_migration - -describe AssignVmGroup do - let(:tenant_stub) { migration_stub(:Tenant) } - let(:vmt_stub) { migration_stub(:VmOrTemplate) } - let(:service_stub) { migration_stub(:Service) } - - migration_context :up do - it "assigns vm groups" do - tenant_stub.create!(:default_miq_group_id => 1) - - vm_without_group = vmt_stub.create!(:miq_group_id => nil) - vm_with_group = vmt_stub.create!(:miq_group_id => 2) - migrate - - expect(vm_without_group.reload.miq_group_id).to eq(1) - expect(vm_with_group.reload.miq_group_id).to eq(2) - end - - it "assigns service groups" do - tenant_stub.create!(:default_miq_group_id => 1) - - service_without_group = service_stub.create!(:miq_group_id => nil) - service_with_group = service_stub.create!(:miq_group_id => 2) - migrate - - expect(service_without_group.reload.miq_group_id).to eq(1) - expect(service_with_group.reload.miq_group_id).to eq(2) - end - end -end diff --git a/spec/migrations/20151030201919_fix_miq_group_sequences_spec.rb b/spec/migrations/20151030201919_fix_miq_group_sequences_spec.rb deleted file mode 100644 index 41409220c..000000000 --- a/spec/migrations/20151030201919_fix_miq_group_sequences_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_migration - -describe FixMiqGroupSequences do - let(:group_stub) { migration_stub(:MiqGroup) } - - migration_context :up do - it "assigns sequence" do - g1 = group_stub.create - g2 = group_stub.create(:sequence => 3) - - migrate - - expect(g1.reload.sequence).to be_truthy - expect(g2.reload.sequence).to eq(3) - end - - it "assigns guid" do - old_guid = SecureRandom.uuid - g1 = group_stub.create - g2 = group_stub.create(:guid => old_guid) - - migrate - - expect(g1.reload.guid).to be_truthy - expect(g2.reload.guid).to eq(old_guid) - end - end -end diff --git a/spec/migrations/20151104120951_transfer_rate_value_to_tiers_spec.rb b/spec/migrations/20151104120951_transfer_rate_value_to_tiers_spec.rb deleted file mode 100644 index ab2adbea5..000000000 --- a/spec/migrations/20151104120951_transfer_rate_value_to_tiers_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_migration - -describe TransferRateValueToTiers do - let(:chargeback_rate_detail_stub) { migration_stub(:ChargebackRateDetail) } - - migration_context :up do - it "transfers rate value" do - cbrd = chargeback_rate_detail_stub.create(:rate => 1.0) - migrate - cbrd.reload - expect(cbrd.chargeback_tiers.length).to eq(1) - expect(cbrd.chargeback_tiers[0].fixed_rate).to eq(0.0) - expect(cbrd.chargeback_tiers[0].variable_rate).to eq(1.0) - end - end -end diff --git a/spec/migrations/20151111165020_rename_miq_search_db_spec.rb b/spec/migrations/20151111165020_rename_miq_search_db_spec.rb deleted file mode 100644 index b5e43ecef..000000000 --- a/spec/migrations/20151111165020_rename_miq_search_db_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require_migration - -describe RenameMiqSearchDb do - let(:search_stub) { migration_stub(:MiqSearch) } - - migration_context :up do - it "renames known MiqSearch db values" do - to_be_renamed = described_class::NAME_HASH.keys.collect do |old_db| - search_stub.create!(:db => old_db) - end - to_be_ignored = search_stub.create!(:db => "Vm") - - migrate - - to_be_renamed.zip(described_class::NAME_HASH.values) do |search, new_db| - expect(search.reload.db).to eq(new_db) - end - expect(to_be_ignored.reload.db).to eq("Vm") - end - end -end diff --git a/spec/migrations/20151119202643_update_default_update_repo_names_spec.rb b/spec/migrations/20151119202643_update_default_update_repo_names_spec.rb deleted file mode 100644 index 56f0346d1..000000000 --- a/spec/migrations/20151119202643_update_default_update_repo_names_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require_migration - -describe UpdateDefaultUpdateRepoNames do - let(:db_stub) { migration_stub(:MiqDatabase) } - - migration_context :up do - [ - ["Satellite 5", "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1", ""], - ["Satellite 6", "cf-me-5.4-for-rhel-6-rpms rhel-server-rhscl-6-rpms", "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms"] - ].each do |name, existing_repo, desired_repo| - it name do - db = db_stub.create!(:update_repo_name => existing_repo) - - migrate - - expect(db.reload.update_repo_name).to eq(desired_repo) - end - end - end - - migration_context :down do - [ - ["Satellite 5", "", "rhel-x86_64-server-6-cf-me-3.2 rhel-x86_64-server-6-rhscl-1"], - ["Satellite 6", "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms", "cf-me-5.4-for-rhel-6-rpms rhel-server-rhscl-6-rpms"] - ].each do |name, existing_repo, desired_repo| - it name do - db = db_stub.create!(:update_repo_name => existing_repo) - - migrate - - expect(db.reload.update_repo_name).to eq(desired_repo) - end - end - end -end diff --git a/spec/migrations/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template_spec.rb b/spec/migrations/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template_spec.rb deleted file mode 100644 index d30034827..000000000 --- a/spec/migrations/20151125081618_set_correct_sti_type_on_openstack_infra_miq_template_spec.rb +++ /dev/null @@ -1,87 +0,0 @@ -require_migration - -describe SetCorrectStiTypeOnOpenstackInfraMiqTemplate do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:miq_template_stub) { migration_stub(:Vm) } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager"} - ] - end - - let(:row_entries) do - [ - { - :ems => ems_row_entries[0], - :name => "template_1", - :type_in => 'ManageIQ::Providers::Openstack::CloudManager::Template', - :type_out => 'ManageIQ::Providers::Openstack::InfraManager::Template' - }, - { - :ems => ems_row_entries[0], - :name => "template_2", - :type_in => 'ManageIQ::Providers::Openstack::CloudManager::Template', - :type_out => 'ManageIQ::Providers::Openstack::InfraManager::Template' - }, - { - :ems => ems_row_entries[1], - :name => "template_3", - :type_in => 'ManageIQ::Providers::Openstack::CloudManager::Template', - :type_out => 'ManageIQ::Providers::Openstack::CloudManager::Template' - }, - { - :ems => ems_row_entries[2], - :name => "template_4", - :type_in => 'ManageIQ::Providers::AnyManager::Template', - :type_out => 'ManageIQ::Providers::AnyManager::Template' - }, - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - row_entries.each do |x| - x[:miq_template] = miq_template_stub.create!(:type => x[:type_in], :ems_id => x[:ems][:ems].id, :name => x[:name]) - end - - migrate - - row_entries.each do |x| - expect(x[:miq_template].reload).to have_attributes( - :type => x[:type_out], - :name => x[:name], - :ems_id => x[:ems][:ems].id - ) - end - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - row_entries.each do |x| - x[:miq_template] = miq_template_stub.create!(:type => x[:type_out], :ems_id => x[:ems][:ems].id, :name => x[:name]) - end - - migrate - - row_entries.each do |x| - expect(x[:miq_template].reload).to have_attributes( - :type => x[:type_in], - :name => x[:name], - :ems_id => x[:ems][:ems].id - ) - end - end - end -end diff --git a/spec/migrations/20151204143045_set_correct_sti_type_on_openstack_cloud_volume_spec.rb b/spec/migrations/20151204143045_set_correct_sti_type_on_openstack_cloud_volume_spec.rb deleted file mode 100644 index bd3522d92..000000000 --- a/spec/migrations/20151204143045_set_correct_sti_type_on_openstack_cloud_volume_spec.rb +++ /dev/null @@ -1,97 +0,0 @@ -require_migration - -describe SetCorrectStiTypeOnOpenstackCloudVolume do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_volume_stub) { migration_stub(:CloudVolume) } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Amazon::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager"} - ] - end - - let(:row_entries) do - [ - { - :ems => ems_row_entries[0], - :name => "volume_1", - :type_in => nil, - :type_out => 'ManageIQ::Providers::Openstack::CloudManager::CloudVolume' - }, - { - :ems => ems_row_entries[1], - :name => "volume_2", - :type_in => 'ManageIQ::Providers::Openstack::CloudManager::CloudVolume', - :type_out => 'ManageIQ::Providers::Openstack::CloudManager::CloudVolume' - }, - { - :ems => ems_row_entries[1], - :name => "volume_3", - :type_in => 'ManageIQ::Providers::Amazon::CloudManager::CloudVolume', - :type_out => 'ManageIQ::Providers::Amazon::CloudManager::CloudVolume' - }, - { - :ems => ems_row_entries[1], - :name => "volume_4", - :type_in => nil, - :type_out => nil - }, - { - :ems => ems_row_entries[2], - :name => "volume_5", - :type_in => 'ManageIQ::Providers::AnyManager::CloudVolume', - :type_out => 'ManageIQ::Providers::AnyManager::CloudVolume' - }, - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - row_entries.each do |x| - x[:cloud_volume] = cloud_volume_stub.create!(:type => x[:type_in], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - migrate - - row_entries.each do |x| - expect(x[:cloud_volume].reload).to have_attributes( - :type => x[:type_out], - :name => x[:name], - :ems_id => x[:ems][:ems].id - ) - end - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - row_entries.each do |x| - x[:cloud_volume] = cloud_volume_stub.create!(:type => x[:type_out], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - migrate - - row_entries.each do |x| - expect(x[:cloud_volume].reload).to have_attributes( - :type => x[:type_in], - :name => x[:name], - :ems_id => x[:ems][:ems][:id] - ) - end - end - end -end diff --git a/spec/migrations/20151208150956_fix_host_storage_replication_on_upgrade_spec.rb b/spec/migrations/20151208150956_fix_host_storage_replication_on_upgrade_spec.rb deleted file mode 100644 index de23649a4..000000000 --- a/spec/migrations/20151208150956_fix_host_storage_replication_on_upgrade_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -require_migration - -describe FixHostStorageReplicationOnUpgrade do - let(:region_stub) { migration_stub(:MiqRegion) } - let(:host_storage_stub) { migration_stub(:HostsStorage) } - - migration_context :up do - before do - region_stub.create!(:id => 1_000_000_000_001, :region => 1) - end - - it "removes all the host_storages records on a replication target" do - region_stub.create!(:id => 99_000_000_000_001, :region => 99) - host_storage_stub.create!(:id => 1_000_000_000_001, :storage_id => 1, :host_id => 1) - host_storage_stub.create!(:id => 2_000_000_000_001, :storage_id => 1, :host_id => 2) - - migrate - - expect(host_storage_stub.count).to eq 0 - end - end -end diff --git a/spec/migrations/20151221134925_remove_sat5_repo_config_spec.rb b/spec/migrations/20151221134925_remove_sat5_repo_config_spec.rb deleted file mode 100644 index c257e969a..000000000 --- a/spec/migrations/20151221134925_remove_sat5_repo_config_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -require_migration - -describe RemoveSat5RepoConfig do - let(:db_stub) { migration_stub(:MiqDatabase) } - let(:authentication_stub) { migration_stub(:Authentication) } - - migration_context :up do - it "removes Sat5 registration info" do - db = db_stub.create!( - :registration_type => "rhn_satellite", - :registration_organization => "org", - :registration_server => "serv", - :registration_http_proxy_server => "a.proxy", - :update_repo_name => "repo", - :registration_organization_display_name => "name" - ) - authentication_stub.create!( - :resource_type => 'MiqDatabase', - :resource_id => db.id, - :authtype => :registration_http_proxy, - :name => "auth" - ) - authentication_stub.create!( - :resource_type => 'MiqDatabase', - :resource_id => db.id, - :authtype => :registration, - :name => "auth2" - ) - default_auth = authentication_stub.create!( - :resource_type => 'MiqDatabase', - :resource_id => db.id, - :authtype => :default, - :name => "auth3" - ) - - migrate - db.reload - - expect(db).to have_attributes( - :registration_type => nil, - :registration_organization => nil, - :registration_server => nil, - :registration_http_proxy_server => nil, - :update_repo_name => "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms", - :registration_organization_display_name => nil - ) - - auths = authentication_stub.where(:resource_type => 'MiqDatabase', :resource_id => db.id) - expect(auths).to match_array([default_auth]) - end - end -end diff --git a/spec/migrations/20151222103721_migrate_provider_attributes_to_endpoints_spec.rb b/spec/migrations/20151222103721_migrate_provider_attributes_to_endpoints_spec.rb deleted file mode 100644 index 99d2408c7..000000000 --- a/spec/migrations/20151222103721_migrate_provider_attributes_to_endpoints_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -require_migration - -describe MigrateProviderAttributesToEndpoints do - let(:provider_stub) { migration_stub(:Provider) } - let(:endpoint_stub) { migration_stub(:Endpoint) } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it 'migrates Provider attributes to Endpoints' do - provider = provider_stub.create!( - :verify_ssl => OpenSSL::SSL::VERIFY_NONE - ) - ems_stub.create!( - :provider_id => provider.id - ) - - migrate - - expect(endpoint_stub.count).to eq(1) - expect(endpoint_stub.first).to have_attributes( - :verify_ssl => OpenSSL::SSL::VERIFY_NONE - ) - end - - it 'handles nil port value properly' do - provider = provider_stub.create!( - :verify_ssl => nil - ) - ems_stub.create!( - :provider_id => provider.id - ) - - migrate - - expect(endpoint_stub.first).to have_attributes( - :verify_ssl => nil - ) - end - end - - migration_context :down do - it 'migrates Endpoints to Provider attributes' do - provider = provider_stub.create! - ems = ems_stub.create!( - :provider_id => provider.id - ) - endpoint_stub.create!( - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :role => "default", - :verify_ssl => OpenSSL::SSL::VERIFY_NONE - ) - - migrate - - expect(endpoint_stub.count).to eq(0) - expect(provider.reload).to have_attributes( - :verify_ssl => OpenSSL::SSL::VERIFY_NONE - ) - end - - it 'handles nil port value properly' do - provider = provider_stub.create! - endpoint_stub.create!( - :verify_ssl => nil - ) - - migrate - - expect(provider.reload).to have_attributes( - :verify_ssl => nil - ) - end - end -end diff --git a/spec/migrations/20151222152212_remove_vm_discover_row_from_miq_event_definitions_spec.rb b/spec/migrations/20151222152212_remove_vm_discover_row_from_miq_event_definitions_spec.rb deleted file mode 100644 index d49448cf2..000000000 --- a/spec/migrations/20151222152212_remove_vm_discover_row_from_miq_event_definitions_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require_migration - -describe RemoveVmDiscoverRowFromMiqEventDefinitions do - let(:miq_event_def_stub) { migration_stub(:MiqEventDefinition) } - let(:relationship_stub) { migration_stub(:Relationship) } - - migration_context :up do - it "removes vm_discover from table miq_event_definitions and its relationships from table relationships" do - deleted = miq_event_def_stub.create!(:name => "vm_discover") - ignored = miq_event_def_stub.create!(:name => "vm_start") - - deleted_rel = relationship_stub.create!(:resource_type => 'MiqEventDefinition', :resource_id => deleted.id) - ignored_rel = relationship_stub.create!(:resource_type => 'AnyOtherType', :resource_id => deleted.id) - - migrate - - expect { deleted.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { ignored.reload }.to_not raise_error - - expect { deleted_rel.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { ignored_rel.reload }.to_not raise_error - end - end -end diff --git a/spec/migrations/20160115111829_chargeback_rate_detail_currency_not_nil_spec.rb b/spec/migrations/20160115111829_chargeback_rate_detail_currency_not_nil_spec.rb deleted file mode 100644 index 8860e828f..000000000 --- a/spec/migrations/20160115111829_chargeback_rate_detail_currency_not_nil_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_migration - -describe ChargebackRateDetailCurrencyNotNil do - let(:chargeback_rate_detail_stub) { migration_stub(:ChargebackRateDetail) } - let(:chargeback_rate_detail_currency_stub) { migration_stub(:ChargebackRateDetailCurrency) } - - migration_context :up do - it "changes existing rate detail without currency to the default currency" do - chargeback_rate_detail = chargeback_rate_detail_stub.create(:chargeback_rate_detail_currency_id => nil) - migrate - - expect(chargeback_rate_detail.reload.chargeback_rate_detail_currency_id).not_to be_nil - end - - it "doesn't change the chargeback_rate_detail if it has already a currency" do - chargeback_rate_detail = chargeback_rate_detail_stub.create(:chargeback_rate_detail_currency_id => 5) - migrate - - expect(chargeback_rate_detail.reload.chargeback_rate_detail_currency_id).to eq(5) - end - - it "does nothing if no chargeback_rate_details exist" do - migrate - - expect(chargeback_rate_detail_currency_stub.count).to eq(0) - end - end -end diff --git a/spec/migrations/20160115142023_remove_replicated_rows_from_newly_excluded_tables_spec.rb b/spec/migrations/20160115142023_remove_replicated_rows_from_newly_excluded_tables_spec.rb deleted file mode 100644 index e4cbdb519..000000000 --- a/spec/migrations/20160115142023_remove_replicated_rows_from_newly_excluded_tables_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -require_migration - -describe RemoveReplicatedRowsFromNewlyExcludedTables do - let(:event_def_stub) { migration_stub(:MiqEventDefinition) } - let(:scan_item_stub) { migration_stub(:ScanItem) } - let(:conf_stub) { migration_stub(:Configuration) } - - migration_context :up do - before do - allow(anonymous_class_with_id_regions).to receive(:my_region_number).and_return(99) - end - - it "removes the rows from the tables" do - event_def_stub.create!(:id => 99_000_000_000_005) - event_def_stub.create!(:id => 5) - event_def_stub.create!(:id => 1_000_000_000_005) - - scan_item_stub.create!(:id => 99_000_000_000_005) - scan_item_stub.create!(:id => 5) - scan_item_stub.create!(:id => 1_000_000_000_005) - - migrate - - expect(event_def_stub.count).to eq 1 - expect(event_def_stub.first.id).to eq 99_000_000_000_005 - - expect(scan_item_stub.count).to eq 1 - expect(scan_item_stub.first.id).to eq 99_000_000_000_005 - end - - it "adds newly excluded tables to the replication worker configuration" do - empty_settings = { - :workers => { - :worker_base => { - :replication_worker => { - :replication => { - :exclude_tables => [] - } - } - } - } - } - config = conf_stub.create!(:typ => "vmdb", :settings => empty_settings) - - migrate - - config.reload - excludes = config.settings[:workers][:worker_base][:replication_worker][:replication][:exclude_tables] - expect(excludes).to include(event_def_stub.table_name) - expect(excludes).to include(scan_item_stub.table_name) - end - - it "adds newly excluded tables with datatype of keys as string " do - empty_settings = { - "workers" => { - "worker_base" => { - :replication_worker => { - :replication => { - :exclude_tables => [] - } - } - } - } - } - config = conf_stub.create!(:typ => "vmdb", :settings => empty_settings) - - migrate - - config.reload - excludes = config.settings[:workers][:worker_base][:replication_worker][:replication][:exclude_tables] - expect(excludes).to include(event_def_stub.table_name) - expect(excludes).to include(scan_item_stub.table_name) - end - end -end diff --git a/spec/migrations/20160119125950_add_created_on_for_container_entities_spec.rb b/spec/migrations/20160119125950_add_created_on_for_container_entities_spec.rb deleted file mode 100644 index 9420b76df..000000000 --- a/spec/migrations/20160119125950_add_created_on_for_container_entities_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -require_migration - -describe AddCreatedOnForContainerEntities do - CONTAINER_TABLES = described_class::CONTAINER_MODELS.collect { |m| m.table_name.to_sym } - - CONTAINER_TABLES.each { |table| let("#{table}_stub") { migration_stub(table.to_s.classify.to_sym) } } - - let(:mock_timestamp) { Time.zone.parse('2016-03-09 12:00:38.711120') } - let(:mock_name) { "Name_1" } - - migration_context :up do - it "populates new column created_on and ems_created_on with value from creation_timestamp" do - records = {} - - CONTAINER_TABLES.each do |table| - records[table] = send("#{table}_stub").create!(:name => mock_name, :creation_timestamp => mock_timestamp) - end - - migrate - - CONTAINER_TABLES.each do |table| - expect(records[table].reload.created_on).to eq(mock_timestamp) - expect(records[table].reload.ems_created_on).to eq(mock_timestamp) - end - end - end - - migration_context :down do - it "renames ems_created_on back to creation_timestamp and it has same value as ems_created_on" do - records = {} - - CONTAINER_TABLES.each do |table| - records[table] = send("#{table}_stub").create!(:name => mock_name, :ems_created_on => mock_timestamp) - end - - migrate - - CONTAINER_TABLES.each do |table| - expect(records[table].reload.creation_timestamp).to eq(mock_timestamp) - end - end - end -end diff --git a/spec/migrations/20160120151642_migrate_url_from_provider_to_endpoints_spec.rb b/spec/migrations/20160120151642_migrate_url_from_provider_to_endpoints_spec.rb deleted file mode 100644 index ccd58b2eb..000000000 --- a/spec/migrations/20160120151642_migrate_url_from_provider_to_endpoints_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -require_migration - -describe MigrateUrlFromProviderToEndpoints do - let(:provider_stub) { migration_stub(:Provider) } - let(:endpoint_stub) { migration_stub(:Endpoint) } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it 'migrates Provider URL to Endpoints' do - provider = provider_stub.create!( - :url => "example.com" - ) - ems_stub.create!( - :provider_id => provider.id - ) - - migrate - - expect(endpoint_stub.count).to eq(1) - expect(endpoint_stub.first).to have_attributes( - :url => "example.com" - ) - end - - it 'handles nil port value properly' do - provider = provider_stub.create!( - :url => nil - ) - ems_stub.create!( - :provider_id => provider.id - ) - - migrate - - expect(endpoint_stub.first).to have_attributes( - :url => nil - ) - end - end - - migration_context :down do - it 'migrates Endpoint URL to Provider attributes' do - provider = provider_stub.create! - ems = ems_stub.create!( - :provider_id => provider.id - ) - endpoint_stub.create!( - :resource_type => "Provider", - :resource_id => ems.id, - :role => "default", - :url => "example.com" - ) - - migrate - - expect(endpoint_stub.count).to eq(0) - expect(provider.reload).to have_attributes( - :url => "example.com" - ) - end - - it 'handles nil port value properly' do - provider = provider_stub.create! - endpoint_stub.create!( - :url => nil - ) - - migrate - - expect(provider.reload).to have_attributes( - :url => nil - ) - end - end -end diff --git a/spec/migrations/20160127210622_migrate_old_configuration_settings_spec.rb b/spec/migrations/20160127210622_migrate_old_configuration_settings_spec.rb deleted file mode 100644 index c4665c532..000000000 --- a/spec/migrations/20160127210622_migrate_old_configuration_settings_spec.rb +++ /dev/null @@ -1,95 +0,0 @@ -require_migration - -describe MigrateOldConfigurationSettings do - let(:config_stub) { migration_stub(:Configuration) } - - let(:old_settings) do - { - :api => {:token_ttl => "5.minutes"}, - :server => {:role => "role1,role2"}, - :workers => { - :worker_base => { - :queue_worker_base => { - :ems_refresh_worker => { - :default_stuff => "default_stuff", - :ems_refresh_worker_rhevm => {:specific_stuff => "specific_stuff"}, - }, - :perf_collector_worker => { - :default_stuff => "default_stuff", - :ems_metrics_collector_worker_amazon => {:specific_stuff => "specific_stuff"}, - }, - :perf_processor_worker => { - :default_stuff => "default_stuff", - }, - }, - :event_catcher => { - :default_stuff => "default_stuff", - :event_catcher_redhat => {:specific_stuff => "specific_stuff"}, - } - } - } - } - end - - let(:new_settings) do - { - :api => {:token_ttl => "5.minutes"}, - :server => {:role => "role1,role2,user_interface,web_services"}, - :workers => { - :worker_base => { - :queue_worker_base => { - :ems_refresh_worker => {:defaults => {:default_stuff => "default_stuff"}}, - :ems_metrics_processor_worker => {:defaults => {:default_stuff => "default_stuff"}}, - :ems_metrics_collector_worker => {:defaults => {:default_stuff => "default_stuff"}}, - }, - :event_catcher => {:defaults => {:default_stuff => "default_stuff"}}, - } - } - } - end - - let(:new_settings_with_web_server_worker_keys) do - new_settings.tap do |s| - s.store_path(:workers, :worker_base, :ui_worker, {}) - s.store_path(:workers, :worker_base, :web_service_worker, {}) - s.store_path(:server, :role, "role1,role2,role3") - end - end - - migration_context :up do - it "with really old configuration data" do - config_stub.create!(:typ => "vmdb", :settings => old_settings) - - migrate - - settings = adjust_role!(config_stub.first.settings) - expect(settings).to eq new_settings - end - - it "with newer configuration data" do - config_stub.create!(:typ => "vmdb", :settings => new_settings) - - migrate - - settings = adjust_role!(config_stub.first.settings) - expect(settings).to eq new_settings - end - - it "will not modify the server roles if the ui_worker key is present" do - config_stub.create!(:typ => "vmdb", :settings => new_settings_with_web_server_worker_keys) - - migrate - - settings = adjust_role!(config_stub.first.settings) - expect(settings).to eq new_settings_with_web_server_worker_keys - end - end - - # Adjust the value of role to avoid sporadic test failures on the order of the roles - def adjust_role!(settings) - if (role = settings.fetch_path(:settings, :role)) - settings.store_path(:settings, :role, role.split(",").sort.join(",")) - end - settings - end -end diff --git a/spec/migrations/20160127210624_convert_configurations_to_settings_changes_spec.rb b/spec/migrations/20160127210624_convert_configurations_to_settings_changes_spec.rb deleted file mode 100644 index c00582e80..000000000 --- a/spec/migrations/20160127210624_convert_configurations_to_settings_changes_spec.rb +++ /dev/null @@ -1,213 +0,0 @@ -require_migration - -describe ConvertConfigurationsToSettingsChanges do - let(:data_dir) { Pathname.new(__dir__).join("data", File.basename(__FILE__, ".rb")) } - let(:config_stub) { migration_stub(:Configuration) } - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it 'converts migration data with fake templates' do - config_stub.create!( - :typ => "simple", - :miq_server_id => 1, - :settings => { - "values" => { - "array" => ["new val1", "new val2"], - "boolean" => false, - "empty_hash" => {"key1" => "x", "key2" => "y"}, - "int_with_method" => "20.minutes", - "integer" => 99, - "nil" => "not nil", - "non_existant" => "exists", - "non_nil" => "not nil", - "string" => "new value", - }, - "very" => { - "deeply" => { - "nested" => { - "string" => "new value" - } - } - } - } - ) - - config_stub.create!( - :typ => "vmdb", - :miq_server_id => 2, - :settings => { - "values" => { - "string" => "vmdb value", - }, - } - ) - - _non_existing_tmpl_file = config_stub.create!( - :typ => "hostdefaults", - :miq_server_id => 2, - :settings => { - "values" => { - "string" => "hostdefaults value", - }, - } - ) - - test_templates = { - "simple" => YAML.load_file(data_dir.join("simple.tmpl.yml")).deep_symbolize_keys, - "vmdb" => YAML.load_file(data_dir.join("simple.tmpl.yml")).deep_symbolize_keys - } - - # capture stdout, because stub_const will trigger method_missing in active_record/migration.rb - # at https://github.com/rails/rails/blob/efcf71fb64319519784fe1c69fd66f36fb52e47a/activerecord/lib/active_record/migration.rb#L838 - # which calls `say_with_time` - $stdout = StringIO.new - stub_const('ConvertConfigurationsToSettingsChanges::TEMPLATES', test_templates) - migrate - $stdout = STDOUT - - expect(settings_change_stub.count).to eq(12) - - deltas = settings_change_stub.where("key LIKE '/simple/%'").order(:id) - expect(deltas.size).to eq(11) - expect(deltas.collect(&:resource_type).uniq).to eq ["MiqServer"] - expect(deltas.collect(&:resource_id).uniq).to eq [1] - - expect(deltas[0]).to have_attributes( - :key => "/simple/values/array", - :value => ["new val1", "new val2"] - ) - expect(deltas[1]).to have_attributes( - :key => "/simple/values/boolean", - :value => false - ) - expect(deltas[2]).to have_attributes( - :key => "/simple/values/empty_hash/key1", - :value => "x" - ) - expect(deltas[3]).to have_attributes( - :key => "/simple/values/empty_hash/key2", - :value => "y" - ) - expect(deltas[4]).to have_attributes( - :key => "/simple/values/int_with_method", - :value => "20.minutes" - ) - expect(deltas[5]).to have_attributes( - :key => "/simple/values/integer", - :value => 99 - ) - expect(deltas[6]).to have_attributes( - :key => "/simple/values/nil", - :value => "not nil" - ) - expect(deltas[7]).to have_attributes( - :key => "/simple/values/non_nil", - :value => "not nil" - ) - expect(deltas[8]).to have_attributes( - :key => "/simple/values/string", - :value => "new value" - ) - expect(deltas[9]).to have_attributes( - :key => "/simple/values/non_existant", - :value => "exists" - ) - expect(deltas[10]).to have_attributes( - :key => "/simple/very/deeply/nested/string", - :value => "new value" - ) - - deltas = settings_change_stub.where.not("key LIKE '/simple/%'").order(:key) - expect(deltas.size).to eq(1) - - expect(deltas.first).to have_attributes( - :resource_type => "MiqServer", - :resource_id => 2, - :key => "/values/string", - :value => "vmdb value", - ) - end - - it 'converts migration data with real templates' do - vmdb_data = stringify_first_two_levels(described_class::TEMPLATES["vmdb"]) - vmdb_data.store_path("api", "token_ttl", "1.second") - config_stub.create!( - :typ => "vmdb", - :miq_server_id => 1, - :settings => vmdb_data - ) - - storage_data = stringify_first_two_levels(described_class::TEMPLATES["storage"]) - storage_data.store_path("alignment", "boundary", "1.byte") - config_stub.create!( - :typ => "storage", - :miq_server_id => 2, - :settings => storage_data - ) - - broker_notify_data = { - "exclude" => { - "HostSystem" => { - "config.property1" => nil, - "config.property2" => nil - }, - "VirtualMachine" => { - "config.property3" => nil, - "config.property4" => nil - } - }, - } - config_stub.create!( - :typ => "broker_notify_properties", - :miq_server_id => 3, - :settings => broker_notify_data - ) - - migrate - - deltas = settings_change_stub.where(:resource_id => 1) - expect(deltas.size).to eq(1) - - expect(deltas.first).to have_attributes( - :resource_type => "MiqServer", - :resource_id => 1, - :key => "/api/token_ttl", - :value => "1.second", - ) - - deltas = settings_change_stub.where(:resource_id => 2) - expect(deltas.size).to eq(1) - - expect(deltas.first).to have_attributes( - :resource_type => "MiqServer", - :resource_id => 2, - :key => "/storage/alignment/boundary", - :value => "1.byte", - ) - - deltas = settings_change_stub.where(:resource_id => 3).order(:key) - expect(deltas.size).to eq(2) - - expect(deltas[0]).to have_attributes( - :resource_type => "MiqServer", - :resource_id => 3, - :key => "/broker_notify_properties/exclude/HostSystem", - :value => %w(config.property1 config.property2), - ) - expect(deltas[1]).to have_attributes( - :resource_type => "MiqServer", - :resource_id => 3, - :key => "/broker_notify_properties/exclude/VirtualMachine", - :value => %w(config.property3 config.property4), - ) - end - end - - private - - def stringify_first_two_levels(hash) - hash = hash.stringify_keys - hash.keys.each { |k| hash[k] = hash[k].stringify_keys } - hash - end -end diff --git a/spec/migrations/20160203101130_add_orderable_to_orchestration_templates_spec.rb b/spec/migrations/20160203101130_add_orderable_to_orchestration_templates_spec.rb deleted file mode 100644 index ab52b0d57..000000000 --- a/spec/migrations/20160203101130_add_orderable_to_orchestration_templates_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe AddOrderableToOrchestrationTemplates do - let(:orchestration_template_stub) { migration_stub(:OrchestrationTemplate) } - - migration_context :up do - it "sets true to column orderable" do - orchestration_template = orchestration_template_stub.create! - - migrate - - expect(orchestration_template.reload.orderable).to be_truthy - end - end -end diff --git a/spec/migrations/20160214115800_inline_ems_id_spec.rb b/spec/migrations/20160214115800_inline_ems_id_spec.rb deleted file mode 100644 index c013cd7eb..000000000 --- a/spec/migrations/20160214115800_inline_ems_id_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require_migration - -describe InlineEmsId do - let(:container_stub) { migration_stub(:Container) } - let(:container_group_stub) { migration_stub(:ContainerGroup) } - let(:container_definition_stub) { migration_stub(:ContainerDefinition) } - let(:container_group) { container_group_stub.create!(:ems_id => 23) } - - migration_context :up do - it 'it sets the value of container.ems_id to the value of container.container_group.ems_id' do - container = container_stub.create!( - :container_group => container_group_stub.create!( - :ems_id => 23 - ) - ) - migrate - expect(container.reload.ems_id).to eq(23) - end - - it 'it sets the value of container.ems_id to the value of container_definition.container_group.ems_id' do - container_definition = container_definition_stub.create!( - :container_group => container_group_stub.create!( - :ems_id => 47 - ) - ) - migrate - expect(container_definition.reload.ems_id).to eq(47) - end - end -end diff --git a/spec/migrations/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager_spec.rb b/spec/migrations/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager_spec.rb deleted file mode 100644 index 4b6b4577f..000000000 --- a/spec/migrations/20160226092911_separate_openstack_network_manager_from_openstack_cloud_manager_spec.rb +++ /dev/null @@ -1,178 +0,0 @@ -require_migration - -describe SeparateOpenstackNetworkManagerFromOpenstackCloudManager do - def name_key(model_name) - case model_name - when :floating_ip - :fixed_ip_address - else - :name - end - end - - def create_record(x, order, name, network_manager = nil, network_manager_infra = nil) - case order - when :in - x[name] = send("#{name}_stub").create!(:type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id) - when :out - case x[:ems_out] - when 'new_ems' - x[:ems_out] = {:ems => network_manager} - when 'new_ems_infra' - x[:ems_out] = {:ems => network_manager_infra} - end - - x[name] = send("#{name}_stub").create!(:type => x[:type_out], - name_key(name) => x[:name], - :ems_id => x[:ems_out][:ems].id) - end - end - - def verify_record(x, order, name) - case order - when :in - expect(x[name].reload).to have_attributes( - :type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id, - ) - when :out - expect(x[name].reload).to have_attributes( - :type => x[:type_out], - name_key(name) => x[:name], - ) - if x[:ems_out].include?("new_ems") - expect(ems_row_entries.select { |e| e[:ems_in] }).to_not include(x[name].ems_id) - else - expect(x[name]).to have_attributes( - :ems_id => x[:ems_out][:ems].id, - ) - end - end - end - - def build_mock_data(model_class_name) - [ - { - :ems_in => ems_row_entries[0], - :ems_out => 'new_ems', - :name => "name_0", - :type_in => "ManageIQ::Providers::Openstack::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::NetworkManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[1], - :ems_out => 'new_ems_infra', - :name => "name_1", - :type_in => "ManageIQ::Providers::Openstack::InfraManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::NetworkManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[2], - :ems_out => ems_row_entries[2], - :name => "name_2", - :type_in => "ManageIQ::Providers::Amazon::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Amazon::CloudManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[3], - :ems_out => ems_row_entries[3], - :name => "name_3", - :type_in => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - }, - ] - end - - let(:all_model_names) do - [ - :cloud_network, - :cloud_subnet, - :network_port, - :network_router, - :floating_ip, - :security_group - ] - end - - - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - let(:network_port_stub) { migration_stub(:NetworkPort) } - let(:network_router_stub) { migration_stub(:NetworkRouter) } - let(:floating_ip_stub) { migration_stub(:FloatingIp) } - let(:security_group_stub) { migration_stub(:SecurityGroup) } - - let(:cloud_networks) { build_mock_data("CloudNetwork") } - let(:cloud_subnets) { build_mock_data("CloudSubnet") } - let(:network_ports) { build_mock_data("NetworkPort") } - let(:network_routers) { build_mock_data("NetworkRouter") } - let(:floating_ips) { build_mock_data("FloatingIp") } - let(:security_groups) { build_mock_data("SecurityGroup") } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Amazon::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager::CloudManager"} - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :out, model_name) } - end - - expect(ext_management_system_stub.count).to eq 6 - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - network_manager = ext_management_system_stub.create!( - :name => "cloud_network", - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems_id => ems_row_entries[0][:ems].id) - - network_manager_infra = ext_management_system_stub.create!( - :name => "infra_network", - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems_id => ems_row_entries[1][:ems].id) - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :out, model_name, network_manager, network_manager_infra) } - end - - expect(ext_management_system_stub.count).to eq 6 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - end - end -end diff --git a/spec/migrations/20160302203922_remove_is_datacenter_from_ems_folder_spec.rb b/spec/migrations/20160302203922_remove_is_datacenter_from_ems_folder_spec.rb deleted file mode 100644 index d76c0106a..000000000 --- a/spec/migrations/20160302203922_remove_is_datacenter_from_ems_folder_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_migration - -describe RemoveIsDatacenterFromEmsFolder do - let(:ems_folder_stub) { migration_stub(:EmsFolder) } - - migration_context :up do - it "sets the type column" do - folder = ems_folder_stub.create!(:name => "Datacenters", :is_datacenter => false) - dc = ems_folder_stub.create!(:name => "Prod-DC", :is_datacenter => true) - - migrate - - expect(folder.reload).to have_attributes(:type => nil) - expect(dc.reload).to have_attributes(:type => 'Datacenter') - end - end - - migration_context :down do - it "adds the is_datacenter column" do - dc = ems_folder_stub.create!(:name => "Prod-DC", :type => "Datacenter") - folder = ems_folder_stub.create!(:name => "Datacenters", :type => nil) - storage_cluster = ems_folder_stub.create!(:name => "Storage Cluster", :type => "StorageCluster") - - migrate - - expect(storage_cluster.reload).to have_attributes(:is_datacenter => false) - expect(folder.reload).to have_attributes(:is_datacenter => false) - expect(dc.reload).to have_attributes(:is_datacenter => true) - end - end -end diff --git a/spec/migrations/20160307205816_fix_event_class_for_evm_alert_event_spec.rb b/spec/migrations/20160307205816_fix_event_class_for_evm_alert_event_spec.rb deleted file mode 100644 index 719a5968a..000000000 --- a/spec/migrations/20160307205816_fix_event_class_for_evm_alert_event_spec.rb +++ /dev/null @@ -1,153 +0,0 @@ -require_migration - -describe FixEventClassForEvmAlertEvent do - let(:event_stream_stub) { migration_stub(:EventStream) } - - migration_context :up do - it "converts EmsCluster alert events from EmsEvent to MiqEvent" do - cluster_id = 123 - event = event_stream_stub.create!( - :type => 'EmsEvent', - :event_type => 'EVMAlertEvent', - :ems_cluster_id => cluster_id, - :ems_cluster_name => 'test_cluster', - :ems_cluster_uid => 'domain-c12' - ) - - migrate - event.reload - - expect(event).to have_attributes( - :type => 'MiqEvent', - :target_type => 'EmsCluster', - :target_id => cluster_id, - :ems_cluster_id => cluster_id, - :ems_cluster_name => 'test_cluster', - :ems_cluster_uid => 'domain-c12' - ) - end - - it "converts Host alert events from EmsEvent to MiqEvent" do - host_id = 233 - event = event_stream_stub.create!( - :type => 'EmsEvent', - :event_type => 'EVMAlertEvent', - :host_id => host_id, - :host_name => 'test_host' - ) - - migrate - event.reload - - expect(event).to have_attributes( - :type => 'MiqEvent', - :target_type => 'Host', - :target_id => host_id, - :host_id => host_id, - :host_name => 'test_host' - ) - end - - it "converts VmOrTemplate alert events from EmsEvent to MiqEvent" do - vm_id = 335 - event = event_stream_stub.create!( - :type => 'EmsEvent', - :event_type => 'EVMAlertEvent', - :vm_or_template_id => vm_id, - :vm_name => 'test_vm', - :vm_location => 'test_vm/test_vm.vmx' - ) - - migrate - event.reload - - expect(event).to have_attributes( - :type => 'MiqEvent', - :target_type => 'VmOrTemplate', - :target_id => vm_id, - :vm_or_template_id => vm_id, - :vm_name => 'test_vm', - :vm_location => 'test_vm/test_vm.vmx' - ) - end - end - - migration_context :down do - let(:cluster_stub) { migration_stub(:EmsCluster) } - let(:host_stub) { migration_stub(:Host) } - let(:vm_stub) { migration_stub(:Vm) } - - it "converts EmsCluster alert events from MiqEvent to EmsEvent" do - cluster = cluster_stub.create!(:name => 'test_cluster', :uid_ems => 'domain-c12') - event = event_stream_stub.create!( - :type => 'MiqEvent', - :event_type => 'EVMAlertEvent', - :target_type => 'EmsCluster', - :target_id => cluster.id, - :ems_cluster_id => cluster.id, - :ems_cluster_name => cluster.name, - :ems_cluster_uid => cluster.uid_ems - ) - - migrate - event.reload - - expect(event).to have_attributes( - :type => 'EmsEvent', - :target_type => nil, - :target_id => nil, - :ems_cluster_id => cluster.id, - :ems_cluster_name => cluster.name, - :ems_cluster_uid => cluster.uid_ems - ) - end - - it "converts Host alert events from MiqEvent to EmsEvent" do - host = host_stub.create!(:name => 'test_host') - event = event_stream_stub.create!( - :type => 'MiqEvent', - :event_type => 'EVMAlertEvent', - :target_type => 'Host', - :target_id => host.id, - :host_id => host.id, - :host_name => host.name - ) - - migrate - event.reload - - expect(event).to have_attributes( - :type => 'EmsEvent', - :target_type => nil, - :target_id => nil, - :host_id => host.id, - :host_name => host.name - ) - end - - it "converts VmOrTemplate alert events from MiqEvent to EmsEvent" do - vm = vm_stub.create!(:name => 'test_vm', :location => 'test_vm/test_vm.vmx') - event = event_stream_stub.create!( - :type => 'MiqEvent', - :event_type => 'EVMAlertEvent', - :target_type => 'VmOrTemplate', - :target_id => vm.id, - :vm_or_template_id => vm.id, - :vm_name => vm.name, - :vm_location => vm.location - ) - - migrate - event.reload - - expect(event).to have_attributes( - :type => 'EmsEvent', - :target_type => nil, - :target_id => nil, - :vm_or_template_id => vm.id, - :vm_name => vm.name, - :vm_location => vm.location - ) - end - end -end diff --git a/spec/migrations/20160308093916_migrate_security_protocol_atribute_to_endpoints_spec.rb b/spec/migrations/20160308093916_migrate_security_protocol_atribute_to_endpoints_spec.rb deleted file mode 100644 index 9e987e07f..000000000 --- a/spec/migrations/20160308093916_migrate_security_protocol_atribute_to_endpoints_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require_migration - -describe MigrateSecurityProtocolAtributeToEndpoints do - let(:endpoint_stub) { migration_stub(:Endpoint) } - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it 'migrates Security Protocol to Endpoints' do - ems_stub.create!( - :security_protocol => "ssl" - ) - - migrate - - expect(endpoint_stub.count).to eq(1) - expect(endpoint_stub.first).to have_attributes( - :security_protocol => "ssl" - ) - end - end - - migration_context :down do - it 'migrates Endpoint security_protocol to EMS' do - ems = ems_stub.create! - - endpoint_stub.create!( - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :role => "default", - :security_protocol => "ssl" - ) - - migrate - - expect(endpoint_stub.count).to eq(0) - expect(ems.reload).to have_attributes( - :security_protocol => "ssl" - ) - end - end -end diff --git a/spec/migrations/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets_spec.rb b/spec/migrations/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets_spec.rb deleted file mode 100644 index 858e67897..000000000 --- a/spec/migrations/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets_spec.rb +++ /dev/null @@ -1,210 +0,0 @@ -require_migration - -describe MoveNetworkPortCloudSubnetIdToNetworkPortsCloudSubnets do - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - let(:network_port_stub) { migration_stub(:NetworkPort) } - let(:cloud_subnet_network_port_stub) { migration_stub(:CloudSubnetNetworkPort) } - - let(:cloud_subnet_entries) do - [ - { - :type => "ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet", - :name => "cs1" - }, - { - :type => "ManageIQ::Providers::Azure::CloudManager::CloudSubnet", - :name => "cs2" - }, - { - :type => "ManageIQ::Providers::Amazon::CloudManager::CloudSubnet", - :name => "cs3" - }, - { - :type => "ManageIQ::Providers::AnotherManager::CloudManager::CloudSubnet", - :name => "cs4" - } - ] - end - - let(:network_port_entries) do - [ - { - :type => "ManageIQ::Providers::Openstack::NetworkManager::NetworkPort", - :cloud_subnet => cloud_subnet_entries[0], - :name => "np1" - }, - { - :type => "ManageIQ::Providers::Azure::CloudManager::NetworkPort", - :cloud_subnet => cloud_subnet_entries[1], - :name => "np2" - }, - { - :type => "ManageIQ::Providers::Amazon::CloudManager::NetworkPort", - :cloud_subnet => cloud_subnet_entries[2], - :name => "np3" - }, - { - :type => "ManageIQ::Providers::AnotherManager::CloudManager::NetworkPort", - :cloud_subnet => cloud_subnet_entries[3], - :name => "np4" - } - ] - end - - let(:cloud_subnet_network_port_entries) do - [ - { - :network_port => network_port_entries[0], - :cloud_subnet => cloud_subnet_entries[0], - :address => "addr1" - }, - { - :network_port => network_port_entries[1], - :cloud_subnet => cloud_subnet_entries[1], - :address => "addr1" - }, - { - :network_port => network_port_entries[2], - :cloud_subnet => cloud_subnet_entries[2], - :address => "addr1" - }, - { - :network_port => network_port_entries[3], - :cloud_subnet => cloud_subnet_entries[3], - :address => "addr1" - } - ] - end - - let(:remote_region_start) do - anonymous_class_with_id_regions.rails_sequence_start + - anonymous_class_with_id_regions.rails_sequence_factor - end - - migration_context :up do - it "migrates a series of representative row" do - cloud_subnet_entries.each do |x| - x[:object] = cloud_subnet_stub.create!( - :type => x[:type], - :name => x[:name]) - end - - network_port_entries.each do |x| - x[:object] = network_port_stub.create!( - :type => x[:type], - :cloud_subnet_id => x[:cloud_subnet][:object].id, - :name => x[:name]) - end - - expect(cloud_subnet_network_port_stub.count).to eq 0 - - migrate - - network_port_entries.each do |network_port| - expect(cloud_subnet_network_port_stub.find_by(:network_port_id => network_port[:object].id).cloud_subnet_id).to eq network_port[:object][:cloud_subnet_id] - end - - expect(cloud_subnet_network_port_stub.count).to eq 4 - end - - it "does not migrate rows from remote regions" do - id = remote_region_start - - cloud_subnet_entries.each do |x| - x[:object] = cloud_subnet_stub.create!( - :id => id, - :type => x[:type], - :name => x[:name]) - id += 1 - end - - network_port_entries.each do |x| - x[:object] = network_port_stub.create!( - :id => id, - :type => x[:type], - :cloud_subnet_id => x[:cloud_subnet][:object].id, - :name => x[:name]) - id += 1 - end - - expect(cloud_subnet_network_port_stub.count).to eq 0 - - migrate - - expect(cloud_subnet_network_port_stub.count).to eq 0 - end - end - - migration_context :down do - it "migrates a series of representative row" do - cloud_subnet_entries.each do |x| - x[:object] = cloud_subnet_stub.create!( - :type => x[:type], - :name => x[:name]) - end - - network_port_entries.each do |x| - x[:object] = network_port_stub.create!( - :type => x[:type], - :name => x[:name]) - end - - cloud_subnet_network_port_entries.each do |x| - x[:object] = cloud_subnet_network_port_stub.create!( - :address => x[:address], - :cloud_subnet_id => x[:cloud_subnet][:object].id, - :network_port_id => x[:network_port][:object].id) - end - - expect(cloud_subnet_network_port_stub.count).to eq 4 - - migrate - - cloud_subnet_network_port_entries.each do |cloud_subnet_network_port| - expect(network_port_stub.find_by(:id => cloud_subnet_network_port[:object].network_port_id).cloud_subnet_id).to eq cloud_subnet_network_port[:object][:cloud_subnet_id] - end - - expect(cloud_subnet_network_port_stub.count).to eq 0 - end - - it "does not migrate rows from remote regions" do - id = remote_region_start - - cloud_subnet_entries.each do |x| - x[:object] = cloud_subnet_stub.create!( - :id => id, - :type => x[:type], - :name => x[:name]) - id += 1 - end - - id = remote_region_start - - network_port_entries.each do |x| - x[:object] = network_port_stub.create!( - :id => id, - :type => x[:type], - :cloud_subnet_id => x[:cloud_subnet][:object].id, - :name => x[:name]) - id += 1 - end - - id = remote_region_start - - cloud_subnet_network_port_entries.each do |x| - x[:object] = cloud_subnet_network_port_stub.create!( - :id => id, - :address => x[:address], - :cloud_subnet_id => x[:cloud_subnet][:object].id, - :network_port_id => x[:network_port][:object].id) - id += 1 - end - - expect(cloud_subnet_network_port_stub.count).to eq 4 - - migrate - - expect(cloud_subnet_network_port_stub.count).to eq 4 - end - end -end diff --git a/spec/migrations/20160309223941_add_process_to_miq_requests_spec.rb b/spec/migrations/20160309223941_add_process_to_miq_requests_spec.rb deleted file mode 100644 index 16975444d..000000000 --- a/spec/migrations/20160309223941_add_process_to_miq_requests_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe AddProcessToMiqRequests do - migration_context :up do - let(:miq_request_stub) { migration_stub(:MiqRequest) } - - it "updates existing records" do - miq_request = miq_request_stub.create! - - migrate - - expect(miq_request.reload.process).to be true - end - end -end diff --git a/spec/migrations/20160310170333_add_service_ancestry_spec.rb b/spec/migrations/20160310170333_add_service_ancestry_spec.rb deleted file mode 100644 index 9fbfdb312..000000000 --- a/spec/migrations/20160310170333_add_service_ancestry_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -require_migration - -describe AddServiceAncestry do - let(:service_stub) { migration_stub(:Service) } - - migration_context :up do - # nodes: - # s1 - # s11 - # s111 - # s112 - # s2 - # s21 (created before parent) - it "updates tree" do - s21 = service_stub.create! - s1 = service_stub.create! - s2 = service_stub.create! - s11 = service_stub.create!(:service_id => s1.id) - s111 = service_stub.create!(:service_id => s11.id) - s112 = service_stub.create!(:service_id => s11.id) - s21.update(:service_id => s2.id) # note: s21.id < s2.id - - migrate - - expect(s1.reload.ancestry).to be_nil - expect(s2.reload.ancestry).to be_nil - - expect(s11.reload.ancestry).to eq(s1.id.to_s) - expect(s111.reload.ancestry).to eq("#{s1.id}/#{s11.id}") - expect(s112.reload.ancestry).to eq("#{s1.id}/#{s11.id}") - expect(s21.reload.ancestry).to eq(s2.id.to_s) - end - end - - migration_context :down do - it "updates tree" do - s21 = service_stub.create! - s1 = service_stub.create! - s2 = service_stub.create! - s11 = service_stub.create!(:ancestry => s1.id.to_s) - s111 = service_stub.create!(:ancestry => "#{s1.id}/#{s11.id}") - s112 = service_stub.create!(:ancestry => "#{s1.id}/#{s11.id}") - s21.update(:ancestry => s2.id.to_s) # note: s21.id < s2.id - - migrate - - expect(s1.reload.service_id).to eq(nil) - expect(s2.reload.service_id).to eq(nil) - - expect(s11.reload.service_id).to eq(s1.id) - expect(s111.reload.service_id).to eq(s11.id) - expect(s112.reload.service_id).to eq(s11.id) - expect(s21.reload.service_id).to eq(s2.id) - end - end -end diff --git a/spec/migrations/20160317160230_move_user_roles_to_entitlements_spec.rb b/spec/migrations/20160317160230_move_user_roles_to_entitlements_spec.rb deleted file mode 100644 index f230ba9ef..000000000 --- a/spec/migrations/20160317160230_move_user_roles_to_entitlements_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require_migration - -describe MoveUserRolesToEntitlements do - let(:miq_group_stub) { migration_stub(:MiqGroup) } - let(:entitlement_stub) { migration_stub(:Entitlement) } - let!(:miq_group1) { miq_group_stub.create!(:miq_user_role_id => 25) } - let!(:miq_group2) { miq_group_stub.create!(:miq_user_role_id => 50) } - - migration_context :up do - it "creates an entitlement for each miq_group with the miq_group_id and the group's miq_user_role" do - expect(entitlement_stub.count).to eq(0) - - migrate - - expect(entitlement_stub.exists?(:miq_group_id => miq_group1.id, :miq_user_role_id => 25)).to be_truthy - expect(entitlement_stub.exists?(:miq_group_id => miq_group2.id, :miq_user_role_id => 50)).to be_truthy - expect(entitlement_stub.count).to eq(2) - end - end -end diff --git a/spec/migrations/20160317194215_remove_miq_user_role_from_miq_groups_spec.rb b/spec/migrations/20160317194215_remove_miq_user_role_from_miq_groups_spec.rb deleted file mode 100644 index 2096d72c3..000000000 --- a/spec/migrations/20160317194215_remove_miq_user_role_from_miq_groups_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require_migration - -describe RemoveMiqUserRoleFromMiqGroups do - let(:miq_group_stub) { migration_stub(:MiqGroup) } - let(:entitlement_stub) { migration_stub(:Entitlement) } - let!(:miq_group) { miq_group_stub.create!(:entitlement => entitlement_stub.create!(:miq_user_role_id => 25)) } - - migration_context :down do - it "sets the miq_user_role_id back on miq_groups" do - migrate - expect(miq_group.reload.miq_user_role_id).to eq 25 - end - end -end diff --git a/spec/migrations/20160322195653_move_switch_host_to_jointable_spec.rb b/spec/migrations/20160322195653_move_switch_host_to_jointable_spec.rb deleted file mode 100644 index 3e8d79555..000000000 --- a/spec/migrations/20160322195653_move_switch_host_to_jointable_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require_migration - -describe MoveSwitchHostToJointable do - migration_context :up do - let(:switch_stub) { migration_stub(:Switch) } - let(:host_stub) { migration_stub(:Host) } - let(:host_switches_stub) { migration_stub(:HostSwitch) } - it 'Move host-to-switch relationship to host_switches table' do - host = host_stub.create! - switch1 = switch_stub.create!(:host_id => host.id) - switch2 = switch_stub.create!(:host_id => host.id) - - migrate - - expect(host_switches_stub.count).to eq 2 - expect(host_switches_stub.where(:host_id => host.id, :switch_id => switch1.id).count).to eq 1 - expect(host_switches_stub.where(:host_id => host.id, :switch_id => switch2.id).count).to eq 1 - end - end -end diff --git a/spec/migrations/20160322205357_remove_host_id_from_switch_spec.rb b/spec/migrations/20160322205357_remove_host_id_from_switch_spec.rb deleted file mode 100644 index 67fc7d143..000000000 --- a/spec/migrations/20160322205357_remove_host_id_from_switch_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require_migration - -describe RemoveHostIdFromSwitch do - before(:each) do - @host = host_stub.create! - @switch1 = switch_stub.create!(:hosts => [@host]) - @switch2 = switch_stub.create!(:hosts => [@host]) - end - - migration_context :down do - let(:switch_stub) { migration_stub(:Switch) } - let(:host_stub) { migration_stub(:Host) } - let(:host_switches_stub) { migration_stub(:HostSwitch) } - it 'Move host-to-switch relationship back to switches.host_id' do - migrate - - @host.reload - expect(@host.switches.length).to eq 2 - expect(switch_stub.where(:host_id => @host.id, :id => @switch1.id).count).to eq 1 - expect(switch_stub.where(:host_id => @host.id, :id => @switch2.id).count).to eq 1 - end - end -end diff --git a/spec/migrations/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet_spec.rb b/spec/migrations/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet_spec.rb deleted file mode 100644 index 24be90725..000000000 --- a/spec/migrations/20160323072209_set_correct_sti_type_and_ems_id_on_openstack_cloud_subnet_spec.rb +++ /dev/null @@ -1,178 +0,0 @@ -require_migration - -describe SetCorrectStiTypeAndEmsIdOnOpenstackCloudSubnet do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Amazon::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager::CloudManager"} - ] - end - - let(:ems_network_row_entries) do - [ - { - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems => ems_row_entries[0] - }, - { - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems => ems_row_entries[1] - }, - { - :type => "ManageIQ::Providers::Amazon::NetworkManager", - :parent_ems => ems_row_entries[2] - }, - { - :type => "ManageIQ::Providers::AnotherManager::NetworkManager", - :parent_ems => ems_row_entries[3] - } - ] - end - - let(:network_row_entries) do - [ - { - :ems => ems_network_row_entries[0], - :name => "network_1", - :type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork::Private', - }, - { - :ems => ems_network_row_entries[1], - :name => "network_2", - :type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork::Private', - }, - { - :ems => ems_network_row_entries[2], - :name => "network_3", - :type => 'ManageIQ::Providers::Amazon::CloudManager::CloudNetwork', - }, - { - :ems => ems_network_row_entries[3], - :name => "network_4", - :type => nil, - }, - { - :ems => ems_network_row_entries[3], - :name => "network_5", - :type => 'ManageIQ::Providers::AnyManager::CloudNetwork', - }, - ] - end - - let(:subnet_row_entries) do - [ - { - :cloud_network => network_row_entries[0], - :name => "subnet_1", - :type_in => 'ManageIQ::Providers::Openstack::CloudManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :ems_out => ems_network_row_entries[0] - }, - { - :cloud_network => network_row_entries[1], - :name => "subnet_2", - :type_in => 'ManageIQ::Providers::Openstack::InfraManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :ems_out => ems_network_row_entries[1] - }, - { - :cloud_network => network_row_entries[2], - :name => "subnet_3", - :type_in => 'ManageIQ::Providers::Amazon::CloudManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::Amazon::CloudManager::CloudSubnet', - :ems_out => nil - }, - { - :cloud_network => network_row_entries[3], - :name => "subnet_4", - :type_in => nil, - :type_out => nil, - :ems_out => nil - }, - { - :cloud_network => network_row_entries[4], - :name => "subnet_5", - :type_in => 'ManageIQ::Providers::AnyManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::AnyManager::CloudSubnet', - :ems_out => nil - }, - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - ems_network_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type], - :parent_ems_id => x[:parent_ems][:ems].id) - end - - network_row_entries.each do |x| - x[:cloud_network] = cloud_network_stub.create!(:type => x[:type], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - subnet_row_entries.each do |x| - x[:cloud_subnet] = cloud_subnet_stub.create!(:type => x[:type_in], - :cloud_network_id => x[:cloud_network][:cloud_network].id, - :name => x[:name]) - end - - migrate - - subnet_row_entries.each do |x| - expect(x[:cloud_subnet].reload).to have_attributes( - :type => x[:type_out], - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id) - ) - end - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - ems_network_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type], - :parent_ems_id => x[:parent_ems][:ems].id) - end - - network_row_entries.each do |x| - x[:cloud_network] = cloud_network_stub.create!(:type => x[:type], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - subnet_row_entries.each do |x| - x[:cloud_subnet] = cloud_subnet_stub.create!(:type => x[:type_out], - :cloud_network_id => x[:cloud_network][:cloud_network].id, - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id)) - end - - migrate - - subnet_row_entries.each do |x| - expect(x[:cloud_subnet].reload).to have_attributes( - :type => x[:type_in], - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id) - ) - end - end - end -end diff --git a/spec/migrations/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager_spec.rb b/spec/migrations/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager_spec.rb deleted file mode 100644 index 60ba7ddea..000000000 --- a/spec/migrations/20160324085532_separate_amazon_network_manager_from_amazon_cloud_manager_spec.rb +++ /dev/null @@ -1,170 +0,0 @@ -require_migration - -describe SeparateAmazonNetworkManagerFromAmazonCloudManager do - def name_key(model_name) - case model_name - when :floating_ip - :fixed_ip_address - else - :name - end - end - - def create_record(x, order, name, network_manager = nil) - case order - when :in - x[name] = send("#{name}_stub").create!(:type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id) - when :out - case x[:ems_out] - when 'new_ems' - x[:ems_out] = {:ems => network_manager} - end - - x[name] = send("#{name}_stub").create!(:type => x[:type_out], - name_key(name) => x[:name], - :ems_id => x[:ems_out][:ems].id) - end - end - - def verify_record(x, order, name) - case order - when :in - expect(x[name].reload).to have_attributes( - :type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id, - ) - when :out - expect(x[name].reload).to have_attributes( - :type => x[:type_out], - name_key(name) => x[:name], - ) - if x[:ems_out].include?("new_ems") - expect(ems_row_entries.select { |e| e[:ems_in] }).to_not include(x[name].ems_id) - else - expect(x[name]).to have_attributes( - :ems_id => x[:ems_out][:ems].id, - ) - end - end - end - - def build_mock_data(model_class_name) - [ - { - :ems_in => ems_row_entries[0], - :ems_out => ems_row_entries[0], - :name => "name_0", - :type_in => "ManageIQ::Providers::Openstack::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::CloudManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[1], - :ems_out => ems_row_entries[1], - :name => "name_1", - :type_in => "ManageIQ::Providers::Openstack::InfraManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::InfraManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[2], - :ems_out => 'new_ems', - :name => "name_2", - :type_in => "ManageIQ::Providers::Amazon::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Amazon::NetworkManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[3], - :ems_out => ems_row_entries[3], - :name => "name_3", - :type_in => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - }, - ] - end - - let(:all_model_names) do - [ - :cloud_network, - :cloud_subnet, - :network_port, - :network_router, - :floating_ip, - :security_group - ] - end - - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - let(:network_port_stub) { migration_stub(:NetworkPort) } - let(:network_router_stub) { migration_stub(:NetworkRouter) } - let(:floating_ip_stub) { migration_stub(:FloatingIp) } - let(:security_group_stub) { migration_stub(:SecurityGroup) } - - let(:cloud_networks) { build_mock_data("CloudNetwork") } - let(:cloud_subnets) { build_mock_data("CloudSubnet") } - let(:network_ports) { build_mock_data("NetworkPort") } - let(:network_routers) { build_mock_data("NetworkRouter") } - let(:floating_ips) { build_mock_data("FloatingIp") } - let(:security_groups) { build_mock_data("SecurityGroup") } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Amazon::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager::CloudManager"} - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :out, model_name) } - end - - expect(ext_management_system_stub.count).to eq 5 - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - network_manager = ext_management_system_stub.create!( - :name => "cloud_network", - :type => "ManageIQ::Providers::Amazon::NetworkManager", - :parent_ems_id => ems_row_entries[2][:ems].id) - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :out, model_name, network_manager) } - end - - expect(ext_management_system_stub.count).to eq 5 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - end - end -end diff --git a/spec/migrations/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet_spec.rb b/spec/migrations/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet_spec.rb deleted file mode 100644 index ca0b4ee2d..000000000 --- a/spec/migrations/20160324094427_set_correct_sti_type_and_ems_id_on_amazon_cloud_subnet_spec.rb +++ /dev/null @@ -1,178 +0,0 @@ -require_migration - -describe SetCorrectStiTypeAndEmsIdOnAmazonCloudSubnet do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Amazon::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager::CloudManager"} - ] - end - - let(:ems_network_row_entries) do - [ - { - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems => ems_row_entries[0] - }, - { - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems => ems_row_entries[1] - }, - { - :type => "ManageIQ::Providers::Amazon::NetworkManager", - :parent_ems => ems_row_entries[2] - }, - { - :type => "ManageIQ::Providers::AnotherManager::NetworkManager", - :parent_ems => ems_row_entries[3] - } - ] - end - - let(:network_row_entries) do - [ - { - :ems => ems_network_row_entries[0], - :name => "network_1", - :type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork::Private', - }, - { - :ems => ems_network_row_entries[1], - :name => "network_2", - :type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork::Private', - }, - { - :ems => ems_network_row_entries[2], - :name => "network_3", - :type => 'ManageIQ::Providers::Amazon::CloudManager::CloudNetwork', - }, - { - :ems => ems_network_row_entries[3], - :name => "network_4", - :type => nil, - }, - { - :ems => ems_network_row_entries[3], - :name => "network_5", - :type => 'ManageIQ::Providers::AnyManager::CloudNetwork', - }, - ] - end - - let(:subnet_row_entries) do - [ - { - :cloud_network => network_row_entries[0], - :name => "subnet_1", - :type_in => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :ems_out => nil - }, - { - :cloud_network => network_row_entries[1], - :name => "subnet_2", - :type_in => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :ems_out => nil - }, - { - :cloud_network => network_row_entries[2], - :name => "subnet_3", - :type_in => nil, - :type_out => 'ManageIQ::Providers::Amazon::NetworkManager::CloudSubnet', - :ems_out => ems_network_row_entries[2] - }, - { - :cloud_network => network_row_entries[3], - :name => "subnet_4", - :type_in => nil, - :type_out => nil, - :ems_out => nil - }, - { - :cloud_network => network_row_entries[4], - :name => "subnet_5", - :type_in => 'ManageIQ::Providers::AnyManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::AnyManager::CloudSubnet', - :ems_out => nil - }, - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - ems_network_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type], - :parent_ems_id => x[:parent_ems][:ems].id) - end - - network_row_entries.each do |x| - x[:cloud_network] = cloud_network_stub.create!(:type => x[:type], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - subnet_row_entries.each do |x| - x[:cloud_subnet] = cloud_subnet_stub.create!(:type => x[:type_in], - :cloud_network_id => x[:cloud_network][:cloud_network].id, - :name => x[:name]) - end - - migrate - - subnet_row_entries.each do |x| - expect(x[:cloud_subnet].reload).to have_attributes( - :type => x[:type_out], - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id) - ) - end - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - ems_network_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type], - :parent_ems_id => x[:parent_ems][:ems].id) - end - - network_row_entries.each do |x| - x[:cloud_network] = cloud_network_stub.create!(:type => x[:type], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - subnet_row_entries.each do |x| - x[:cloud_subnet] = cloud_subnet_stub.create!(:type => x[:type_out], - :cloud_network_id => x[:cloud_network][:cloud_network].id, - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id)) - end - - migrate - - subnet_row_entries.each do |x| - expect(x[:cloud_subnet].reload).to have_attributes( - :type => x[:type_in], - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id) - ) - end - end - end -end diff --git a/spec/migrations/20160324131349_add_hidden_to_ems_folders_spec.rb b/spec/migrations/20160324131349_add_hidden_to_ems_folders_spec.rb deleted file mode 100644 index 0be9d152c..000000000 --- a/spec/migrations/20160324131349_add_hidden_to_ems_folders_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe AddHiddenToEmsFolders do - migration_context :up do - let(:ems_folder_stub) { migration_stub(:EmsFolder) } - it 'sets EmsFolder.hidden to false' do - folder = ems_folder_stub.create! - - migrate - - folder.reload - expect(folder.hidden).to be false - end - end -end diff --git a/spec/migrations/20160328204930_remove_miq_server_product_update_join_table_spec.rb b/spec/migrations/20160328204930_remove_miq_server_product_update_join_table_spec.rb deleted file mode 100644 index f83983428..000000000 --- a/spec/migrations/20160328204930_remove_miq_server_product_update_join_table_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -require_migration - -describe RemoveMiqServerProductUpdateJoinTable do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - def next_miq_server_id - @miq_server_id ||= anonymous_class_with_id_regions.rails_sequence_start - @miq_server_id += 1 - end - - migration_context :up do - it "removes miq_servers_product_updates from replication excludes" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(miq_servers_product_updates schema_migrations) - ) - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(miq_servers_product_updates ar_internal_metadata) - ) - - migrate - - changes = settings_change_stub.where(:key => described_class::EXCLUDES_KEY) - changes.each do |c| - expect(c.value).not_to include("miq_servers_product_updates") - end - end - end - - migration_context :down do - it "adds miq_servers_product_updates to replication excludes" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => ["schema_migrations"] - ) - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => ["ar_internal_metadata"] - ) - - migrate - - changes = settings_change_stub.where(:key => described_class::EXCLUDES_KEY) - changes.each do |c| - expect(c.value).to include("miq_servers_product_updates") - end - end - end -end diff --git a/spec/migrations/20160405151142_remove_configurations_from_replication_excludes_spec.rb b/spec/migrations/20160405151142_remove_configurations_from_replication_excludes_spec.rb deleted file mode 100644 index fcd79f640..000000000 --- a/spec/migrations/20160405151142_remove_configurations_from_replication_excludes_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -require_migration - -describe RemoveConfigurationsFromReplicationExcludes do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - def next_miq_server_id - @miq_server_id ||= anonymous_class_with_id_regions.rails_sequence_start - @miq_server_id += 1 - end - - migration_context :up do - it "removes configurations from the replication excludes" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(configurations schema_migrations) - ) - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(configurations ar_internal_metadata) - ) - - migrate - - changes = settings_change_stub.where(:key => described_class::EXCLUDES_KEY) - changes.each { |c| expect(c.value).not_to include("configurations") } - end - end - - migration_context :down do - it "adds configurations to the replication excludes" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(schema_migrations) - ) - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(ar_internal_metadata) - ) - - migrate - - changes = settings_change_stub.where(:key => described_class::EXCLUDES_KEY) - changes.each { |c| expect(c.value).to include("configurations") } - end - end -end diff --git a/spec/migrations/20160406072945_separate_azure_network_manager_from_azure_cloud_manager_spec.rb b/spec/migrations/20160406072945_separate_azure_network_manager_from_azure_cloud_manager_spec.rb deleted file mode 100644 index 234f84127..000000000 --- a/spec/migrations/20160406072945_separate_azure_network_manager_from_azure_cloud_manager_spec.rb +++ /dev/null @@ -1,170 +0,0 @@ -require_migration - -describe SeparateAzureNetworkManagerFromAzureCloudManager do - def name_key(model_name) - case model_name - when :floating_ip - :fixed_ip_address - else - :name - end - end - - def create_record(x, order, name, network_manager = nil) - case order - when :in - x[name] = send("#{name}_stub").create!(:type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id) - when :out - case x[:ems_out] - when 'new_ems' - x[:ems_out] = {:ems => network_manager} - end - - x[name] = send("#{name}_stub").create!(:type => x[:type_out], - name_key(name) => x[:name], - :ems_id => x[:ems_out][:ems].id) - end - end - - def verify_record(x, order, name) - case order - when :in - expect(x[name].reload).to have_attributes( - :type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id, - ) - when :out - expect(x[name].reload).to have_attributes( - :type => x[:type_out], - name_key(name) => x[:name], - ) - if x[:ems_out].include?("new_ems") - expect(ems_row_entries.select { |e| e[:ems_in] }).to_not include(x[name].ems_id) - else - expect(x[name]).to have_attributes( - :ems_id => x[:ems_out][:ems].id, - ) - end - end - end - - def build_mock_data(model_class_name) - [ - { - :ems_in => ems_row_entries[0], - :ems_out => ems_row_entries[0], - :name => "name_0", - :type_in => "ManageIQ::Providers::Openstack::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::CloudManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[1], - :ems_out => ems_row_entries[1], - :name => "name_1", - :type_in => "ManageIQ::Providers::Openstack::InfraManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::InfraManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[2], - :ems_out => 'new_ems', - :name => "name_2", - :type_in => "ManageIQ::Providers::Azure::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Azure::NetworkManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[3], - :ems_out => ems_row_entries[3], - :name => "name_3", - :type_in => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - }, - ] - end - - let(:all_model_names) do - [ - :cloud_network, - :cloud_subnet, - :network_port, - :network_router, - :floating_ip, - :security_group - ] - end - - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - let(:network_port_stub) { migration_stub(:NetworkPort) } - let(:network_router_stub) { migration_stub(:NetworkRouter) } - let(:floating_ip_stub) { migration_stub(:FloatingIp) } - let(:security_group_stub) { migration_stub(:SecurityGroup) } - - let(:cloud_networks) { build_mock_data("CloudNetwork") } - let(:cloud_subnets) { build_mock_data("CloudSubnet") } - let(:network_ports) { build_mock_data("NetworkPort") } - let(:network_routers) { build_mock_data("NetworkRouter") } - let(:floating_ips) { build_mock_data("FloatingIp") } - let(:security_groups) { build_mock_data("SecurityGroup") } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Azure::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager::CloudManager"} - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :out, model_name) } - end - - expect(ext_management_system_stub.count).to eq 5 - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - network_manager = ext_management_system_stub.create!( - :name => "cloud_network", - :type => "ManageIQ::Providers::Azure::NetworkManager", - :parent_ems_id => ems_row_entries[2][:ems].id) - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :out, model_name, network_manager) } - end - - expect(ext_management_system_stub.count).to eq 5 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - end - end -end diff --git a/spec/migrations/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet_spec.rb b/spec/migrations/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet_spec.rb deleted file mode 100644 index 9dd2108f1..000000000 --- a/spec/migrations/20160406073037_set_correct_sti_type_and_ems_id_on_azure_cloud_subnet_spec.rb +++ /dev/null @@ -1,178 +0,0 @@ -require_migration - -describe SetCorrectStiTypeAndEmsIdOnAzureCloudSubnet do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Azure::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager::CloudManager"} - ] - end - - let(:ems_network_row_entries) do - [ - { - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems => ems_row_entries[0] - }, - { - :type => "ManageIQ::Providers::Openstack::NetworkManager", - :parent_ems => ems_row_entries[1] - }, - { - :type => "ManageIQ::Providers::Azure::NetworkManager", - :parent_ems => ems_row_entries[2] - }, - { - :type => "ManageIQ::Providers::AnotherManager::NetworkManager", - :parent_ems => ems_row_entries[3] - } - ] - end - - let(:network_row_entries) do - [ - { - :ems => ems_network_row_entries[0], - :name => "network_1", - :type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork::Private', - }, - { - :ems => ems_network_row_entries[1], - :name => "network_2", - :type => 'ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork::Private', - }, - { - :ems => ems_network_row_entries[2], - :name => "network_3", - :type => 'ManageIQ::Providers::Azure::CloudManager::CloudNetwork', - }, - { - :ems => ems_network_row_entries[3], - :name => "network_4", - :type => nil, - }, - { - :ems => ems_network_row_entries[3], - :name => "network_5", - :type => 'ManageIQ::Providers::AnyManager::CloudNetwork', - }, - ] - end - - let(:subnet_row_entries) do - [ - { - :cloud_network => network_row_entries[0], - :name => "subnet_1", - :type_in => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :ems_out => nil - }, - { - :cloud_network => network_row_entries[1], - :name => "subnet_2", - :type_in => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet', - :ems_out => nil - }, - { - :cloud_network => network_row_entries[2], - :name => "subnet_3", - :type_in => nil, - :type_out => 'ManageIQ::Providers::Azure::NetworkManager::CloudSubnet', - :ems_out => ems_network_row_entries[2] - }, - { - :cloud_network => network_row_entries[3], - :name => "subnet_4", - :type_in => nil, - :type_out => nil, - :ems_out => nil - }, - { - :cloud_network => network_row_entries[4], - :name => "subnet_5", - :type_in => 'ManageIQ::Providers::AnyManager::CloudSubnet', - :type_out => 'ManageIQ::Providers::AnyManager::CloudSubnet', - :ems_out => nil - }, - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - ems_network_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type], - :parent_ems_id => x[:parent_ems][:ems].id) - end - - network_row_entries.each do |x| - x[:cloud_network] = cloud_network_stub.create!(:type => x[:type], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - subnet_row_entries.each do |x| - x[:cloud_subnet] = cloud_subnet_stub.create!(:type => x[:type_in], - :cloud_network_id => x[:cloud_network][:cloud_network].id, - :name => x[:name]) - end - - migrate - - subnet_row_entries.each do |x| - expect(x[:cloud_subnet].reload).to have_attributes( - :type => x[:type_out], - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id) - ) - end - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - ems_network_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type], - :parent_ems_id => x[:parent_ems][:ems].id) - end - - network_row_entries.each do |x| - x[:cloud_network] = cloud_network_stub.create!(:type => x[:type], - :ems_id => x[:ems][:ems].id, - :name => x[:name]) - end - - subnet_row_entries.each do |x| - x[:cloud_subnet] = cloud_subnet_stub.create!(:type => x[:type_out], - :cloud_network_id => x[:cloud_network][:cloud_network].id, - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id)) - end - - migrate - - subnet_row_entries.each do |x| - expect(x[:cloud_subnet].reload).to have_attributes( - :type => x[:type_in], - :name => x[:name], - :ems_id => x[:ems_out].try(:[], :ems).try(:[], :id) - ) - end - end - end -end diff --git a/spec/migrations/20160406195810_add_id_primary_key_to_join_tables_spec.rb b/spec/migrations/20160406195810_add_id_primary_key_to_join_tables_spec.rb deleted file mode 100644 index 31d5cc796..000000000 --- a/spec/migrations/20160406195810_add_id_primary_key_to_join_tables_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -require_migration - -describe AddIdPrimaryKeyToJoinTables do - let(:connection) { described_class.connection } - let(:region_stub) { migration_stub(:MiqRegion) } - - migration_context :up do - context "on a replication target" do - let(:remote_region_id) { anonymous_class_with_id_regions.my_region_number + 1 } - let(:remote_region_range_start) { anonymous_class_with_id_regions.region_to_range(remote_region_id).begin } - let(:my_region_id) { anonymous_class_with_id_regions.my_region_number } - let(:my_region_range_start) { anonymous_class_with_id_regions.region_to_range(my_region_id).begin } - - before do - region_stub.create!(:id => my_region_range_start, :region => my_region_id) - region_stub.create!(:id => remote_region_range_start, :region => remote_region_id) - end - - it "removes rows from remote regions" do - described_class::JOIN_TABLES.each do |table| - connection.select_value <<-SQL - INSERT INTO #{table} VALUES (#{my_region_range_start}, #{my_region_range_start + 1}) - SQL - - connection.select_value <<-SQL - INSERT INTO #{table} VALUES (#{remote_region_range_start}, #{remote_region_range_start + 1}) - SQL - end - - migrate - - described_class::JOIN_TABLES.each do |table| - connection.select_all("SELECT * FROM #{table}").each do |row| - row.each do |k, v| - expect(anonymous_class_with_id_regions.id_in_current_region?(v)).to be(true), <<-EOS.lstrip - #{k} value (#{v}) in table #{table} is not in the correct region - EOS - end - end - end - end - end - - it "assigns an id in the correct range" do - described_class::JOIN_TABLES.each_with_index do |table, i| - connection.select_value <<-SQL - INSERT INTO #{table} VALUES (#{i}, #{i + 1}) - SQL - end - - migrate - - described_class::JOIN_TABLES.each do |table| - expect(connection.primary_keys(table)).to eq(["id"]) - - connection.select_all("SELECT * FROM #{table}").each do |row| - expect(anonymous_class_with_id_regions.id_in_current_region?(row["id"])).to be true - end - end - end - end -end diff --git a/spec/migrations/20160413191759_correct_sti_type_on_cloud_resource_quota_spec.rb b/spec/migrations/20160413191759_correct_sti_type_on_cloud_resource_quota_spec.rb deleted file mode 100644 index 5db7fd2c8..000000000 --- a/spec/migrations/20160413191759_correct_sti_type_on_cloud_resource_quota_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -require_migration - -describe CorrectStiTypeOnCloudResourceQuota do - let(:cloud_resource_quota_stub) { migration_stub(:CloudResourceQuota) } - let(:crq_entries) do - [ - {:old => {:type => 'somethingelse'}, - :new => {:type => 'somethingelse'}}, - {:old => {:type => described_class::OLD_TYPE}, - :new => {:type => described_class::NEW_TYPE}}, - {:old => {:type => described_class::EVEN_OLDER_TYPE}, - :new => {:type => described_class::NEW_TYPE}}, - ] - end - - migration_context :up do - it 'migrates a series of representative rows' do - crq_entries.each do |x| - x[:up] = cloud_resource_quota_stub.create!(x[:old]) - end - - migrate - - crq_entries.each do |x| - expect(x[:up].reload.type).to eq(x[:new][:type]) - end - end - end - - migration_context :down do - it 'migrates a series of representative rows' do - crq_entries.each do |x| - x[:up] = cloud_resource_quota_stub.create!(x[:new]) - end - - migrate - - crq_entries.take(2).each do |x| - expect(x[:up].reload.type).to eq(x[:old][:type]) - end - end - end -end diff --git a/spec/migrations/20160413202128_sti_configuration_script_spec.rb b/spec/migrations/20160413202128_sti_configuration_script_spec.rb deleted file mode 100644 index 983671038..000000000 --- a/spec/migrations/20160413202128_sti_configuration_script_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe StiConfigurationScript do - migration_context :up do - let(:configuration_script_stub) { migration_stub(:ConfigurationScript) } - - it "sets type" do - cs = configuration_script_stub.create! - - migrate - - expect(cs.reload.type).to eq("ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript") - end - end -end diff --git a/spec/migrations/20160414094300_change_capacity_to_hash_from_persistent_volume_spec.rb b/spec/migrations/20160414094300_change_capacity_to_hash_from_persistent_volume_spec.rb deleted file mode 100644 index c4a7b97f8..000000000 --- a/spec/migrations/20160414094300_change_capacity_to_hash_from_persistent_volume_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -require_migration - -describe ChangeCapacityToHashFromPersistentVolume do - let(:persistent_volume_stub) { migration_stub(:PersistentVolume) } - - migration_context :up do - it "changes capacity to hash" do - persistent_volume_stub.create!(:capacity => 'storage=10Gi') - migrate - expect(persistent_volume_stub.first.capacity).to eq(:storage => 10.gigabytes) - end - - it "changes capacity to hash with multiple values" do - persistent_volume_stub.create!(:capacity => 'storage=10Gi,foo=10') - migrate - expect(persistent_volume_stub.first.capacity).to eq(:storage => 10.gigabytes, :foo => 10) - end - - it "changes capacity to hash with nil value" do - persistent_volume_stub.create!(:capacity => nil) - migrate - expect(persistent_volume_stub.first.capacity).to eq({}) - end - - it "changes capacity to hash with bad value" do - persistent_volume_stub.create!(:capacity => "storage=190g") - migrate - expect(persistent_volume_stub.first.capacity).to eq({}) - end - end - - migration_context :down do - it "changes capacity to string" do - persistent_volume_stub.create!(:capacity => {:storage => 10.gigabytes}) - migrate - expect(persistent_volume_stub.first.capacity).to eq('storage=10737418240') - end - - it "changes capacity to string from multi value hash" do - persistent_volume_stub.create!(:capacity => {:storage => 10.gigabytes, :foo => 10}) - migrate - expect(persistent_volume_stub.first.capacity).to eq('storage=10737418240,foo=10') - end - - it "changes capacity to string from nil value" do - persistent_volume_stub.create!(:capacity => nil) - migrate - expect(persistent_volume_stub.first.capacity).to eq(nil) - end - - it "changes capacity to string from empty hash" do - persistent_volume_stub.create!(:capacity => {}) - migrate - expect(persistent_volume_stub.first.capacity).to eq(nil) - end - end -end diff --git a/spec/migrations/20160418141210_add_read_only_to_miq_alert_spec.rb b/spec/migrations/20160418141210_add_read_only_to_miq_alert_spec.rb deleted file mode 100644 index af13b8f25..000000000 --- a/spec/migrations/20160418141210_add_read_only_to_miq_alert_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require_migration - -describe AddReadOnlyToMiqAlert do - let(:miq_alert_stub) { migration_stub(:MiqAlert) } - - let(:guids) { described_class::MIQ_ALERT_GUIDS } - - migration_context :up do - it 'sets read_only to true value in for all records with guid from yaml file' do - guids.each { |guid| miq_alert_stub.create!(:guid => guid) } - - migrate - - guids.each { |guid| expect(miq_alert_stub.where(:guid => guid).first.reload.read_only).to be_truthy } - end - end -end diff --git a/spec/migrations/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports_spec.rb b/spec/migrations/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports_spec.rb deleted file mode 100644 index e312cef32..000000000 --- a/spec/migrations/20160425151234_set_report_type_from_chargeback_to_chargeback_vm_on_miq_reports_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -require_migration - -describe SetReportTypeFromChargebackToChargebackVmOnMiqReports do - let(:miq_report_stub) { migration_stub(:MiqReport) } - - migration_context :up do - it "sets with db = ChargeBack to ChargebackVm for column db and db_option[:rpt_type]" do - db_options = {} - db_options[:rpt_type] = described_class::CHARGEBACK_REPORT_DB_MODEL - - miq_reports = Array.new(2) do - miq_report_stub.create!(:db => described_class::CHARGEBACK_REPORT_DB_MODEL, :db_options => db_options) - end - - migrate - - miq_reports.each do |miq_report| - miq_report.reload - expect(miq_report.db).to eq(described_class::CHARGEBACK_VM_REPORT_DB_MODEL) - expect(miq_report.db_options[:rpt_type]).to eq(described_class::CHARGEBACK_VM_REPORT_DB_MODEL) - end - end - end - - migration_context :down do - it "sets with db = ChargeBackVm to Chargeback for column db and db_option[:rpt_type]" do - db_options = {} - db_options[:rpt_type] = described_class::CHARGEBACK_VM_REPORT_DB_MODEL - - miq_reports = Array.new(2) do - miq_report_stub.create!(:db => described_class::CHARGEBACK_VM_REPORT_DB_MODEL, :db_options => db_options) - end - - migrate - - miq_reports.each do |miq_report| - miq_report.reload - expect(miq_report.db).to eq(described_class::CHARGEBACK_REPORT_DB_MODEL) - expect(miq_report.db_options[:rpt_type]).to eq(described_class::CHARGEBACK_REPORT_DB_MODEL.downcase) - end - end - end -end diff --git a/spec/migrations/20160425161234_remove_deleted_tables_from_replication_settings_spec.rb b/spec/migrations/20160425161234_remove_deleted_tables_from_replication_settings_spec.rb deleted file mode 100644 index d5d72b427..000000000 --- a/spec/migrations/20160425161234_remove_deleted_tables_from_replication_settings_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -require_migration - -describe RemoveDeletedTablesFromReplicationSettings do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "removes deleted tables from an existing settings change" do - deleted_tables = %w(miq_events miq_license_contents vim_performances) - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/workers/worker_base/replication_worker/replication/exclude_tables", - :value => %w(table1 vim_performances table2 miq_events table3 miq_license_contents table4) - ) - - migrate - - expect(settings_change_stub.count).to eq(1) - - change = settings_change_stub.where("key LIKE '%/exclude_tables'").last - expect(change.value & deleted_tables).to be_empty - end - - it "appends added table to an existing settings change" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/workers/worker_base/replication_worker/replication/exclude_tables", - :value => %w(table1 table2 table3 table4) - ) - - migrate - - expect(settings_change_stub.count).to eq(1) - - change = settings_change_stub.where("key LIKE '%/exclude_tables'").last - expect(change.value).to eq %w(table1 table2 table3 table4 miq_event_definitions) - end - - it "does not append added table if already in existing settings change" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/workers/worker_base/replication_worker/replication/exclude_tables", - :value => %w(table1 miq_event_definitions table2 table3 table4) - ) - - migrate - - expect(settings_change_stub.count).to eq(1) - - change = settings_change_stub.where("key LIKE '%/exclude_tables'").last - expect(change.value).to eq %w(table1 miq_event_definitions table2 table3 table4) - end - end -end diff --git a/spec/migrations/20160425161235_correct_sti_type_on_cloud_tenant_spec.rb b/spec/migrations/20160425161235_correct_sti_type_on_cloud_tenant_spec.rb deleted file mode 100644 index 6d61128d0..000000000 --- a/spec/migrations/20160425161235_correct_sti_type_on_cloud_tenant_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require_migration - -describe CorrectStiTypeOnCloudTenant do - let(:cloud_tenant_stub) { migration_stub(:CloudTenant) } - let(:cloud_tenant_entries) do - [ - {:old => {:type => nil}, - :new => {:type => described_class::NEW_TYPE}} - ] - end - - migration_context :up do - it 'migrates a series of representative rows' do - cloud_tenant_entries.each do |x| - x[:up] = cloud_tenant_stub.create!(x[:old]) - end - - migrate - - cloud_tenant_entries.each do |x| - expect(x[:up].reload.type).to eq(x[:new][:type]) - end - end - end - - migration_context :down do - it 'migrates a series of representative rows' do - cloud_tenant_entries.each do |x| - x[:up] = cloud_tenant_stub.create!(x[:new]) - end - - migrate - - cloud_tenant_entries.take(2).each do |x| - expect(x[:up].reload.type).to eq(x[:old][:type]) - end - end - end -end diff --git a/spec/migrations/20160425161456_update_default_yum_repo_name_for56_spec.rb b/spec/migrations/20160425161456_update_default_yum_repo_name_for56_spec.rb deleted file mode 100644 index 61aac3440..000000000 --- a/spec/migrations/20160425161456_update_default_yum_repo_name_for56_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_migration - -describe UpdateDefaultYumRepoNameFor56 do - let(:db_stub) { migration_stub(:MiqDatabase) } - - migration_context :up do - it "migrates the repo data" do - existing_repo = "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms" - desired_repo = "cf-me-5.6-for-rhel-7-rpms rhel-server-rhscl-7-rpms" - db = db_stub.create!(:update_repo_name => existing_repo) - - migrate - - expect(db.reload.update_repo_name).to eq(desired_repo) - end - end - - migration_context :down do - it "migrates the data back" do - desired_repo = "cf-me-5.5-for-rhel-7-rpms rhel-server-rhscl-7-rpms" - existing_repo = "cf-me-5.6-for-rhel-7-rpms rhel-server-rhscl-7-rpms" - db = db_stub.create!(:update_repo_name => existing_repo) - - migrate - - expect(db.reload.update_repo_name).to eq(desired_repo) - end - end -end diff --git a/spec/migrations/20160428215825_move_filters_to_entitlements_spec.rb b/spec/migrations/20160428215825_move_filters_to_entitlements_spec.rb deleted file mode 100644 index de944faec..000000000 --- a/spec/migrations/20160428215825_move_filters_to_entitlements_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -require_migration - -describe MoveFiltersToEntitlements do - let(:miq_group_stub) { migration_stub(:MiqGroup) } - let(:entitlement_stub) { migration_stub(:Entitlement) } - let(:filters) do - {"managed" => [["/hue/hue/hue", "/stuff"], ["here"]], - "belongsto" => ["/stuffs/here"]} - end - - migration_context :up do - let!(:miq_group) do - miq_group_stub.create!(:entitlement => entitlement, - :filters => filters) - end - let!(:entitlement) { entitlement_stub.create!(:filters => nil) } - - it "moves filters to the associated entitlement" do - expect(entitlement.filters).to be_nil - migrate - expect(entitlement.reload.filters).to eq(filters) - end - end - - migration_context :down do - let!(:miq_group) do - miq_group_stub.create!(:entitlement => entitlement, - :filters => nil) - end - let!(:entitlement) { entitlement_stub.create!(:filters => filters) } - - it "moves filters to the associated entitlement" do - expect(miq_group.filters).to be_nil - migrate - expect(miq_group.reload.filters).to eq(filters) - end - end -end diff --git a/spec/migrations/20160607141810_remove_database_synchronization_role_spec.rb b/spec/migrations/20160607141810_remove_database_synchronization_role_spec.rb deleted file mode 100644 index b9d6533a9..000000000 --- a/spec/migrations/20160607141810_remove_database_synchronization_role_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require_migration - -describe RemoveDatabaseSynchronizationRole do - let(:server_role_stub) { migration_stub(:ServerRole) } - let(:assigned_role_stub) { migration_stub(:AssignedServerRole) } - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - let(:role_name) { "database_synchronization" } - - migration_context :up do - it "removes the server role" do - role = server_role_stub.create!(:name => role_name) - assigned_role_stub.create!(:server_role_id => role.id) - - migrate - - expect(server_role_stub.where(:name => role_name)).to be_empty - expect(assigned_role_stub.where(:server_role_id => role.id)).to be_empty - end - - it "removes the role from currently configured servers" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/server/role", - :value => "database_operations,event,reporting,scheduler,#{role_name}" - ) - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/server/role", - :value => "ems_operations,ems_inventory,#{role_name},user_interface" - ) - - migrate - - settings_change_stub.where(:key => "/server/role").each do |change| - expect(change.value).to_not include(role_name) - end - end - end -end diff --git a/spec/migrations/20160607141857_change_exclude_table_settings_key_spec.rb b/spec/migrations/20160607141857_change_exclude_table_settings_key_spec.rb deleted file mode 100644 index 947f21f2b..000000000 --- a/spec/migrations/20160607141857_change_exclude_table_settings_key_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require_migration - -describe ChangeExcludeTableSettingsKey do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "changes the key for the exclude tables" do - insert_test_records(described_class::OLD_KEY) - - migrate - - expect(settings_change_stub.where(:key => described_class::NEW_KEY).count).to eq 2 - expect(settings_change_stub.where(:key => described_class::OLD_KEY).count).to eq 0 - end - end - - migration_context :down do - it "changes the key for the exclude tables" do - insert_test_records(described_class::NEW_KEY) - - migrate - - expect(settings_change_stub.where(:key => described_class::OLD_KEY).count).to eq 2 - expect(settings_change_stub.where(:key => described_class::NEW_KEY).count).to eq 0 - end - end - - def insert_test_records(key) - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => key, - :value => %w(table1 table2 table3) - ) - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => key, - :value => %w(table1 table3) - ) - end -end diff --git a/spec/migrations/20160627074242_separate_google_network_manager_from_google_cloud_manager_spec.rb b/spec/migrations/20160627074242_separate_google_network_manager_from_google_cloud_manager_spec.rb deleted file mode 100644 index 94514abd1..000000000 --- a/spec/migrations/20160627074242_separate_google_network_manager_from_google_cloud_manager_spec.rb +++ /dev/null @@ -1,170 +0,0 @@ -require_migration - -describe SeparateGoogleNetworkManagerFromGoogleCloudManager do - def name_key(model_name) - case model_name - when :floating_ip - :fixed_ip_address - else - :name - end - end - - def create_record(x, order, name, network_manager = nil) - case order - when :in - x[name] = send("#{name}_stub").create!(:type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id) - when :out - case x[:ems_out] - when 'new_ems' - x[:ems_out] = {:ems => network_manager} - end - - x[name] = send("#{name}_stub").create!(:type => x[:type_out], - name_key(name) => x[:name], - :ems_id => x[:ems_out][:ems].id) - end - end - - def verify_record(x, order, name) - case order - when :in - expect(x[name].reload).to have_attributes( - :type => x[:type_in], - name_key(name) => x[:name], - :ems_id => x[:ems_in][:ems].id, - ) - when :out - expect(x[name].reload).to have_attributes( - :type => x[:type_out], - name_key(name) => x[:name], - ) - if x[:ems_out].include?("new_ems") - expect(ems_row_entries.select { |e| e[:ems_in] }).to_not include(x[name].ems_id) - else - expect(x[name]).to have_attributes( - :ems_id => x[:ems_out][:ems].id, - ) - end - end - end - - def build_mock_data(model_class_name) - [ - { - :ems_in => ems_row_entries[0], - :ems_out => ems_row_entries[0], - :name => "name_0", - :type_in => "ManageIQ::Providers::Openstack::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::CloudManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[1], - :ems_out => ems_row_entries[1], - :name => "name_1", - :type_in => "ManageIQ::Providers::Openstack::InfraManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Openstack::InfraManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[2], - :ems_out => 'new_ems', - :name => "name_2", - :type_in => "ManageIQ::Providers::Google::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::Google::NetworkManager::#{model_class_name}", - }, - { - :ems_in => ems_row_entries[3], - :ems_out => ems_row_entries[3], - :name => "name_3", - :type_in => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - :type_out => "ManageIQ::Providers::AnotherManager::CloudManager::#{model_class_name}", - }, - ] - end - - let(:all_model_names) do - [ - :cloud_network, - :cloud_subnet, - :network_port, - :network_router, - :floating_ip, - :security_group - ] - end - - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:cloud_network_stub) { migration_stub(:CloudNetwork) } - let(:cloud_subnet_stub) { migration_stub(:CloudSubnet) } - let(:network_port_stub) { migration_stub(:NetworkPort) } - let(:network_router_stub) { migration_stub(:NetworkRouter) } - let(:floating_ip_stub) { migration_stub(:FloatingIp) } - let(:security_group_stub) { migration_stub(:SecurityGroup) } - - let(:cloud_networks) { build_mock_data("CloudNetwork") } - let(:cloud_subnets) { build_mock_data("CloudSubnet") } - let(:network_ports) { build_mock_data("NetworkPort") } - let(:network_routers) { build_mock_data("NetworkRouter") } - let(:floating_ips) { build_mock_data("FloatingIp") } - let(:security_groups) { build_mock_data("SecurityGroup") } - - let(:ems_row_entries) do - [ - {:type => "ManageIQ::Providers::Openstack::CloudManager"}, - {:type => "ManageIQ::Providers::Openstack::InfraManager"}, - {:type => "ManageIQ::Providers::Google::CloudManager"}, - {:type => "ManageIQ::Providers::AnotherManager::CloudManager"} - ] - end - - migration_context :up do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :out, model_name) } - end - - expect(ext_management_system_stub.count).to eq 5 - end - end - - migration_context :down do - it "migrates a series of representative row" do - ems_row_entries.each do |x| - x[:ems] = ext_management_system_stub.create!(:type => x[:type]) - end - - network_manager = ext_management_system_stub.create!( - :name => "cloud_network", - :type => "ManageIQ::Providers::Google::NetworkManager", - :parent_ems_id => ems_row_entries[2][:ems].id) - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| create_record(x, :out, model_name, network_manager) } - end - - expect(ext_management_system_stub.count).to eq 5 - - migrate - - all_model_names.each do |model_name| - send(model_name.to_s.pluralize).each { |x| verify_record(x, :in, model_name) } - end - - expect(ext_management_system_stub.count).to eq 4 - end - end -end diff --git a/spec/migrations/20160628140841_fix_service_order_placed_at_spec.rb b/spec/migrations/20160628140841_fix_service_order_placed_at_spec.rb deleted file mode 100644 index f0a8267ce..000000000 --- a/spec/migrations/20160628140841_fix_service_order_placed_at_spec.rb +++ /dev/null @@ -1,89 +0,0 @@ -require_migration - -describe FixServiceOrderPlacedAt do - let(:service_order_stub) { migration_stub(:ServiceOrder) } - - migration_context :up do - it "should convert only items with state=ordered" do - ordered_item = service_order_stub.create!(:state => 'ordered', - :created_at => Time.zone.now - 1.day, - :updated_at => Time.zone.now - 12.hours, - :placed_at => nil) - wish_item = service_order_stub.create!(:state => 'wish', - :created_at => Time.zone.now - 1.day, - :updated_at => Time.zone.now - 12.hours, - :placed_at => nil) - cart_item = service_order_stub.create!(:state => 'cart', - :created_at => Time.zone.now - 1.day, - :updated_at => Time.zone.now - 12.hours, - :placed_at => nil) - - migrate - - ordered_item.reload - wish_item.reload - cart_item.reload - - expect(ordered_item.placed_at).not_to be_nil - expect(wish_item.placed_at).to be_nil - expect(cart_item.placed_at).to be_nil - end - - it "should convert more than one item" do - ordered_item_1 = service_order_stub.create!(:state => 'ordered', - :created_at => Time.zone.now - 1.day, - :updated_at => Time.zone.now - 12.hours, - :placed_at => nil) - ordered_item_2 = service_order_stub.create!(:state => 'ordered', - :created_at => Time.zone.now - 2.days, - :updated_at => Time.zone.now - 16.hours, - :placed_at => nil) - - migrate - - ordered_item_1.reload - ordered_item_2.reload - - expect(ordered_item_1.placed_at).not_to be_nil - expect(ordered_item_2.placed_at).not_to be_nil - end - - it "should use updated_at as the source" do - time_1 = Time.zone.now - 17.hours - time_2 = Time.zone.now - 13.hours - - ordered_item_1 = service_order_stub.create!(:state => 'ordered', - :created_at => Time.zone.now - 14.hours, - :updated_at => time_1, - :placed_at => nil) - ordered_item_2 = service_order_stub.create!(:state => 'ordered', - :created_at => Time.zone.now - 16.hours, - :updated_at => time_2, - :placed_at => nil) - - migrate - - ordered_item_1.reload - ordered_item_2.reload - - expect(ordered_item_1.placed_at).to be_within(1.second).of(time_1) - expect(ordered_item_2.placed_at).to be_within(1.second).of(time_2) - end - - it "should not overwrite existing placed_at" do - time_good = Time.zone.now - 19.hours - time_bad = Time.zone.now - 11.hours - - ordered_item = service_order_stub.create!(:state => 'ordered', - :created_at => Time.zone.now - 18.hours, - :updated_at => time_bad, - :placed_at => time_good) - - migrate - - ordered_item.reload - - expect(ordered_item.placed_at).to be_within(1.second).of(time_good) - end - end -end diff --git a/spec/migrations/20160708182331_remove_replication_worker_settings_spec.rb b/spec/migrations/20160708182331_remove_replication_worker_settings_spec.rb deleted file mode 100644 index 8c8adf512..000000000 --- a/spec/migrations/20160708182331_remove_replication_worker_settings_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_migration - -describe RemoveReplicationWorkerSettings do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "removes the replication worker settings" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/workers/worker_base/replication_worker/memory_threshold", - :value => "5.gigabytes" - ) - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/workers/worker_base/replication_worker/replication/destination/host", - :value => "somehost.example.com" - ) - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/workers/worker_base/replication_worker/replication/destination/user", - :value => "root" - ) - - migrate - - expect(settings_change_stub.where("key LIKE ?", "/workers/worker_base/replication_worker%").count).to eq 0 - end - end -end diff --git a/spec/migrations/20160713141244_upgrade_host_storage_from_reserved_spec.rb b/spec/migrations/20160713141244_upgrade_host_storage_from_reserved_spec.rb deleted file mode 100644 index d937e962f..000000000 --- a/spec/migrations/20160713141244_upgrade_host_storage_from_reserved_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require_migration - -describe UpgradeHostStorageFromReserved do - let(:reserve_stub) { Spec::Support::MigrationStubs.reserved_stub } - let(:host_storage_stub) { migration_stub(:HostStorage) } - - migration_context :up do - it "Migrates Reserves data to HostStorage" do - hs = host_storage_stub.create! - reserve_stub.create!( - :resource_type => "HostStorage", - :resource_id => hs.id, - :reserved => { - :ems_ref => "datastore-1" - } - ) - - migrate - - hs.reload - - expect(reserve_stub.count).to eq(0) - expect(hs.ems_ref).to eq("datastore-1") - end - end - - migration_context :down do - it "Migrates ems_ref in HostStorage to Reserves table" do - hs = host_storage_stub.create!( - :host_id => anonymous_class_with_id_regions.rails_sequence_start, - :storage_id => anonymous_class_with_id_regions.rails_sequence_start, - :ems_ref => "datastore-1" - ) - - migrate - - r = reserve_stub.first - - expect(reserve_stub.count).to eq(1) - expect(r.resource_id).to eq(hs.id) - expect(r.resource_type).to eq("HostStorage") - expect(r.reserved).to eq(:ems_ref => "datastore-1") - end - end -end diff --git a/spec/migrations/20160729182517_remove_system_add_source_to_miq_ae_namespace_spec.rb b/spec/migrations/20160729182517_remove_system_add_source_to_miq_ae_namespace_spec.rb deleted file mode 100644 index 7f1d8bb28..000000000 --- a/spec/migrations/20160729182517_remove_system_add_source_to_miq_ae_namespace_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require_migration - -describe RemoveSystemAddSourceToMiqAeNamespace do - let(:miq_ae_namespace_stub) { migration_stub(:MiqAeNamespace) } - - migration_context :up do - it "migrates system to source" do - miq_ae_namespace_stub.create!(:name => 'ManageIQ', :system => true, :parent_id => nil) - miq_ae_namespace_stub.create!(:name => 'Customer', :system => true, :parent_id => nil) - miq_ae_namespace_stub.create!(:name => 'Temp', :system => false, :parent_id => nil) - - migrate - - expect(miq_ae_namespace_stub.count).to eq 3 - expect(miq_ae_namespace_stub.find_by_name('ManageIQ').source).to eql("system") - expect(miq_ae_namespace_stub.find_by_name('Customer').source).to eql("user_locked") - expect(miq_ae_namespace_stub.find_by_name('Temp').source).to eql("user") - end - end - - migration_context :down do - it "migrates source to system" do - miq_ae_namespace_stub.create!(:name => 'ManageIQ', :source => "system", :parent_id => nil) - miq_ae_namespace_stub.create!(:name => 'Customer', :source => "user_locked", :parent_id => nil) - miq_ae_namespace_stub.create!(:name => 'Temp', :source => "user", :parent_id => nil) - - migrate - - expect(miq_ae_namespace_stub.count).to eq 3 - expect(miq_ae_namespace_stub.find_by_name('ManageIQ').system).to be_truthy - expect(miq_ae_namespace_stub.find_by_name('Customer').system).to be_truthy - expect(miq_ae_namespace_stub.find_by_name('Temp').system).to be_falsey - end - end -end diff --git a/spec/migrations/20160802145938_set_generic_subtype_on_service_template_spec.rb b/spec/migrations/20160802145938_set_generic_subtype_on_service_template_spec.rb deleted file mode 100644 index 39db2e21c..000000000 --- a/spec/migrations/20160802145938_set_generic_subtype_on_service_template_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require_migration - -describe SetGenericSubtypeOnServiceTemplate do - let(:service_template_stub) { migration_stub(:ServiceTemplate) } - - migration_context :up do - it 'sets generic_subtype to custom on generic Service Templates' do - st = service_template_stub.create!(:prov_type => 'generic') - - migrate - - expect(st.reload.generic_subtype).to eq('custom') - end - - it 'skips non-generic Service Templates' do - st = service_template_stub.create!(:prov_type => 'vmware') - - migrate - - expect(st.reload.generic_subtype).to be_nil - end - end - - migration_context :down do - it 'sets generic_subtype to nil on generic Service Templates' do - st = service_template_stub.create!(:prov_type => 'generic', :generic_subtype => 'custom') - - migrate - - expect(st.reload.generic_subtype).to be_nil - end - - it 'skips non-generic Service Templates' do - st = service_template_stub.create!(:prov_type => 'vmware', :generic_subtype => 'something') - - migrate - - expect(st.reload.generic_subtype).to eq('something') - end - end -end diff --git a/spec/migrations/20160825070810_fix_null_verify_ssl_on_endpoints_spec.rb b/spec/migrations/20160825070810_fix_null_verify_ssl_on_endpoints_spec.rb deleted file mode 100644 index fcc8ac388..000000000 --- a/spec/migrations/20160825070810_fix_null_verify_ssl_on_endpoints_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require_migration - -describe FixNullVerifySslOnEndpoints do - let(:endpoint_stub) { migration_stub(:Endpoint) } - - migration_context :up do - it "changes verify_ssl to 1 only for the nil ones" do - endpoint_stub.create!(:verify_ssl => nil) - endpoint_stub.create!(:verify_ssl => 0) - endpoint_stub.create!(:verify_ssl => 1) - - migrate - - expect(endpoint_stub.where(:verify_ssl => nil).count).to eq 0 - expect(endpoint_stub.where(:verify_ssl => 0).count).to eq 1 - expect(endpoint_stub.where(:verify_ssl => 1).count).to eq 2 - end - end -end diff --git a/spec/migrations/20160825152940_fix_port_zero_on_enpoints_spec.rb b/spec/migrations/20160825152940_fix_port_zero_on_enpoints_spec.rb deleted file mode 100644 index 77b6d994a..000000000 --- a/spec/migrations/20160825152940_fix_port_zero_on_enpoints_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require_migration - -describe FixPortZeroOnEnpoints do - let(:endpoint_stub) { migration_stub(:Endpoint) } - - migration_context :up do - it "changes ports only for those with 0" do - endpoint_stub.create!(:port => nil) - endpoint_stub.create!(:port => 0) - endpoint_stub.create!(:port => 443) - - migrate - - expect(endpoint_stub.where(:port => nil).count).to eq 2 - expect(endpoint_stub.where(:port => 0).count).to eq 0 - expect(endpoint_stub.where(:port => 443).count).to eq 1 - end - end -end diff --git a/spec/migrations/20160826184028_add_notification_tables_to_replication_excludes_spec.rb b/spec/migrations/20160826184028_add_notification_tables_to_replication_excludes_spec.rb deleted file mode 100644 index 81c66b29e..000000000 --- a/spec/migrations/20160826184028_add_notification_tables_to_replication_excludes_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -require_migration - -describe AddNotificationTablesToReplicationExcludes do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - def next_miq_server_id - @miq_server_id ||= anonymous_class_with_id_regions.rails_sequence_start - @miq_server_id += 1 - end - - migration_context :up do - it "adds notification tables to the replication excludes" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(schema_migrations) - ) - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(ar_internal_metadata) - ) - - migrate - - changes = settings_change_stub.where(:key => described_class::EXCLUDES_KEY) - changes.each do |c| - expect(c.value).to include("notifications") - expect(c.value).to include("notification_types") - expect(c.value).to include("notification_recipients") - end - end - end - - migration_context :down do - it "removes notification tables from the replication excludes" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(notification_types notifications schema_migrations) - ) - settings_change_stub.create!( - :resource_type => "MiqServer", - :resource_id => next_miq_server_id, - :key => described_class::EXCLUDES_KEY, - :value => %w(notification_types notification_recipients ar_internal_metadata) - ) - - migrate - - changes = settings_change_stub.where(:key => described_class::EXCLUDES_KEY) - changes.each do |c| - expect(c.value).not_to include("notifications") - expect(c.value).not_to include("notification_types") - expect(c.value).not_to include("notification_recipients") - end - end - end -end diff --git a/spec/migrations/20160829134746_remove_atomic_container_providers_spec.rb b/spec/migrations/20160829134746_remove_atomic_container_providers_spec.rb deleted file mode 100644 index 4db6a90e7..000000000 --- a/spec/migrations/20160829134746_remove_atomic_container_providers_spec.rb +++ /dev/null @@ -1,126 +0,0 @@ -require_migration - -describe RemoveAtomicContainerProviders do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:auth_stub) { migration_stub(:Authentication) } - let(:workers_stub) { migration_stub(:MiqWorker) } - let(:queue_stub) { migration_stub(:MiqQueue) } - - migration_context :up do - it "Updates Atomic Provider to Openshift and Atomic Enterprise to Openshift Enterprise" do - type_examples = [ - {:table => ems_stub, - :pre_migration => "ManageIQ::Providers::Atomic::ContainerManager", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager", - :record => nil}, - - {:table => ems_stub, - :pre_migration => "ManageIQ::Providers::AtomicEnterprise::ContainerManager", - :post_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager", - :record => nil}, - - {:table => ems_stub, - :pre_migration => "EmsOther", - :post_migration => "EmsOther", - :record => nil}, - - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::Atomic::ContainerManager::EventCatcher", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager::EventCatcher", - :record => nil}, - - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::Atomic::ContainerManager::MetricsCollectorWorker", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager::MetricsCollectorWorker", - :record => nil}, - - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::Atomic::ContainerManager::RefreshWorker", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker", - :record => nil}, - - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::AtomicEnterprise::ContainerManager::EventCatcher", - :post_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventCatcher", - :record => nil}, - - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::AtomicEnterprise::ContainerManager::MetricsCollectorWorker", - :post_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::MetricsCollectorWorker", - :record => nil}, - - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::AtomicEnterprise::ContainerManager::RefreshWorker", - :post_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshWorker", - :record => nil}, - - {:table => workers_stub, - :pre_migration => "OtherWorker", - :post_migration => "OtherWorker", - :record => nil} - ].each do |ex| - ex[:record] = ex[:table].create!(:type => ex[:pre_migration]) - end - - name_examples = [ - {:table => auth_stub, - :pre_migration => "ManageIQ::Providers::Atomic::ContainerManager Server1", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager Server1", - :record => nil}, - - {:table => auth_stub, - :pre_migration => "ManageIQ::Providers::AtomicEnterprise::ContainerManager Server2", - :post_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager Server2", - :record => nil}, - - {:table => auth_stub, - :pre_migration => "EmsOther Server3", - :post_migration => "EmsOther Server3", - :record => nil} - ].each do |ex| - ex[:record] = ex[:table].create!(:name => ex[:pre_migration]) - end - - args_examples = [ - {:table => queue_stub, - :pre_migration => "[[[\"ManageIQ::Providers::Atomic::ContainerManager\", 12]]]", - :post_migration => "[[[\"ManageIQ::Providers::Openshift::ContainerManager\", 12]]]", - :record => nil}, - - {:table => queue_stub, - :pre_migration => "[[[\"ManageIQ::Providers::AtomicEnterprise::ContainerManager\", 15]]]", - :post_migration => "[[[\"ManageIQ::Providers::OpenshiftEnterprise::ContainerManager\", 15]]]", - :record => nil}, - - {:table => queue_stub, - :pre_migration => "[[[\"EmsOther\", 21]]]", - :post_migration => "[[[\"EmsOther\", 21]]]", - :record => nil}, - - {:table => queue_stub, - :pre_migration => "[]", - :post_migration => "[]", - :record => nil} - ].each do |ex| - ex[:record] = ex[:table].create!(:args => ex[:pre_migration]) - end - - migrate - - type_examples.each do |ex| - ex[:record].reload - expect(ex[:record].type).to eq(ex[:post_migration]) - end - - name_examples.each do |ex| - ex[:record].reload - expect(ex[:record].name).to eq(ex[:post_migration]) - end - - args_examples.each do |ex| - ex[:record].reload - expect(ex[:record].args).to eq(ex[:post_migration]) - end - end - end -end diff --git a/spec/migrations/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener_spec.rb b/spec/migrations/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener_spec.rb deleted file mode 100644 index bc3f13006..000000000 --- a/spec/migrations/20160830233558_migrate_ports_to_port_ranges_in_load_balancer_listener_spec.rb +++ /dev/null @@ -1,101 +0,0 @@ -require_migration - -describe MigratePortsToPortRangesInLoadBalancerListener do - let(:load_balancer_listener_stub) { migration_stub(:LoadBalancerListener) } - - migration_context :up do - it 'migrate load_balancer_port to load_balancer_port_range when load_balancer_port set' do - st = load_balancer_listener_stub.create!(:load_balancer_port => 443) - - migrate - st.reload - - expect(st.load_balancer_port_range.to_a).to eq([443]) - expect(st.load_balancer_port).to be_nil - end - - it 'does not update load_balancer_port_range when load_balancer_port is nil' do - st = load_balancer_listener_stub.create!(:load_balancer_port => nil) - - migrate - - expect(st.reload.load_balancer_port_range).to be_nil - end - - it 'migrates instance_port to instance_port_range when instance_port is set' do - st = load_balancer_listener_stub.create!(:instance_port => 45) - - migrate - st.reload - - expect(st.instance_port_range.to_a).to eq([45]) - expect(st.instance_port).to be_nil - end - - it 'does not update instance_port_range when instance_port is nil' do - st = load_balancer_listener_stub.create!(:instance_port => nil) - - migrate - - expect(st.reload.instance_port_range).to be_nil - end - end - - migration_context :down do - it 'migrates load_balancer_port_range to load_balancer_port when load_balancer_port_range is a single port' do - st = load_balancer_listener_stub.create!(:load_balancer_port_range => 443..443) - - migrate - st.reload - - expect(st.load_balancer_port).to be(443) - expect(st.load_balancer_port_range).to be_nil - end - - it 'skips migrating load_balancer_port_range when range is multiple ports' do - st = load_balancer_listener_stub.create!(:load_balancer_port_range => 500..699) - - migrate - st.reload - - expect(st.load_balancer_port).to be_nil - expect(st.load_balancer_port_range).to be_nil - end - - it 'does not update load_balancer_port when load_balancer_port_range is nil' do - st = load_balancer_listener_stub.create!(:load_balancer_port_range => nil) - - migrate - - expect(st.load_balancer_port).to be_nil - end - - it 'migrates instance_port_range to instance_port when instance_port_range is a single port' do - st = load_balancer_listener_stub.create!(:instance_port_range => 443..443) - - migrate - st.reload - - expect(st.instance_port).to be(443) - expect(st.instance_port_range).to be_nil - end - - it 'skips migrating instance_port_range when range is multiple ports' do - st = load_balancer_listener_stub.create!(:instance_port_range => 500..699) - - migrate - st.reload - - expect(st.instance_port).to be_nil - expect(st.instance_port_range).to be_nil - end - - it 'does not update instance_port when instance_port_range is nil' do - st = load_balancer_listener_stub.create!(:instance_port_range => nil) - - migrate - - expect(st.instance_port).to be_nil - end - end -end diff --git a/spec/migrations/20160911130449_add_value_serialized_to_custom_attribute_spec.rb b/spec/migrations/20160911130449_add_value_serialized_to_custom_attribute_spec.rb deleted file mode 100644 index a967fb158..000000000 --- a/spec/migrations/20160911130449_add_value_serialized_to_custom_attribute_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require_migration -describe AddValueSerializedToCustomAttribute do - let(:custom_attribute_stub) { migration_stub(:CustomAttribute) } - - migration_context :up do - it 'migrate current values to serialized values correctly' do - custom_attribute_stub.create!(:name => 'example', :value => "foo") - migrate - expect(YAML.load(custom_attribute_stub.find_by(:name => 'example').serialized_value)).to eq("foo") - end - end -end diff --git a/spec/migrations/20160913195129_move_repo_data_from_database_to_settings_spec.rb b/spec/migrations/20160913195129_move_repo_data_from_database_to_settings_spec.rb deleted file mode 100644 index 805735b7e..000000000 --- a/spec/migrations/20160913195129_move_repo_data_from_database_to_settings_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -require_migration - -describe MoveRepoDataFromDatabaseToSettings do - let(:region_stub) { migration_stub(:MiqRegion) } - let(:database_stub) { migration_stub(:MiqDatabase) } - let(:settings_stub) { migration_stub(:SettingsChange) } - - let(:region_number) { anonymous_class_with_id_regions.my_region_number } - let(:region) { region_stub.find_by_region(region_number) } - let(:repo_string) { "my-repo my-other-repo" } - let(:repo_list) { %w(my-repo my-other-repo) } - - before do - region_id = anonymous_class_with_id_regions.rails_sequence_start - region_stub.create(:id => region_id, :region => region_number) - end - - migration_context :up do - it "moves the data from miq_databases to the settings" do - database_attrs = { - :session_secret_token => SecureRandom.hex(64), - :csrf_secret_token => SecureRandom.hex(64), - :update_repo_name => repo_string - } - database_stub.create!(database_attrs) - - migrate - - setting_change = settings_stub.where( - :key => described_class::SETTING_KEY, - :resource_id => region.id, - :resource_type => "MiqRegion" - ).first - expect(setting_change.value).to eq(repo_list) - end - - it "handles nil update_repo_name" do - database_attrs = { - :session_secret_token => SecureRandom.hex(64), - :csrf_secret_token => SecureRandom.hex(64), - } - database_stub.create!(database_attrs) - - migrate - - setting_change = settings_stub.where( - :key => described_class::SETTING_KEY, - :resource_id => region.id, - :resource_type => "MiqRegion" - ) - expect(setting_change.count).to eq(0) - end - end - - migration_context :down do - it "moves the data from the settings to miq_databases" do - database_attrs = { - :session_secret_token => SecureRandom.hex(64), - :csrf_secret_token => SecureRandom.hex(64), - :update_repo_name => nil - } - db = database_stub.create!(database_attrs) - settings_stub.create!( - :key => described_class::SETTING_KEY, - :value => repo_list, - :resource_id => region.id, - :resource_type => "MiqRegion" - ) - - migrate - - db.reload - expect(db.update_repo_name).to eq(repo_string) - end - end -end diff --git a/spec/migrations/20160923000000_remove_replication_excludes_from_settings_spec.rb b/spec/migrations/20160923000000_remove_replication_excludes_from_settings_spec.rb deleted file mode 100644 index 7e974b589..000000000 --- a/spec/migrations/20160923000000_remove_replication_excludes_from_settings_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_migration - -describe RemoveReplicationExcludesFromSettings do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "removes the replication excludes key rows" do - settings_change_stub.create!( - :key => described_class::EXCLUDES_KEY, - :value => %w(schema_migrations) - ) - settings_change_stub.create!( - :key => described_class::EXCLUDES_KEY, - :value => %w(ar_internal_metadata) - ) - settings_change_stub.create!( - :key => "/some/other/key", - :value => %w(ar_internal_metadata) - ) - - migrate - - expect(settings_change_stub.where(:key => described_class::EXCLUDES_KEY)).to be_empty - expect(settings_change_stub.where(:key => "/some/other/key")).to_not be_empty - end - end -end diff --git a/spec/migrations/20161101174139_rename_ems_events_purging_settings_keys_spec.rb b/spec/migrations/20161101174139_rename_ems_events_purging_settings_keys_spec.rb deleted file mode 100644 index 69c196d8b..000000000 --- a/spec/migrations/20161101174139_rename_ems_events_purging_settings_keys_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_migration - -describe RenameEmsEventsPurgingSettingsKeys do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "changes the keys for event_streams purging" do - insert_test_records(described_class::OLD_KEYS) - - migrate - - expect(settings_change_stub.where(:key => described_class::NEW_KEYS).count).to eq(2) - expect(settings_change_stub.where(:key => described_class::OLD_KEYS).count).to eq(0) - end - end - - migration_context :down do - it "changes the keys for ems_events purging" do - insert_test_records(described_class::NEW_KEYS) - - migrate - - expect(settings_change_stub.where(:key => described_class::NEW_KEYS).count).to eq(0) - expect(settings_change_stub.where(:key => described_class::OLD_KEYS).count).to eq(2) - end - end - - def insert_test_records(keys) - keys.each do |key| - settings_change_stub.create!(:resource_type => "MiqServer", :key => key, :value => "10.days") - end - end -end diff --git a/spec/migrations/20161213140739_remove_remote_api_settings_spec.rb b/spec/migrations/20161213140739_remove_remote_api_settings_spec.rb deleted file mode 100644 index df0b1abc7..000000000 --- a/spec/migrations/20161213140739_remove_remote_api_settings_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require_migration - -describe RemoveRemoteApiSettings do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "removes the remote api authentication settings" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/webservices/remote_miq_api/user", - :value => "admin" - ) - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/webservices/remote_miq_api/password", - :value => "thepassword" - ) - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/api/token_ttl", - :value => "5.minutes" - ) - - migrate - - expect(settings_change_stub.where("key LIKE ?", described_class::API_AUTH_KEY).count).to eq 0 - expect(settings_change_stub.count).to eq 1 - - kept_change = settings_change_stub.first - expect(kept_change.resource_type).to eq("MiqServer") - expect(kept_change.key).to eq("/api/token_ttl") - expect(kept_change.value).to eq("5.minutes") - end - end -end diff --git a/spec/migrations/20170109142011_extract_field_data_from_rate_detail_spec.rb b/spec/migrations/20170109142011_extract_field_data_from_rate_detail_spec.rb deleted file mode 100644 index 9905a1f38..000000000 --- a/spec/migrations/20170109142011_extract_field_data_from_rate_detail_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -require_migration - -describe ExtractFieldDataFromRateDetail do - class ExtractFieldDataFromRateDetail::ChargebackRateDetailMeasure < ActiveRecord::Base; end - - let(:rate_stub) { migration_stub(:ChargebackRate) } - let(:detail_stub) { migration_stub(:ChargebackRateDetail) } - let(:field_stub) { migration_stub(:ChargeableField) } - let(:measure_stub) { migration_stub(:ChargebackRateDetailMeasure) } - - let(:default_rate) { rate_stub.create!(:rate_type => 'Compute', :default => :true) } - let(:custom_rate) { rate_stub.create!(:rate_type => 'Compute') } - let(:measure_mhz) { measure_stub.create!(:name => 'Hz Units') } - let(:measure_bps) { measure_stub.create!(:name => 'Bytes per Second Units') } - - let(:fields) do - [ - {:metric => 'cpu_usagemhz_rate_average', :group => 'cpu', :source => 'used', :description => 'Used CPU', - :chargeback_rate_detail_measure_id => measure_mhz.id}, - {:metric => 'derived_vm_numvcpus', :group => 'cpu', :source => 'allocated', :description => 'Allocated CPU Count', - :chargeback_rate_detail_measure_id => nil}, - {:metric => 'disk_usage_rate_average', :group => 'disk_io', :source => 'used', :description => 'Used Disk I/O', - :chargeback_rate_detail_measure_id => measure_bps.id}, - ] - end - - migration_context :up do - it 'creates one field for each detail in default rate' do - fields.each do |field| - detail_stub.create!(field.merge(:chargeback_rate_id => default_rate.id)) - detail_stub.create!(field.merge(:chargeback_rate_id => custom_rate.id)) - end - - migrate - - created_fields = field_stub.all.collect(&:attributes).collect { |f| f.except('id').symbolize_keys } - expect(created_fields).to match_array(fields) - - detail_stub.all.each do |d| - expect(d.chargeable_field.metric).to eq(d.metric) - end - end - end -end diff --git a/spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb b/spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb deleted file mode 100644 index 229a765d0..000000000 --- a/spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_migration - -class UpdateEmsInMiqAlertStatus < ActiveRecord::Migration[5.0] - class ExtManagementSystem < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - end - class Vm < ActiveRecord::Base - self.inheritance_column = :_type_disabled # disable STI - belongs_to :ext_management_system, :foreign_key => :ems_id - end -end - -describe UpdateEmsInMiqAlertStatus do - let(:miq_alert_status_stub) { migration_stub(:MiqAlertStatus) } - let(:vm_cloud_stub) { migration_stub(:Vm) } - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - - migration_context :up do - it 'it sets ems_id for vms' do - ext = ext_management_system_stub.create - vm = vm_cloud_stub.create(:ext_management_system => ext) - miq_alert_status = miq_alert_status_stub.create!(:resource_type => "VmOrTemplate", :resource_id => vm.id) - expect(miq_alert_status.ems_id).to be_nil - migrate - expect(miq_alert_status.reload.ems_id).to eq(ext.id) - end - end -end diff --git a/spec/migrations/20170120164058_create_task_for_each_job_and_transfer_attributes_spec.rb b/spec/migrations/20170120164058_create_task_for_each_job_and_transfer_attributes_spec.rb deleted file mode 100644 index 4674a81d6..000000000 --- a/spec/migrations/20170120164058_create_task_for_each_job_and_transfer_attributes_spec.rb +++ /dev/null @@ -1,69 +0,0 @@ -require_migration - -describe CreateTaskForEachJobAndTransferAttributes do - let(:miq_tasks_stub) { migration_stub(:MiqTask) } - let(:jobs_stub) { migration_stub(:Job) } - let(:log_stub) { migration_stub(:LogFile) } - let(:binary_blob_stub) { migration_stub(:BinaryBlob) } - - migration_context :up do - it "deletes finished job older than 7 days" do - jobs_stub.create!(:name => "Test Job1", :state => "finished", :updated_on => 6.days.ago.utc) - jobs_stub.create!(:name => "Test Job2", :state => "finished", :updated_on => 8.days.ago.utc) - jobs_stub.create!(:name => "Test Job3", :state => "finished", :updated_on => 1.month.ago.utc) - - migrate - - expect(jobs_stub.count).to eq 1 - end - - it "deletes finished tasks older than 7 days and linked LogFiles and BynaryBlobs" do - task1 = miq_tasks_stub.create!(:name => "Test Task1", :state => "Finished", :updated_on => 6.days.ago.utc) - log_stub.create!(:miq_task_id => task1.id) - binary_blob_stub.create!(:resource_type => "MiqTask", :resource_id => task1.id) - - task2 = miq_tasks_stub.create!(:name => "Test Task2", :state => "Finished", :updated_on => 8.days.ago.utc) - log_stub.create!(:miq_task_id => task2.id) - binary_blob_stub.create!(:resource_type => "MiqTask", :resource_id => task2.id) - - task3 = miq_tasks_stub.create!(:name => "Test Task2", :state => "Finished", :updated_on => 1.month.ago.utc) - log_stub.create!(:miq_task_id => task3.id) - binary_blob_stub.create!(:resource_type => "MiqTask", :resource_id => task3.id) - - migrate - - expect(miq_tasks_stub.count).to eq 1 - expect(log_stub.count).to eq 1 - expect(binary_blob_stub.count).to eq 1 - end - - it "creates associated task for each job and assigns to task the same name" do - jobs_stub.create!(:name => "Hello Test Job", :status => "Some test status", :miq_task_id => nil) - jobs_stub.create!(:name => "Hello Test Job2", :state => "Some state", :miq_task_id => nil) - - migrate - - expect(miq_tasks_stub.count).to eq 2 - expect(miq_tasks_stub.find_by(:name => "Hello Test Job").status).to eq "Some test status" - expect(miq_tasks_stub.find_by(:name => "Hello Test Job2").state).to eq "Some state" - end - end - - migration_context :down do - it "delete all tasks associated with jobs" do - job = jobs_stub.create!(:name => "Hello Test Job") - task_with_job = miq_tasks_stub.create!(:name => "Hello Test Job") - job.update(:miq_task_id => task_with_job.id) - miq_tasks_stub.create!(:name => "Task without Job") - miq_tasks_stub.create!(:name => "Another Task without Job") - - expect(miq_tasks_stub.count).to eq 3 - - migrate - - expect(jobs_stub.count).to eq 1 - expect(miq_tasks_stub.count).to eq 2 - expect(jobs_stub.first.miq_task_id).to be nil - end - end -end diff --git a/spec/migrations/20170125141953_update_description_in_miq_alert_status_spec.rb b/spec/migrations/20170125141953_update_description_in_miq_alert_status_spec.rb deleted file mode 100644 index f325eb8f3..000000000 --- a/spec/migrations/20170125141953_update_description_in_miq_alert_status_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require_migration - -describe UpdateDescriptionInMiqAlertStatus do - let(:miq_alert_stub) { migration_stub(:MiqAlert) } - let(:miq_alert_status_stub) { migration_stub(:MiqAlertStatus) } - - migration_context :up do - it 'it sets miq_alert_status.description using miq_alert.description' do - ma = miq_alert_stub.create(:description => 'all your base are belong to us!') - mas = miq_alert_status_stub.create - ma.miq_alert_statuses = [mas] - expect(mas.description).to be_nil - migrate - mas.reload - expect(mas.description).to eq('all your base are belong to us!') - end - end -end diff --git a/spec/migrations/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager_spec.rb b/spec/migrations/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager_spec.rb deleted file mode 100644 index 21aaf9113..000000000 --- a/spec/migrations/20170131160216_migrate_ansible_tower_configuration_manager_sti_type_to_automation_manager_spec.rb +++ /dev/null @@ -1,73 +0,0 @@ -require_migration - -describe MigrateAnsibleTowerConfigurationManagerStiTypeToAutomationManager do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:configuration_script_stub) { migration_stub(:ConfigurationScript) } - let(:configured_system_stub) { migration_stub(:ConfiguredSystem) } - let(:job_stub) { migration_stub(:Job) } - let(:inventory_group_stub) { migration_stub(:EmsFolder) } - - migration_context :up do - context 'migrate_configuration_managers' do - it 'migrates Ansible Tower ConfigurationManager and others to be of AutomationManager type' do - manager = ems_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager') - script = configuration_script_stub.create!( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript' - ) - system = configured_system_stub.create!( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfiguredSystem' - ) - job = job_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job') - inventory_g = inventory_group_stub.create!( - :type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::InventoryGroup' - ) - - migrate - - expect(manager.reload.type).to eq('ManageIQ::Providers::AnsibleTower::AutomationManager') - expect(script.reload.type).to eq('ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript') - expect(system.reload.type).to eq('ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem') - expect(job.reload.type).to eq('ManageIQ::Providers::AnsibleTower::AutomationManager::Job') - expect(inventory_g.reload.type).to eq('ManageIQ::Providers::AnsibleTower::AutomationManager::InventoryGroup') - end - - it 'will not migrate things other than those of Ansible Tower ConfigurationManager' do - mananger = ems_stub.create!(:type => 'ManageIQ::Providers::SomeManager') - script = configuration_script_stub.create!(:type => 'ManageIQ::Providers::SomeManager::ConfigurationScript') - system = configured_system_stub.create!(:type => 'ManageIQ::Providers::SomeManager::ConfiguredSystem') - job = configured_system_stub.create!(:type => 'ManageIQ::Providers::SomeManager::Job') - inventory_g = inventory_group_stub.create!(:type => 'ManageIQ::Providers::SomeManager::InventoryGroup') - - migrate - - expect(mananger.reload.type).to eq('ManageIQ::Providers::SomeManager') - expect(script.reload.type).to eq('ManageIQ::Providers::SomeManager::ConfigurationScript') - expect(system.reload.type).to eq('ManageIQ::Providers::SomeManager::ConfiguredSystem') - expect(job.reload.type).to eq('ManageIQ::Providers::SomeManager::Job') - expect(inventory_g.reload.type).to eq('ManageIQ::Providers::SomeManager::InventoryGroup') - end - end - end - - migration_context :down do - it 'migrates Ansible Tower AutomationManager to ConfigurationManager type' do - manager = ems_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager') - script = configuration_script_stub.create!( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript' - ) - system = configured_system_stub.create!( - :type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem' - ) - job = job_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Job') - inventory_g = inventory_group_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::InventoryGroup') - - migrate - - expect(manager.reload.type).to eq('ManageIQ::Providers::AnsibleTower::ConfigurationManager') - expect(script.reload.type).to eq('ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript') - expect(system.reload.type).to eq('ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfiguredSystem') - expect(job.reload.type).to eq('ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job') - expect(inventory_g.reload.type).to eq('ManageIQ::Providers::AnsibleTower::ConfigurationManager::InventoryGroup') - end - end -end diff --git a/spec/migrations/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager_spec.rb b/spec/migrations/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager_spec.rb deleted file mode 100644 index 17a37b586..000000000 --- a/spec/migrations/20170202195228_migrate_ansible_tower_configuration_manager_settings_to_automation_manager_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -require_migration - -describe MigrateAnsibleTowerConfigurationManagerSettingsToAutomationManager do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it 'changes the key of /ems_refresh/ansible_tower_configuration% to /ems_refresh/ansible_tower_automation%' do - s1 = settings_change_stub.create!( - :key => '/ems_refresh/ansible_tower_configuration/abc', - :value => "targetedThingAbc" - ) - s2 = settings_change_stub.create!( - :key => '/ems_refresh/ansible_tower_something/abc', - :value => "something" - ) - - migrate - - expect(s1.reload.key).to eq('/ems_refresh/ansible_tower_automation/abc') - expect(s2.reload.key).to eq('/ems_refresh/ansible_tower_something/abc') - end - - it 'changes the keys /workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_configuration%' \ - ' to /workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_automation%' do - s1 = settings_change_stub.create!( - :key => '/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_configuration/abc', - :value => "targetedThingAbc" - ) - s2 = settings_change_stub.create!( - :key => '/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_something/abc', - :value => "something" - ) - - migrate - - expect(s1.reload.key).to eq('/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_automation/abc') - expect(s2.reload.key).to eq('/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_something/abc') - end - end - - migration_context :down do - it 'changes the keys of /ems_refresh/ansible_tower_automation% back to be of Configuration Manager' do - s1 = settings_change_stub.create!( - :key => '/ems_refresh/ansible_tower_automation/abc', - :value => "targetedThingAbc" - ) - s2 = settings_change_stub.create!( - :key => '/ems_refresh/ansible_tower_something/abc', - :value => "something" - ) - - migrate - - expect(s1.reload.key).to eq('/ems_refresh/ansible_tower_configuration/abc') - expect(s2.reload.key).to eq('/ems_refresh/ansible_tower_something/abc') - end - - it 'changes the keys of /workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_automation%' \ - ' back to be of Configuration Manager' do - s1 = settings_change_stub.create!( - :key => '/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_automation/abc', - :value => "targetedThingAbc" - ) - s2 = settings_change_stub.create!( - :key => '/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_something/abc', - :value => "something" - ) - - migrate - - expect(s1.reload.key).to eq('/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_configuration/abc') - expect(s2.reload.key).to eq('/workers/worker_base/queue_worker_base/ems_refresh_worker/ems_refresh_worker_ansible_tower_something/abc') - end - end -end diff --git a/spec/migrations/20170207173837_set_service_display_and_retired_to_false_spec.rb b/spec/migrations/20170207173837_set_service_display_and_retired_to_false_spec.rb deleted file mode 100644 index 70d6ae43e..000000000 --- a/spec/migrations/20170207173837_set_service_display_and_retired_to_false_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require_migration - -RSpec.describe SetServiceDisplayAndRetiredToFalse do - migration_context :up do - it "sets any null display values to false" do - service = migration_stub(:Service).create!(:display => nil) - - migrate - - expect(service.reload.display).to be(false) - end - - it "sets any null retired values to false" do - service = migration_stub(:Service).create!(:retired => nil) - - migrate - - expect(service.reload.retired).to be(false) - end - end - - migration_context :down do - it "leaves false display values as false" do - service = migration_stub(:Service).create!(:display => false) - - migrate - - expect(service.reload.display).to be(false) - end - - it "leaves false retired values as false" do - service = migration_stub(:Service).create!(:retired => false) - - migrate - - expect(service.reload.retired).to be(false) - end - end -end diff --git a/spec/migrations/20170207215322_fix_vpor_time_profile_ids_spec.rb b/spec/migrations/20170207215322_fix_vpor_time_profile_ids_spec.rb deleted file mode 100644 index bdea3e98f..000000000 --- a/spec/migrations/20170207215322_fix_vpor_time_profile_ids_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require_migration - -describe FixVporTimeProfileIds do - let(:vpor_stub) { migration_stub(:VimPerformanceOperatingRange) } - let(:time_profile_stub) { migration_stub(:TimeProfile) } - - migration_context :up do - it "when the user has previously corrected TimeProfile ids" do - tp = create_default_time_profile - - to_delete = vpor_stub.create! - to_keep = vpor_stub.create!(:time_profile_id => tp.id) - - migrate - - expect { to_delete.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect(to_keep.reload).to be - end - - it "when the user does not have previously corrected TimeProfile ids" do - tp = create_default_time_profile - - to_update = vpor_stub.create! - - migrate - - expect(to_update.reload.time_profile_id).to eq(tp.id) - end - end - - def create_default_time_profile - time_profile_stub.create!( - :profile => { - :tz => time_profile_stub::DEFAULT_TZ, - :days => time_profile_stub::ALL_DAYS, - :hours => time_profile_stub::ALL_HOURS - }, - :rollup_daily_metrics => true - ) - end -end diff --git a/spec/migrations/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type_spec.rb b/spec/migrations/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type_spec.rb deleted file mode 100644 index ff106bb3a..000000000 --- a/spec/migrations/20170209192130_migrate_ansible_tower_configuration_manager_inventory_root_group_sti_type_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require_migration - -describe MigrateAnsibleTowerConfigurationManagerInventoryRootGroupStiType do - let(:inventory_root_group_stub) { migration_stub(:EmsFolder) } - - migration_context :up do - it 'migrates Ansible Tower InventoryRootGroup to ManageIQ::Providers::AnsibleTower::AutomationManager::Inventory' do - irg = inventory_root_group_stub.create!( - :type => 'ManageIQ::Providers::ConfigurationManager::InventoryRootGroup' - ) - - migrate - - expect(irg.reload.type).to eq('ManageIQ::Providers::AnsibleTower::AutomationManager::Inventory') - end - - it 'will not migrate InventoryRootGroup other than those of Ansible Tower ConfigurationManager' do - irg = inventory_root_group_stub.create!(:type => 'ManageIQ::Providers::SomeManager::InventoryRootGroup') - - migrate - - expect(irg.reload.type).to eq('ManageIQ::Providers::SomeManager::InventoryRootGroup') - end - end - - migration_context :down do - it 'migrates Ansible Tower InventoryRootGroup to ManageIQ::Providers::AnsibleTower::AutomationManager::Inventory' do - irg = inventory_root_group_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Inventory') - - migrate - - expect(irg.reload.type).to eq('ManageIQ::Providers::ConfigurationManager::InventoryRootGroup') - end - end -end diff --git a/spec/migrations/20170217163547_migrate_tower_job_sti_type_to_automation_manager_spec.rb b/spec/migrations/20170217163547_migrate_tower_job_sti_type_to_automation_manager_spec.rb deleted file mode 100644 index 0b2d1e748..000000000 --- a/spec/migrations/20170217163547_migrate_tower_job_sti_type_to_automation_manager_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_migration - -describe MigrateTowerJobStiTypeToAutomationManager do - let(:job_stub) { migration_stub(:OrchestrationStack) } - - migration_context :up do - it 'migrates Ansible Tower Jobs to be of AutomationManager type' do - job = job_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job') - - migrate - - expect(job.reload.type).to eq('ManageIQ::Providers::AnsibleTower::AutomationManager::Job') - end - - it 'will not migrate Jobs other than those of Ansible Tower ConfigurationManager' do - job = job_stub.create!(:type => 'ManageIQ::Providers::SomeManager::Job') - - migrate - - expect(job.reload.type).to eq('ManageIQ::Providers::SomeManager::Job') - end - end - - migration_context :down do - it 'migrates Ansible Tower AutomationManager Jobs to ConfigurationManager type' do - job = job_stub.create!(:type => 'ManageIQ::Providers::AnsibleTower::AutomationManager::Job') - - migrate - - expect(job.reload.type).to eq('ManageIQ::Providers::AnsibleTower::ConfigurationManager::Job') - end - end -end diff --git a/spec/migrations/20170217220618_remove_central_admin_region_auth_records_spec.rb b/spec/migrations/20170217220618_remove_central_admin_region_auth_records_spec.rb deleted file mode 100644 index a676afd84..000000000 --- a/spec/migrations/20170217220618_remove_central_admin_region_auth_records_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require_migration - -describe RemoveCentralAdminRegionAuthRecords do - let(:authentication_stub) { migration_stub(:Authentication) } - - migration_context :up do - it "removes rows that point to MiqRegion" do - authentication_stub.create!(:resource_type => "MiqRegion") - authentication_stub.create!(:resource_type => "MiqRegion") - authentication_stub.create!(:resource_type => "Provider") - - migrate - - expect(authentication_stub.count).to eq(1) - expect(authentication_stub.first.resource_type).to eq("Provider") - end - end -end diff --git a/spec/migrations/20170222105117_remove_openshift_enterprise_provider_spec.rb b/spec/migrations/20170222105117_remove_openshift_enterprise_provider_spec.rb deleted file mode 100644 index 4968a5c68..000000000 --- a/spec/migrations/20170222105117_remove_openshift_enterprise_provider_spec.rb +++ /dev/null @@ -1,89 +0,0 @@ -require_migration - -describe RemoveOpenshiftEnterpriseProvider do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:auth_stub) { migration_stub(:Authentication) } - let(:workers_stub) { migration_stub(:MiqWorker) } - let(:queue_stub) { migration_stub(:MiqQueue) } - - migration_context :up do - it "Updates Atomic Provider to Openshift and Atomic Enterprise to Openshift Enterprise" do - type_examples = [ - {:table => ems_stub, - :pre_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager", - :record => nil}, - {:table => ems_stub, - :pre_migration => "EmsOther", - :post_migration => "EmsOther", - :record => nil}, - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::EventCatcher", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager::EventCatcher", - :record => nil}, - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::MetricsCollectorWorker", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager::MetricsCollectorWorker", - :record => nil}, - {:table => workers_stub, - :pre_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager::RefreshWorker", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager::RefreshWorker", - :record => nil}, - {:table => workers_stub, - :pre_migration => "OtherWorker", - :post_migration => "OtherWorker", - :record => nil} - ].each do |ex| - ex[:record] = ex[:table].create!(:type => ex[:pre_migration]) - end - - name_examples = [ - {:table => auth_stub, - :pre_migration => "ManageIQ::Providers::OpenshiftEnterprise::ContainerManager Server1", - :post_migration => "ManageIQ::Providers::Openshift::ContainerManager Server1", - :record => nil}, - {:table => auth_stub, - :pre_migration => "EmsOther Server3", - :post_migration => "EmsOther Server3", - :record => nil} - ].each do |ex| - ex[:record] = ex[:table].create!(:name => ex[:pre_migration]) - end - - args_examples = [ - {:table => queue_stub, - :pre_migration => "[[[\"ManageIQ::Providers::OpenshiftEnterprise::ContainerManager\", 12]]]", - :post_migration => "[[[\"ManageIQ::Providers::Openshift::ContainerManager\", 12]]]", - :record => nil}, - {:table => queue_stub, - :pre_migration => "[[[\"EmsOther\", 21]]]", - :post_migration => "[[[\"EmsOther\", 21]]]", - :record => nil}, - - {:table => queue_stub, - :pre_migration => "[]", - :post_migration => "[]", - :record => nil} - ].each do |ex| - ex[:record] = ex[:table].create!(:args => ex[:pre_migration]) - end - - migrate - - type_examples.each do |ex| - ex[:record].reload - expect(ex[:record].type).to eq(ex[:post_migration]) - end - - name_examples.each do |ex| - ex[:record].reload - expect(ex[:record].name).to eq(ex[:post_migration]) - end - - args_examples.each do |ex| - ex[:record].reload - expect(ex[:record].args).to eq(ex[:post_migration]) - end - end - end -end diff --git a/spec/migrations/20170222214902_add_initiator_to_service_spec.rb b/spec/migrations/20170222214902_add_initiator_to_service_spec.rb deleted file mode 100644 index 2e4239074..000000000 --- a/spec/migrations/20170222214902_add_initiator_to_service_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require_migration - -describe AddInitiatorToService do - let(:service_stub) { migration_stub(:Service) } - let(:default_initiator) { "user" } - - migration_context :up do - it "adds initiator and sets it to user" do - service_stub.create!(:name => 'service1') - service_stub.create!(:name => 'service2') - - migrate - - expect(service_stub.count).to eq(2) - expect(service_stub.find_by(:name => 'service1').initiator).to eq(default_initiator) - expect(service_stub.find_by(:name => 'service2').initiator).to eq(default_initiator) - end - end -end diff --git a/spec/migrations/20170307203433_migrate_configuration_script_to_base_spec.rb b/spec/migrations/20170307203433_migrate_configuration_script_to_base_spec.rb deleted file mode 100644 index a4cd625dd..000000000 --- a/spec/migrations/20170307203433_migrate_configuration_script_to_base_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require_migration - -describe MigrateConfigurationScriptToBase do - let(:service_resource_stub) { migration_stub(:ServiceResource) } - - migration_context :up do - it 'migrates service_resources configuration_script to configuration_script_base' do - resource = service_resource_stub.create!( - :resource_type => 'ConfigurationScript' - ) - - migrate - - expect(resource.reload.resource_type).to eq('ConfigurationScriptBase') - end - - it 'will not migrate service_resources records other than that of configuration_scripts' do - resource = service_resource_stub.create!(:resource_type => 'SomeThing') - - migrate - - expect(resource.reload.resource_type).to eq('SomeThing') - end - end - - migration_context :down do - it 'migrates service_resources configuration_script_base to configuration_script' do - resource = service_resource_stub.create!( - :resource_type => 'ConfigurationScriptBase' - ) - - migrate - - expect(resource.reload.resource_type).to eq('ConfigurationScript') - end - end -end diff --git a/spec/migrations/20170315082311_update_o_virt_api_path_spec.rb b/spec/migrations/20170315082311_update_o_virt_api_path_spec.rb deleted file mode 100644 index 1515791dc..000000000 --- a/spec/migrations/20170315082311_update_o_virt_api_path_spec.rb +++ /dev/null @@ -1,106 +0,0 @@ -require_migration - -describe UpdateOVirtApiPath do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:endpoint_stub) { migration_stub(:Endpoint) } - - migration_context :up do - it 'updates the path for the default endpoint of oVirt providers' do - ems_stub.create!( - :type => 'ManageIQ::Providers::Redhat::InfraManager', - :id => 1 - ) - endpoint_stub.create!( - :id => 1, - :resource_type => 'ExtManagementSystem', - :resource_id => 1, - :role => 'default', - :path => '/api' - ) - - migrate - - expect(endpoint_stub.where(:id => 1).first.path).to eq('/ovirt-engine/api') - end - - it 'does not update the path if it has been already customized' do - ems_stub.create!( - :type => 'ManageIQ::Providers::Redhat::InfraManager', - :id => 1 - ) - endpoint_stub.create!( - :id => 1, - :resource_type => 'ExtManagementSystem', - :resource_id => 1, - :role => 'default', - :path => '/myapi' - ) - - migrate - - expect(endpoint_stub.where(:id => 1).first.path).to eq('/myapi') - end - - it 'does not update the path for the metrics endpoint of oVirt providers' do - ems_stub.create!( - :type => 'ManageIQ::Providers::Redhat::InfraManager', - :id => 1 - ) - endpoint_stub.create!( - :id => 1, - :resource_type => 'ExtManagementSystem', - :resource_id => 1, - :role => 'metrics', - :path => '/api' - ) - - migrate - - expect(endpoint_stub.where(:id => 1).first.path).to eq('/api') - end - - it 'does not update the path for other type of provider' do - ems_stub.create!( - :type => 'ManageIQ::Providers::Amazon::InfraManager', - :id => 1 - ) - endpoint_stub.create!( - :id => 1, - :resource_type => 'ExtManagementSystem', - :resource_id => 1, - :role => 'default', - :path => '/api' - ) - - migrate - - expect(endpoint_stub.where(:id => 1).first.path).to eq('/api') - end - - it 'does not update the path for other type of resource, even if they have the same resource id' do - ems_stub.create!( - :type => 'ManageIQ::Providers::Redhat::InfraManager', - :id => 1 - ) - endpoint_stub.create!( - :id => 1, - :resource_type => 'ExtManagementSystem', - :resource_id => 1, - :role => 'default', - :path => '/api' - ) - endpoint_stub.create!( - :id => 2, - :resource_type => 'DoNotTouch', - :resource_id => 1, - :role => 'default', - :path => '/api' - ) - - migrate - - expect(endpoint_stub.where(:id => 1).first.path).to eq('/ovirt-engine/api') - expect(endpoint_stub.where(:id => 2).first.path).to eq('/api') - end - end -end diff --git a/spec/migrations/20170315095936_update_persistent_volumes_parent_type_spec.rb b/spec/migrations/20170315095936_update_persistent_volumes_parent_type_spec.rb deleted file mode 100644 index 265bf6822..000000000 --- a/spec/migrations/20170315095936_update_persistent_volumes_parent_type_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_migration - -RSpec.describe UpdatePersistentVolumesParentType do - migration_context :up do - it "updates container volumes with 'ManageIQ::Providers::ContainerManager' parent_type to 'ExtManagementSystem'" do - pv = migration_stub(:ContainerVolume).create!(:parent_type => 'ManageIQ::Providers::ContainerManager') - cv = migration_stub(:ContainerVolume).create!(:parent_type => 'ContainerGroup') - - migrate - - expect(pv.reload.parent_type).to eq('ExtManagementSystem') - expect(cv.reload.parent_type).to eq('ContainerGroup') - end - end - - migration_context :down do - it "updates container volumes with 'ExtManagementSystem' parent_type to 'ManageIQ::Providers::ContainerManager'" do - pv = migration_stub(:ContainerVolume).create!(:parent_type => 'ExtManagementSystem') - cv = migration_stub(:ContainerVolume).create!(:parent_type => 'ContainerGroup') - - migrate - - expect(pv.reload.parent_type).to eq('ManageIQ::Providers::ContainerManager') - expect(cv.reload.parent_type).to eq('ContainerGroup') - end - end -end diff --git a/spec/migrations/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table_spec.rb b/spec/migrations/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table_spec.rb deleted file mode 100644 index e704423c0..000000000 --- a/spec/migrations/20170317153953_copy_agent_id_to_miq_server_id_in_jobs_table_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require_migration - -describe CopyAgentIdToMiqServerIdInJobsTable do - let(:job_stub) { migration_stub(:Job) } - let(:job_name) { "Hello Test Job" } - - migration_context :up do - it "copies data from 'agent_id' to 'miq_server_id' column on jobs table" do - job = job_stub.create!(:name => job_name, :agent_id => 111) - - migrate - - expect(job.reload.miq_server_id).to eq 111 - end - end - - migration_context :down do - it "nullifies 'miq_server_id' column on jobs table" do - job = job_stub.create!(:name => job_name, :miq_server_id => 111) - - migrate - - expect(job.reload.miq_server_id).to be_nil - end - end -end diff --git a/spec/migrations/20170320195659_remove_oid_integer_args_from_miq_queue_spec.rb b/spec/migrations/20170320195659_remove_oid_integer_args_from_miq_queue_spec.rb deleted file mode 100644 index 825d22f34..000000000 --- a/spec/migrations/20170320195659_remove_oid_integer_args_from_miq_queue_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_migration - -describe RemoveOidIntegerArgsFromMiqQueue do - let(:queue_stub) { migration_stub(:MiqQueue) } - - migration_context :up do - it 'deletes rows with PostgreSQL::OID:Integer class serialized in args' do - args = <<-EOS ---- -- !ruby/object:ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer - precision: - scale: - limit: 8 - range: !ruby/range - begin: -9223372036854775808 - end: 9223372036854775808 - excl: true -EOS - queue_stub.create(:state => "ready", :args => args) - queue_stub.create(:state => "ready", :method_name => "stuff") - migrate - - expect(queue_stub.count).to eq(1) - expect(queue_stub.where(:method_name => "stuff").count).to eq(1) - end - end -end diff --git a/spec/migrations/20170328110106_fix_expression_in_tenant_quota_report_spec.rb b/spec/migrations/20170328110106_fix_expression_in_tenant_quota_report_spec.rb deleted file mode 100644 index 59121e709..000000000 --- a/spec/migrations/20170328110106_fix_expression_in_tenant_quota_report_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require_migration - -describe FixExpressionInTenantQuotaReport do - let(:miq_report_stub) { migration_stub(:MiqReport) } - let(:old_condition) do - <<-EOS - --- - - !ruby/object:MiqExpression - exp: - ">": - count: tenants.tenant_quotas - value: 0 - EOS - end - - let(:new_condition) do - <<-EOS - --- - - !ruby/object:MiqExpression - exp: - ">": - count: Tenant.tenant_quotas - value: 0 - EOS - end - - migration_context :up do - it 'converts old format of field to current format' do - miq_report = miq_report_stub.create!(:db => 'Tenant', :rpt_type => 'Custom', :conditions => old_condition) - - migrate - - expect(miq_report.reload.conditions).to eq(new_condition) - end - end - - migration_context :down do - it 'converts current format of field to old format' do - miq_report = miq_report_stub.create!(:db => 'Tenant', :rpt_type => 'Custom', :conditions => new_condition) - - migrate - - expect(miq_report.reload.conditions).to eq(old_condition) - end - end -end diff --git a/spec/migrations/20170405192333_delete_miq_replication_worker_spec.rb b/spec/migrations/20170405192333_delete_miq_replication_worker_spec.rb deleted file mode 100644 index 6ac5ee10e..000000000 --- a/spec/migrations/20170405192333_delete_miq_replication_worker_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require_migration - -describe DeleteMiqReplicationWorker do - migration_context :up do - let(:miq_worker) { migration_stub(:MiqWorker) } - - it "deletes replication worker instances" do - miq_worker.create(:type => "MiqWorker") - miq_worker.create(:type => "MiqReplicationWorker") - - expect(miq_worker.count).to eq(2) - - migrate - - expect(miq_worker.count).to eq(1) - expect(miq_worker.first.type).to eq("MiqWorker") - end - end -end diff --git a/spec/migrations/20170409083720_add_enabled_field_to_ems_spec.rb b/spec/migrations/20170409083720_add_enabled_field_to_ems_spec.rb deleted file mode 100644 index ac8732417..000000000 --- a/spec/migrations/20170409083720_add_enabled_field_to_ems_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_migration - -describe AddEnabledFieldToEms do - migration_context :up do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - - it 'sets ExtManagementSystem.enabled to true by default' do - ems = ext_management_system_stub.create! - - migrate - - ems.reload - expect(ems.enabled).to be true - end - end -end diff --git a/spec/migrations/20170410130134_copy_server_id_from_jobs_to_miq_tasks_spec.rb b/spec/migrations/20170410130134_copy_server_id_from_jobs_to_miq_tasks_spec.rb deleted file mode 100644 index b344e0218..000000000 --- a/spec/migrations/20170410130134_copy_server_id_from_jobs_to_miq_tasks_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_migration - -describe CopyServerIdFromJobsToMiqTasks do - let(:task_name) { "Hello Test Task" } - let(:task_stub) { migration_stub(:MiqTask) } - let(:job_stub) { migration_stub(:Job) } - let(:server_id) { anonymous_class_with_id_regions.rails_sequence_start } - - migration_context :up do - it "copies data from 'jobs.miq_server_id' to 'miq_tasks.miq_server_id'" do - task = task_stub.create!(:name => task_name) - job_stub.create!(:miq_server_id => server_id, :miq_task_id => task.id) - - migrate - - expect(task.reload.miq_server_id).to eq server_id - end - end - - migration_context :down do - it "nullifying miq_server_id column on miq_tasks table" do - task = task_stub.create!(:name => task_name, :miq_server_id => server_id) - - migrate - - expect(task.reload.miq_server_id).to be nil - end - end -end diff --git a/spec/migrations/20170420124055_update_policy_seed_spec.rb b/spec/migrations/20170420124055_update_policy_seed_spec.rb deleted file mode 100644 index 1e42210e6..000000000 --- a/spec/migrations/20170420124055_update_policy_seed_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require_migration - -describe UpdatePolicySeed do - migration_context :up do - let(:miq_policy) { migration_stub(:MiqPolicy) } - - it "updates null fields only" do - first = miq_policy.create!(:mode => 'compliance') - second = miq_policy.create!(:towhat => 'Host', :active => false) - migrate - - first.reload - second.reload - - expect(first).to have_attributes(:mode => 'compliance', :towhat => 'Vm', :active => true) - expect(second).to have_attributes(:mode => 'control', :towhat => 'Host', :active => false) - end - end -end diff --git a/spec/migrations/20170421193150_add_embedded_methods_to_miq_ae_method_spec.rb b/spec/migrations/20170421193150_add_embedded_methods_to_miq_ae_method_spec.rb deleted file mode 100644 index ae2eea78c..000000000 --- a/spec/migrations/20170421193150_add_embedded_methods_to_miq_ae_method_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require_migration - -describe AddEmbeddedMethodsToMiqAeMethod do - let(:miq_ae_method_stub) { migration_stub(:MiqAeMethod) } - - migration_context :up do - it "adds embedded_methods and sets it to []" do - miq_ae_method_stub.create!(:name => 'method1', :class_id => 10) - miq_ae_method_stub.create!(:name => 'method2', :class_id => 10) - - migrate - - expect(miq_ae_method_stub.count).to eq(2) - expect(miq_ae_method_stub.first.embedded_methods).to eq([]) - end - end -end diff --git a/spec/migrations/20170425154145_add_sti_to_middlewares_spec.rb b/spec/migrations/20170425154145_add_sti_to_middlewares_spec.rb deleted file mode 100644 index c13dabb2a..000000000 --- a/spec/migrations/20170425154145_add_sti_to_middlewares_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require_migration - -describe AddStiToMiddlewares do - constants = %w( - MiddlewareDatasource - MiddlewareDeployment - MiddlewareDomain - MiddlewareMessaging - MiddlewareServer - MiddlewareServerGroup - ) - - migration_context :up do - constants.each do |klass| - it "migrates all #{klass}" do - result = migration_stub(klass.to_sym).create! - - migrate - - result.reload - expect(result).to have_attributes(:type => "ManageIQ::Providers::Hawkular::MiddlewareManager::#{klass}") - end - end - end -end diff --git a/spec/migrations/20170427152006_remove_invalid_hawkular_endpoints_spec.rb b/spec/migrations/20170427152006_remove_invalid_hawkular_endpoints_spec.rb deleted file mode 100644 index d8ab547d4..000000000 --- a/spec/migrations/20170427152006_remove_invalid_hawkular_endpoints_spec.rb +++ /dev/null @@ -1,83 +0,0 @@ -require_migration - -describe RemoveInvalidHawkularEndpoints do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:endpoint_stub) { migration_stub(:Endpoint) } - let(:authentication_stub) { migration_stub(:Authentication) } - - migration_context :up do - it 'Remove hawkular endpoints that are nil' do - ems = ext_management_system_stub.create!( - :name => 'container', - :type => 'ManageIQ::Providers::Openshift::ContainerManager' - ) - endpoint_stub.create!( - :role => "default", - :hostname => "hostname", - :port => 123, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - endpoint_stub.create!( - :role => "hawkular", - :hostname => nil, - :port => 123, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - authentication_stub.create!( - :name => "#{ems.type} #{ems.name}", - :authtype => "bearer", - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :type => "AuthToken" - ) - authentication_stub.create!( - :name => "#{ems.type} #{ems.name}", - :authtype => "hawkular", - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :type => "AuthToken" - ) - migrate - expect(endpoint_stub.pluck(:role)).to contain_exactly("default") - expect(authentication_stub.pluck(:authtype)).to contain_exactly("bearer") - end - - it 'Does not remove hawkular endpoints that are not nil' do - ems = ext_management_system_stub.create! - endpoint_stub.create!( - :role => "default", - :hostname => "hostname", - :port => 123, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - endpoint_stub.create!( - :role => "hawkular", - :hostname => "somevalue", - :port => 123, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - authentication_stub.create!( - :name => "#{ems.type} #{ems.name}", - :authtype => "bearer", - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :type => "AuthToken" - ) - authentication_stub.create!( - :name => "#{ems.type} #{ems.name}", - :authtype => "hawkular", - :resource_type => "ExtManagementSystem", - :resource_id => ems.id, - :type => "AuthToken" - ) - migrate - ems.reload - expect(endpoint_stub.count).to eq(2) - expect(authentication_stub.count).to eq(2) - end - end -end diff --git a/spec/migrations/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task_spec.rb b/spec/migrations/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task_spec.rb deleted file mode 100644 index 410179d9a..000000000 --- a/spec/migrations/20170510125854_rename_waiting_to_start_state_to_queuedin_miq_task_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -require_migration - -describe RenameWaitingToStartStateToQueuedinMiqTask do - let(:task_stub) { migration_stub(:MiqTask) } - let(:task_name) { "Hello Test Task" } - let(:state_queued) { "Queued" } - let(:state_waiting_to_start) { "Waiting_to_start" } - - migration_context :up do - it "updates 'state' attribute on 'miq_tasks' table from 'Waiting_to_start' to 'Queued'" do - task_stub.create!(:name => task_name, :state => state_waiting_to_start) - - migrate - - expect(task_stub.find_by(:name => task_name).state).to eq state_queued - end - end - - migration_context :down do - let(:job_stub) { migration_stub(:Job) } - - it "updates 'state' attribute on 'miq_tasks' table from 'Waiting_to_start' to 'Queued'" do - task = task_stub.create!(:name => task_name, :state => state_queued) - job_stub.create!(:miq_task_id => task.id) - task_stub.create!(:name => "Second task not linked to job", :state => state_queued) - expect(task_stub.where(:state => state_queued).count).to eq 2 - - migrate - - expect(task_stub.where(:state => state_queued).count).to eq 1 - expect(task_stub.where(:state => state_waiting_to_start).count).to eq 1 - end - end -end diff --git a/spec/migrations/20170511120047_remove_container_group_failed_sync_event_spec.rb b/spec/migrations/20170511120047_remove_container_group_failed_sync_event_spec.rb deleted file mode 100644 index cc0bcd699..000000000 --- a/spec/migrations/20170511120047_remove_container_group_failed_sync_event_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require_migration - -describe RemoveContainerGroupFailedSyncEvent do - let(:miq_event_def_stub) { migration_stub(:MiqEventDefinition) } - let(:relationship_stub) { migration_stub(:Relationship) } - - migration_context :up do - it "removes containergroup_failedsync from table miq_event_definitions and its relationships" do - deleted = miq_event_def_stub.create!(:name => "containergroup_failedsync") - ignored = miq_event_def_stub.create!(:name => "containergroup_outofdisk") - - deleted_rel = relationship_stub.create!(:resource_type => 'MiqEventDefinition', :resource_id => deleted.id) - ignored_rel = relationship_stub.create!(:resource_type => 'AnyOtherType', :resource_id => deleted.id) - - migrate - - expect { deleted.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { ignored.reload }.to_not raise_error - - expect { deleted_rel.reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { ignored_rel.reload }.to_not raise_error - end - end -end diff --git a/spec/migrations/20170512233333_drop_miq_server_rhn_mirror_spec.rb b/spec/migrations/20170512233333_drop_miq_server_rhn_mirror_spec.rb deleted file mode 100644 index 8b499c060..000000000 --- a/spec/migrations/20170512233333_drop_miq_server_rhn_mirror_spec.rb +++ /dev/null @@ -1,72 +0,0 @@ -require_migration -require 'linux_admin' - -describe DropMiqServerRhnMirror do - let(:server_role_stub) { migration_stub(:ServerRole) } - let(:assigned_role_stub) { migration_stub(:AssignedServerRole) } - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - let(:role_name) { "rhn_mirror" } - - migration_context :up do - it "removes the server role" do - role = server_role_stub.create!(:name => role_name) - assigned_role_stub.create!(:server_role_id => role.id) - - migrate - - expect(server_role_stub.where(:name => role_name)).to be_empty - expect(assigned_role_stub.where(:server_role_id => role.id)).to be_empty - end - - it "removes the role from currently configured servers" do - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/server/role", - :value => "database_operations,event,reporting,scheduler,#{role_name}" - ) - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/server/role", - :value => "ems_operations,ems_inventory,#{role_name},user_interface" - ) - - migrate - - settings_change_stub.where(:key => "/server/role").each do |change| - expect(change.value).to_not include(role_name) - end - end - - it "cleans up external files on an appliance" do - expect(Rails.env).to receive(:production?).and_return(true) - expect(File).to receive(:exist?).with('/var/www/miq/vmdb').and_return(true) - - mock_fstab_lines = ["/dev/sda / xfs defaults 0 0", "/dev/sdb /repo xfs defaults 0 0"] - expect(File).to receive(:exist?).with("/etc/fstab").and_return(true) - expect(File).to receive(:read).with("/etc/fstab").and_return(mock_fstab_lines.join("\n")) - expect(File).to receive(:write).with("/etc/fstab", "/dev/sda / xfs defaults 0 0\n") - - expect(FileUtils).to receive(:rm_f).with("/etc/httpd/conf.d/manageiq-https-mirror.conf") - expect(FileUtils).to receive(:rm_f).with("/etc/yum.repos.d/manageiq-mirror.repo") - expect(FileUtils).to receive(:rm_rf).with([]) - - migrate - end - - it "doesn't fail if /etc/fstab doesn't exist" do - expect(Rails.env).to receive(:production?).and_return(true) - expect(File).to receive(:exist?).with('/var/www/miq/vmdb').and_return(true) - - expect(File).to receive(:exist?).with("/etc/fstab").and_return(false) - expect(LinuxAdmin::FSTab.instance).not_to receive(:write!) - - expect(FileUtils).to receive(:rm_f).with("/etc/httpd/conf.d/manageiq-https-mirror.conf") - expect(FileUtils).to receive(:rm_f).with("/etc/yum.repos.d/manageiq-mirror.repo") - expect(FileUtils).to receive(:rm_rf).with([]) - - migrate - end - end -end diff --git a/spec/migrations/20170519173044_remove_cim_ontap_records_spec.rb b/spec/migrations/20170519173044_remove_cim_ontap_records_spec.rb deleted file mode 100644 index d01c4245b..000000000 --- a/spec/migrations/20170519173044_remove_cim_ontap_records_spec.rb +++ /dev/null @@ -1,93 +0,0 @@ -require_migration - -describe RemoveCimOntapRecords do - let(:server_role_stub) { migration_stub(:ServerRole) } - let(:assigned_role_stub) { migration_stub(:AssignedServerRole) } - let(:settings_change_stub) { migration_stub(:SettingsChange) } - let(:miq_worker_stub) { migration_stub(:MiqWorker) } - let(:miq_product_feature_stub) { migration_stub(:MiqProductFeature) } - let(:miq_roles_feature_stub) { migration_stub(:MiqRolesFeature) } - - migration_context :up do - it "removes the server roles" do - all_roles = described_class::ROLES + ["other"] - - all_roles.each do |role_name| - role = server_role_stub.create!(:name => role_name) - assigned_role_stub.create!(:server_role_id => role.id) - end - - migrate - - expect(server_role_stub.count).to eq 1 - expect(server_role_stub.first.name).to eq "other" - - expect(assigned_role_stub.count).to eq 1 - expect(assigned_role_stub.first.server_role_id).to eq server_role_stub.first.id - end - - it "removes the roles from currently configured servers" do - all_roles = %w(a b c d e).zip(described_class::ROLES).flatten.join(",") - - settings_change_stub.create!( - :resource_type => "MiqServer", - :key => "/server/role", - :value => all_roles - ) - - migrate - - expect(settings_change_stub.first.value).to eq "a,b,c,d,e" - end - - it "removes workers" do - all_workers = (described_class::WORKERS + ["OtherWorker"]) - - all_workers.each { |w| miq_worker_stub.create!(:type => w) } - - migrate - - expect(miq_worker_stub.count).to eq 1 - expect(miq_worker_stub.first.type).to eq "OtherWorker" - end - - it "removes settings" do - { - "/storage/alignment/boundary" => "4.kilobytes", # Should not be removed - "/storage/inventory/full_refresh_schedule" => "38 * * * *", - "/storage/metrics_collection/collection_schedule" => "0,15,30,45 * * * *", - "/storage/metrics_collection/hourly_rollup_schedule" => "8 * * * *", - "/storage/metrics_history/purge_schedule" => "50 * * * *", - "/storage/metrics_history/keep_daily_metrics" => "6.months", - "/workers/worker_base/smis_refresh_worker/memory_threshold" => "2.gigabytes", - "/workers/worker_base/queue_worker_base/netapp_refresh_worker/memory_threshold" => "2.gigabytes", - "/workers/worker_base/queue_worker_base/storage_metrics_collector_worker/memory_threshold" => "2.gigabytes", - "/workers/worker_base/queue_worker_base/vmdb_storage_bridge_worker/memory_threshold" => "2.gigabytes", - }.each { |k, v| settings_change_stub.create!(:key => k, :value => v) } - - migrate - - expect(settings_change_stub.count).to eq 1 - expect(settings_change_stub.first.key).to eq "/storage/alignment/boundary" - expect(settings_change_stub.first.value).to eq "4.kilobytes" - end - - it "remove product features" do - all_features = (described_class::PRODUCT_FEATURES[0, 5] + ["other"]) - - ids = all_features.collect do |f| - pf = miq_product_feature_stub.create!(:identifier => f) - miq_roles_feature_stub.create!(:miq_product_feature_id => pf.id) - pf.id - end - other_id = ids.last - - migrate - - expect(miq_product_feature_stub.count).to eq 1 - expect(miq_product_feature_stub.first.identifier).to eq "other" - expect(miq_roles_feature_stub.count).to eq 1 - expect(miq_roles_feature_stub.first.miq_product_feature_id).to eq other_id - end - end -end diff --git a/spec/migrations/20170619161514_add_options_to_ext_management_system_spec.rb b/spec/migrations/20170619161514_add_options_to_ext_management_system_spec.rb deleted file mode 100644 index 5675b2f41..000000000 --- a/spec/migrations/20170619161514_add_options_to_ext_management_system_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require_migration - -describe AddOptionsToExtManagementSystem do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:ca_stub) { migration_stub(:CustomAttribute) } - let(:proxy_name) { "my_proxy" } - - migration_context :up do - it "migrates proxy options form CustomAttribute" do - kcp = ems_stub.create!(:type => "ManageIQ::Providers::Openshift::ContainerManager") - kcp.custom_attributes.create!(:name => "http_proxy", - :section => "cluster_settings", - :value => proxy_name) - - migrate - - expect(kcp.reload).to have_attributes( - :options => {:image_inspector_options => {:http_proxy => proxy_name}} - ) - expect(ca_stub.where(:section => "cluster_settings").count).to eq(0) - end - end - - migration_context :down do - it "it migrates proxy options to custom_attributes" do - options = {:image_inspector_options => {:http_proxy => proxy_name}} - kcp = ems_stub.create!(:type => "ManageIQ::Providers::Openshift::ContainerManager", - :options => options) - - migrate - - expect(kcp.reload.custom_attributes.find_by(:section => "cluster_settings", - :name => "http_proxy").value).to eq(proxy_name) - expect(ca_stub.where(:section => "cluster_settings").count).to eq(1) - end - end -end diff --git a/spec/migrations/20170619170148_remove_mirrored_logger_settings_spec.rb b/spec/migrations/20170619170148_remove_mirrored_logger_settings_spec.rb deleted file mode 100644 index 1e847ef85..000000000 --- a/spec/migrations/20170619170148_remove_mirrored_logger_settings_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require_migration - -describe RemoveMirroredLoggerSettings do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "removes the MirroredLogger settings but leaves others" do - removed = settings_change_stub.create!(:key => "/log/level_kube_in_evm", :value => "info") - settings_change_stub.create!(:key => "/log/level", :value => "debug") - settings_change_stub.create!(:key => "/log/level_kube", :value => "debug") - - migrate - - expect(settings_change_stub.count).to eq 2 - expect { removed.reload }.to raise_error(ActiveRecord::RecordNotFound) - end - end -end diff --git a/spec/migrations/20170627135623_update_container_image_types_spec.rb b/spec/migrations/20170627135623_update_container_image_types_spec.rb deleted file mode 100644 index ab41e2bb4..000000000 --- a/spec/migrations/20170627135623_update_container_image_types_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require_migration - -describe UpdateContainerImageTypes do - let(:container_image_stub) { migration_stub(:ContainerImage) } - - migration_context :up do - it "setting type correctly" do - container_image = container_image_stub.create! - openshift_container_image = container_image_stub.create!(:size => 12_345) - - migrate - - expect(container_image.reload).to have_attributes(:type => "ContainerImage") - expect(openshift_container_image.reload).to have_attributes(:type => "ManageIQ::Providers::Openshift::ContainerManager::ContainerImage") - end - end -end diff --git a/spec/migrations/20170703094235_add_hash_expression_to_miq_alert_spec.rb b/spec/migrations/20170703094235_add_hash_expression_to_miq_alert_spec.rb deleted file mode 100644 index 35542447c..000000000 --- a/spec/migrations/20170703094235_add_hash_expression_to_miq_alert_spec.rb +++ /dev/null @@ -1,69 +0,0 @@ -require_migration - -describe AddHashExpressionToMiqAlert do - migration_context :up do - let(:miq_alert_stub) { migration_stub(:MiqAlert) } - - it 'alert with hash expression has nil miq_expression and hash_expression is set' do - hash_expression = '---\n:mode: internal\n' - alert = miq_alert_stub.create!(:description => 'Test Alert', :expression => hash_expression) - - migrate - - alert.reload - expect(alert.hash_expression).to eq(hash_expression) - expect(alert.miq_expression).to be_nil - expect { alert.expression }.to raise_error(NoMethodError) - end - - it 'alert with non hash expression has nil hash_expression and miq_expression is set' do - expression = '--- !ruby/object:MiqExpression - exp: - "=": - field: Vm-platform - value: windows - ' - alert = miq_alert_stub.create!(:description => 'Test Alert', :expression => expression) - - migrate - - alert.reload - expect(alert.hash_expression).to be_nil - expect(alert.miq_expression).to eq(expression) - expect { alert.expression }.to raise_error(NoMethodError) - end - end - - migration_context :down do - let(:miq_alert_stub) { migration_stub(:MiqAlert) } - - it 'expression is set for alert with hash expression' do - hash_expression = '---\n:mode: internal\n' - alert = miq_alert_stub.create!(:description => 'Test Alert', :hash_expression => hash_expression) - - migrate - - alert.reload - expect(alert.expression).to eq(hash_expression) - expect { alert.hash_expression }.to raise_error(NoMethodError) - expect { alert.miq_expression }.to raise_error(NoMethodError) - end - - it 'expression is set for alert with non hash expression' do - expression = '--- !ruby/object:MiqExpression - exp: - "=": - field: Vm-platform - value: windows - ' - alert = miq_alert_stub.create!(:description => 'Test Alert', :miq_expression => expression) - - migrate - - alert.reload - expect(alert.expression).to eq(expression) - expect { alert.hash_expression }.to raise_error(NoMethodError) - expect { alert.miq_expression }.to raise_error(NoMethodError) - end - end -end diff --git a/spec/migrations/20170704102536_use_deleted_on_in_containers_tables_spec.rb b/spec/migrations/20170704102536_use_deleted_on_in_containers_tables_spec.rb deleted file mode 100644 index c23a9f1de..000000000 --- a/spec/migrations/20170704102536_use_deleted_on_in_containers_tables_spec.rb +++ /dev/null @@ -1,124 +0,0 @@ -require_migration - -describe UseDeletedOnInContainersTables do - let(:container_definitions_stub) { migration_stub(:ContainerDefinition) } - let(:container_groups_stub) { migration_stub(:ContainerGroup) } - let(:container_images_stub) { migration_stub(:ContainerImage) } - let(:container_projects_stub) { migration_stub(:ContainerProject) } - let(:container_nodes_stub) { migration_stub(:ContainerNode) } - let(:containers_stub) { migration_stub(:Container) } - - def create_before_migration_stub_data_for(model) - model.create!(:ems_id => 10, :old_ems_id => nil) - model.create!(:ems_id => 11, :old_ems_id => 11) - model.create!(:ems_id => nil, :old_ems_id => 12, :deleted_on => Time.now.utc) - model.create!(:ems_id => 15, :old_ems_id => 15, :deleted_on => Time.now.utc) - model.create!(:ems_id => nil, :old_ems_id => 20, :deleted_on => Time.now.utc) - model.create!(:ems_id => nil, :old_ems_id => nil, :deleted_on => Time.now.utc) - model.create!(:ems_id => nil, :old_ems_id => 25, :deleted_on => nil) - end - - def create_after_migration_stub_data_for(model) - model.create!(:ems_id => 10, :old_ems_id => nil) - model.create!(:ems_id => 11, :old_ems_id => 11) - model.create!(:ems_id => 15, :old_ems_id => 15, :deleted_on => nil) - model.create!(:ems_id => 12, :old_ems_id => 12, :deleted_on => Time.now.utc) - model.create!(:ems_id => 20, :old_ems_id => 20, :deleted_on => Time.now.utc) - model.create!(:ems_id => nil, :old_ems_id => nil, :deleted_on => Time.now.utc) - model.create!(:ems_id => 25, :old_ems_id => 25, :deleted_on => Time.now.utc) - end - - def assert_before_migration_data_of(model, context) - if context == :up - expect(model.where.not(:deleted_on => nil).count).to eq 4 - expect(model.where(:deleted_on => nil).count).to eq 3 - expect(model.where.not(:deleted_on => nil).collect(&:ems_id)).to( - match_array([15, nil, nil, nil]) - ) - expect(model.where(:deleted_on => nil).collect(&:ems_id)).to( - match_array([10, 11, nil]) - ) - else - expect(model.where.not(:deleted_on => nil).count).to eq 4 - expect(model.where(:deleted_on => nil).count).to eq 3 - expect(model.where.not(:deleted_on => nil).collect(&:ems_id)).to( - match_array([nil, nil, nil, nil]) - ) - expect(model.where(:deleted_on => nil).collect(&:ems_id)).to( - match_array([10, 11, 15]) - ) - end - expect(model.where(:ems_id => nil).count).to eq 4 - expect(model.where(:ems_id => 10).count).to eq 1 - expect(model.where(:ems_id => 11).count).to eq 1 - expect(model.where(:ems_id => 12).count).to eq 0 - expect(model.where(:ems_id => 15).count).to eq 1 - expect(model.where(:ems_id => 20).count).to eq 0 - expect(model.where(:ems_id => 25).count).to eq 0 - expect(model.where.not(:ems_id => nil).count).to eq 3 - end - - def assert_after_migration_data_of(model) - expect(model.where.not(:deleted_on => nil).count).to eq 4 - expect(model.where.not(:deleted_on => nil).collect(&:ems_id)).to( - match_array([12, 20, nil, 25]) - ) - expect(model.where(:deleted_on => nil).count).to eq 3 - expect(model.where(:deleted_on => nil).collect(&:ems_id)).to( - match_array([10, 11, 15]) - ) - expect(model.where(:ems_id => nil).count).to eq 1 - expect(model.where(:ems_id => 10).count).to eq 1 - expect(model.where(:ems_id => 11).count).to eq 1 - expect(model.where(:ems_id => 12).count).to eq 1 - expect(model.where(:ems_id => 15).count).to eq 1 - expect(model.where(:ems_id => 20).count).to eq 1 - expect(model.where(:ems_id => 25).count).to eq 1 - expect(model.where.not(:ems_id => nil).count).to eq 6 - end - - def assert_up_migration_for(model) - create_before_migration_stub_data_for(model) - - assert_before_migration_data_of(model, :up) - migrate - assert_after_migration_data_of(model) - end - - def assert_down_migration_for(model) - create_after_migration_stub_data_for(model) - - assert_after_migration_data_of(model) - migrate - assert_before_migration_data_of(model, :down) - end - - ALL_STUBS = [ - :container_definitions_stub, - :container_groups_stub, - :container_images_stub, - :container_projects_stub, - :container_nodes_stub, - :containers_stub - ].freeze - - migration_context :up do - ALL_STUBS.each do |stub| - context "with #{stub}" do - it "change ':deleted_on not nil' :ems_id to :old_ems_id" do - assert_up_migration_for(public_send(stub)) - end - end - end - end - - migration_context :down do - ALL_STUBS.each do |stub| - context "with #{stub}" do - it "change ':deleted_on not nil' :ems_id to nil" do - assert_down_migration_for(public_send(stub)) - end - end - end - end -end diff --git a/spec/migrations/20170707150520_update_container_template_types_spec.rb b/spec/migrations/20170707150520_update_container_template_types_spec.rb deleted file mode 100644 index 8686fd73d..000000000 --- a/spec/migrations/20170707150520_update_container_template_types_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_migration - -describe UpdateContainerTemplateTypes do - let(:container_template_stub) { migration_stub(:ContainerTemplate) } - - migration_context :up do - it "setting type correctly" do - container_template = container_template_stub.create! - - migrate - - expect(container_template.reload).to have_attributes(:type => "ManageIQ::Providers::Openshift::ContainerManager::ContainerTemplate") - end - end -end diff --git a/spec/migrations/20170710132935_convert_custom_button_to_classes_spec.rb b/spec/migrations/20170710132935_convert_custom_button_to_classes_spec.rb deleted file mode 100644 index 472c056a5..000000000 --- a/spec/migrations/20170710132935_convert_custom_button_to_classes_spec.rb +++ /dev/null @@ -1,88 +0,0 @@ -require_migration - -describe ConvertCustomButtonToClasses do - context 'CustomButton' do - let(:params) { custom_button.options } - let!(:custom_button) { migration_stub(:CustomButton).create!(create_params) } - - migration_context :up do - let(:create_params) { {:options => {:button_image => 1} } } - - it 'sets the image class and color' do - migrate - custom_button.reload - - expect(params).to have_key(:button_icon) - expect(params).to have_key(:button_color) - expect(params).not_to have_key(:button_image) - end - - context 'when a button has the default color' do - let(:create_params) { {:options => {:button_image => 6} } } - it 'sets the image class only' do - migrate - custom_button.reload - - expect(params).to have_key(:button_icon) - expect(params).not_to have_key(:button_color) - end - end - end - - migration_context :down do - let(:create_params) { {:options => {:button_icon => 'ff ff-hexagon', :button_color => '#2d7623'}} } - - it 'reverts the image to a number' do - migrate - custom_button.reload - - expect(params).to have_key(:button_image) - expect(params).not_to have_key(:button_icon) - expect(params).not_to have_key(:button_color) - end - end - end - - context 'CustomButtonSet' do - let(:params) { custom_button.set_data } - let!(:custom_button) { migration_stub(:MiqSet).create!(create_params) } - - migration_context :up do - let(:create_params) { {:set_data => {:button_image => 1}, :set_type => 'CustomButtonSet'} } - - it 'sets the image class and color' do - migrate - custom_button.reload - - expect(params).to have_key(:button_icon) - expect(params).to have_key(:button_color) - expect(params).not_to have_key(:button_image) - end - - context 'when a button set has the default color' do - let(:create_params) { {:set_data => {:button_image => 6}, :set_type => 'CustomButtonSet'} } - - it 'sets the image class only' do - migrate - custom_button.reload - - expect(params).to have_key(:button_icon) - expect(params).not_to have_key(:button_color) - end - end - end - - migration_context :down do - let(:create_params) { {:set_data => {:button_icon => 'ff ff-hexagon', :button_color => '#2d7623'}, :set_type => 'CustomButtonSet'} } - - it 'reverts the image to a number' do - migrate - custom_button.reload - - expect(params).to have_key(:button_image) - expect(params).not_to have_key(:button_icon) - expect(params).not_to have_key(:button_color) - end - end - end -end diff --git a/spec/migrations/20170718111834_unify_container_definition_and_container_spec.rb b/spec/migrations/20170718111834_unify_container_definition_and_container_spec.rb deleted file mode 100644 index 4411845d3..000000000 --- a/spec/migrations/20170718111834_unify_container_definition_and_container_spec.rb +++ /dev/null @@ -1,173 +0,0 @@ -require_migration - -describe UnifyContainerDefinitionAndContainer do - let(:container_stub) { migration_stub(:Container) } - let(:container_definition_stub) { migration_stub(:ContainerDefinition) } - - let(:security_context_stub) { migration_stub(:SecurityContext) } - let(:container_env_var_stub) { migration_stub(:ContainerEnvVar) } - let(:container_port_config_stub) { migration_stub(:ContainerPortConfig) } - - let(:definition_hash) do - { - :image => "my_image", - :image_pull_policy => "image_pull_policy", - :memory => "memory", - :cpu_cores => 1.1, - :container_group_id => 1, - :privileged => true, - :run_as_user => 2, - :run_as_non_root => true, - :capabilities_add => "capabilities_add", - :capabilities_drop => "capabilities_drop", - :command => "command" - } - end - - let(:container_hash) do - { - :name => "mycontainer", - :ems_ref => "2da0c9e4-e6f9-11e6-a348-001a4a162683_registry_openshift/origin-docker-registry:v1.3.3", - :ems_id => 1, - :old_ems_id => nil, - :deleted_on => Time.now.beginning_of_hour.utc - } - end - - let(:queue_stub) { migration_stub(:MiqQueue) } - - migration_context :up do - it "merges container_defintion and container" do - container_def = container_definition_stub.create!(definition_hash) - container = container_stub.create!(container_hash.merge(:container_definition => container_def)) - env_var = container_env_var_stub.create!(:name => "REGISTRY_HTTP_ADDR", - :value => ":5000", - :container_definition_id => container_def.id) - port_config = container_port_config_stub.create!(:ems_ref => "2da0c9e4", - :port => 5000, - :protocol => "TCP", - :container_definition_id => container_def.id) - security_context = security_context_stub.create!(:se_linux_level => "s0:c1,c0", - :resource_id => container_def.id, - :resource_type => 'ContainerDefinition') - - container_def2 = container_definition_stub.create!(definition_hash.merge(:image => "my_image2")) - container2 = container_stub.create!(container_hash.merge(:container_definition => container_def2, - :name => "mycontainer2")) - env_var2 = container_env_var_stub.create!(:name => "REGISTRY_HTTP_ADDR", - :value => ":6000", - :container_definition_id => container_def2.id) - port_config2 = container_port_config_stub.create!(:ems_ref => "2da0c9e4", - :port => 6000, - :protocol => "TCP", - :container_definition_id => container_def2.id) - security_context2 = security_context_stub.create!(:se_linux_level => "s1:c1,c0", - :resource_id => container_def2.id, - :resource_type => 'ContainerDefinition') - - migrate - - expect(container.reload).to have_attributes(definition_hash.merge(container_hash)) - - expect(port_config.reload).to have_attributes(:container_id => container.id) - expect(env_var.reload).to have_attributes(:container_id => container.id) - expect(security_context.reload).to have_attributes(:resource_type => "Container", - :resource_id => container.id) - - expect(port_config2.reload).to have_attributes(:container_id => container2.id) - expect(env_var2.reload).to have_attributes(:container_id => container2.id) - expect(security_context2.reload).to have_attributes(:resource_type => "Container", - :resource_id => container2.id) - end - - it "does not fail when container_definition has no container" do - container_def = container_definition_stub.create!(definition_hash) - container = container_stub.create!(container_hash.merge(:container_definition => container_def)) - env_var = container_env_var_stub.create!(:name => "REGISTRY_HTTP_ADDR", - :value => ":5000", - :container_definition_id => container_def.id) - port_config = container_port_config_stub.create!(:ems_ref => "2da0c9e4", - :port => 5000, - :protocol => "TCP", - :container_definition_id => container_def.id) - security_context = security_context_stub.create!(:se_linux_level => "s0:c1,c0", - :resource_id => container_def.id, - :resource_type => 'ContainerDefinition') - - container_def2 = container_definition_stub.create!(definition_hash.merge(:image => "my_image2")) - - env_var2 = container_env_var_stub.create!(:name => "REGISTRY_HTTP_ADDR", - :value => ":6000", - :container_definition_id => container_def2.id) - port_config2 = container_port_config_stub.create!(:ems_ref => "2da0c9e4", - :port => 6000, - :protocol => "TCP", - :container_definition_id => container_def2.id) - security_context2 = security_context_stub.create!(:se_linux_level => "s1:c1,c0", - :resource_id => container_def2.id, - :resource_type => 'ContainerDefinition') - - migrate - - expect(container.reload).to have_attributes(definition_hash.merge(container_hash)) - expect(port_config.reload).to have_attributes(:container_id => container.id) - expect(env_var.reload).to have_attributes(:container_id => container.id) - expect(security_context.reload).to have_attributes(:resource_type => "Container", - :resource_id => container.id) - end - - it "deletes purge jobs from the queue" do - queue_stub.create(:class_name => "ContainerDefinition", :method_name => "purge_timer") - - migrate - - expect(queue_stub.where(:method_name => "purge_timer", :class_name => 'ContainerDefinition').count).to eq(0) - end - end - - migration_context :down do - it "splits container_definition columns from container" do - container = container_stub.create!(definition_hash.merge(container_hash)) - env_var = container_env_var_stub.create!(:name => "REGISTRY_HTTP_ADDR", - :value => ":5000", :field_path => nil, - :container_id => container.id) - port_config = container_port_config_stub.create!(:ems_ref => "2da0c9e4", - :port => 5000, - :protocol => "TCP", - :container_id => container.id) - security_context = security_context_stub.create!(:resource_type => "Container", - :resource_id => container.id, - :se_linux_level => "s0:c0,c0") - - container2 = container_stub.create!(definition_hash.merge(container_hash).merge(:name => "mycontainer2")) - env_var2 = container_env_var_stub.create!(:name => "REGISTRY_HTTP_ADDR", - :value => ":6000", - :container_id => container2.id) - port_config2 = container_port_config_stub.create!(:ems_ref => "c9e42da0", - :port => 6000, - :protocol => "TCP", - :container_id => container2.id) - security_context2 = security_context_stub.create!(:se_linux_level => "s1:c1,c0", - :resource_id => container2.id, - :resource_type => 'Container') - migrate - - container.reload - container_def = container_definition_stub.find(container.container_definition_id) - expect(container_def).to have_attributes(definition_hash.merge(:ems_ref => container.ems_ref, - :ems_id => container.ems_id, - :old_ems_id => container.old_ems_id, - :deleted_on => container.deleted_on)) - expect(env_var.reload).to have_attributes(:value => ":5000") - expect(port_config.reload).to have_attributes(:port => 5000) - expect(security_context.reload).to have_attributes(:se_linux_level => "s0:c0,c0") - - container2.reload - container_def2 = container_definition_stub.find(container2.container_definition_id) - expect(container_def2.name).to eq("mycontainer2") - expect(env_var2.reload).to have_attributes(:value => ":6000") - expect(port_config2.reload).to have_attributes(:port => 6000) - expect(security_context2.reload).to have_attributes(:se_linux_level => "s1:c1,c0") - end - end -end diff --git a/spec/migrations/20170821085511_update_type_of_orchestration_template_spec.rb b/spec/migrations/20170821085511_update_type_of_orchestration_template_spec.rb deleted file mode 100644 index d6a107171..000000000 --- a/spec/migrations/20170821085511_update_type_of_orchestration_template_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -require_migration - -describe UpdateTypeOfOrchestrationTemplate do - let(:orchestration_template_klass) { migration_stub(:OrchestrationTemplate) } - - migration_context :up do - it "sets new type for cfn template" do - orchestration_template = orchestration_template_klass.create!(:type => 'OrchestrationTemplateCfn') - migrate - expect(orchestration_template.reload).to have_attributes(:type => "ManageIQ::Providers::Amazon::CloudManager::OrchestrationTemplate") - end - - it "sets new type for hot template" do - orchestration_template = orchestration_template_klass.create!(:type => 'OrchestrationTemplateHot') - migrate - expect(orchestration_template.reload).to have_attributes(:type => "ManageIQ::Providers::Openstack::CloudManager::OrchestrationTemplate") - end - - it "sets new type for vnfd template" do - orchestration_template = orchestration_template_klass.create!(:type => 'OrchestrationTemplateVnfd') - migrate - expect(orchestration_template.reload).to have_attributes(:type => "ManageIQ::Providers::Openstack::CloudManager::VnfdTemplate") - end - - it "sets new type for azure template" do - orchestration_template = orchestration_template_klass.create!(:type => 'OrchestrationTemplateAzure') - migrate - expect(orchestration_template.reload).to have_attributes(:type => "ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate") - end - end - - migration_context :down do - it "reverts type to cfn template" do - orchestration_template = orchestration_template_klass.create!(:type => "ManageIQ::Providers::Amazon::CloudManager::OrchestrationTemplate") - migrate - expect(orchestration_template.reload).to have_attributes(:type => 'OrchestrationTemplateCfn') - end - - it "reverts type to hot template" do - orchestration_template = orchestration_template_klass.create!(:type => "ManageIQ::Providers::Openstack::CloudManager::OrchestrationTemplate") - migrate - expect(orchestration_template.reload).to have_attributes(:type => 'OrchestrationTemplateHot') - end - - it "reverts type to vnfd template" do - orchestration_template = orchestration_template_klass.create!(:type => "ManageIQ::Providers::Openstack::CloudManager::VnfdTemplate") - migrate - expect(orchestration_template.reload).to have_attributes(:type => 'OrchestrationTemplateVnfd') - end - - it "reverts type to azure template" do - orchestration_template = orchestration_template_klass.create!(:type => "ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate") - migrate - expect(orchestration_template.reload).to have_attributes(:type => 'OrchestrationTemplateAzure') - end - end -end diff --git a/spec/migrations/20170827091406_change_container_quota_items_columns_to_float_spec.rb b/spec/migrations/20170827091406_change_container_quota_items_columns_to_float_spec.rb deleted file mode 100644 index b8ce6b228..000000000 --- a/spec/migrations/20170827091406_change_container_quota_items_columns_to_float_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require_migration - -describe ChangeContainerQuotaItemsColumnsToFloat do - let(:container_quota_item_stub) { migration_stub(:ContainerQuotaItem) } - - migration_context :up do - it "converts string quotas to float values" do - quota_item = container_quota_item_stub.create!(:quota_desired => "10m", - :quota_enforced => "2Gi", - :quota_observed => "30Mi") - - migrate - - quota_item.reload - expect(quota_item.reload).to have_attributes(:quota_desired => 0.01, - :quota_enforced => 2_147_483_648, - :quota_observed => 31_457_280) - end - - it "converts big integers (under 2^49) to float values without rounding" do - big_int = 2**49 - quota_item = container_quota_item_stub.create!(:quota_desired => big_int.to_s) - - migrate - - quota_item.reload - expect(quota_item.quota_desired).to eq(big_int) - end - end - - migration_context :down do - it "converts float values to string quotas" do - quota_item = container_quota_item_stub.create!(:quota_desired => 0.01, - :quota_enforced => 1.0, - :quota_observed => 1.5) - - migrate - - quota_item.reload - expect(quota_item.reload).to have_attributes(:quota_desired => "0.01", - :quota_enforced => "1", - :quota_observed => "1.5") - end - end -end diff --git a/spec/migrations/20170829220132_migrate_database_role_in_settings_spec.rb b/spec/migrations/20170829220132_migrate_database_role_in_settings_spec.rb deleted file mode 100644 index 748c33301..000000000 --- a/spec/migrations/20170829220132_migrate_database_role_in_settings_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require_migration - -describe MigrateDatabaseRoleInSettings do - let(:settings_change_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it "converts the old data" do - setting_changed = settings_change_stub.create!(:key => "/server/role", :value => "database,event,reporting") - setting_ignored = settings_change_stub.create!(:key => "/other/settings", :value => "database") - - migrate - - expect(setting_changed.reload.value).to eq("database_operations,event,reporting") - expect(setting_ignored.reload.value).to eq("database") - end - - it "ignores already converted data" do - setting_changed = settings_change_stub.create!(:key => "/server/role", :value => "database_operations,event,reporting") - - migrate - - expect(setting_changed.reload.value).to eq("database_operations,event,reporting") - end - end -end diff --git a/spec/migrations/20170927135007_migrate_dialog_field_associations_to_use_new_relationship_spec.rb b/spec/migrations/20170927135007_migrate_dialog_field_associations_to_use_new_relationship_spec.rb deleted file mode 100644 index 1f20a697a..000000000 --- a/spec/migrations/20170927135007_migrate_dialog_field_associations_to_use_new_relationship_spec.rb +++ /dev/null @@ -1,89 +0,0 @@ -require_migration - -describe MigrateDialogFieldAssociationsToUseNewRelationship do - let(:dialog_field_stub) { migration_stub(:DialogField) } - let(:dialog_group_stub) { migration_stub(:DialogGroup) } - let(:dialog_tab_stub) { migration_stub(:DialogTab) } - let(:dialog_stub) { migration_stub(:Dialog) } - let(:dialog_field_association_stub) { migration_stub(:DialogFieldAssociation) } - let(:dialog_group_id) { dialog_group_stub.first.id } - let(:dialog_tab_id) { dialog_tab_stub.first.id } - let(:dialog_id) { dialog_stub.first.id } - - migration_context :up do - before do - dialog_stub.create! - dialog_tab_stub.create!(:dialog_id => dialog_id, :position => 4) - dialog_group_stub.create!(:dialog_tab_id => dialog_tab_id, :position => 7) - end - - it "does not create a reference when trigger field is after responder field" do - dialog_field_stub.create!(:name => "dialog_field4", :auto_refresh => true, :position => 0, :dialog_group_id => dialog_group_id, :type => "DialogFieldTextbox") - dialog_field_stub.create!(:name => "dialog_field1", :trigger_auto_refresh => true, :position => 4, :dialog_group_id => dialog_group_id, :type => "DialogFieldDropdown") - expect(dialog_field_association_stub.count).to eq(0) - - migrate - - expect(dialog_field_association_stub.count).to eq(0) - end - - it "does not create a circular reference" do - dialog_field_stub.create!(:name => "dialog_field4", :trigger_auto_refresh => true, :auto_refresh => true, :position => 0, :dialog_group_id => dialog_group_id, :type => "DialogFieldRadioButton") - dialog_field_stub.create!(:name => "dialog_field1", :auto_refresh => true, :trigger_auto_refresh => true, :position => 4, :dialog_group_id => dialog_group_id, :type => "DialogFieldTagControl") - expect(dialog_field_association_stub.count).to eq(0) - - migrate - - expect(dialog_field_association_stub.count).to eq(1) - expect(dialog_field_association_stub.first.trigger_id).to eq(dialog_field_stub.first.id) - expect(dialog_field_association_stub.first.respond_id).to eq(dialog_field_stub.second.id) - end - - it "does create a reference when valid one is present" do - dialog_field_stub.create!(:name => "dialog_field4", :auto_refresh => true, :position => 2, :dialog_group_id => dialog_group_id) - dialog_field_stub.create!(:name => "dialog_field1", :trigger_auto_refresh => true, :position => 0, :dialog_group_id => dialog_group_id) - expect(dialog_field_association_stub.count).to eq(0) - - migrate - - expect(dialog_field_association_stub.count).to eq(1) - expect(dialog_field_association_stub.first.trigger_id).to eq(dialog_field_stub.second.id) - expect(dialog_field_association_stub.first.respond_id).to eq(dialog_field_stub.first.id) - end - - it "does not create association when dialog tab is missing" do - dialog_tab_stub.delete_all - dialog_field_stub.create!(:name => "dialog_field4", :auto_refresh => true, :position => 2, :dialog_group_id => dialog_group_stub.first.id) - dialog_field_stub.create!(:name => "dialog_field1", :trigger_auto_refresh => true, :position => 0, :dialog_group_id => dialog_group_stub.first.id) - expect(dialog_field_association_stub.count).to eq(0) - - migrate - - expect(dialog_field_association_stub.count).to eq(0) - end - - it "only creates dialog associations if the fields are on the same dialog" do - dialog_field_stub.create!(:name => "dialog_field4", :trigger_auto_refresh => true, :position => 4, :dialog_group_id => dialog_group_stub.first.id, :type => "DialogFieldDateControl") - - expect(dialog_field_association_stub.count).to eq(0) - - migrate - - expect(dialog_field_association_stub.count).to eq(0) - end - end - - migration_context :down do - it "should delete dialog field associations" do - dialog_field_stub.create!(:name => "dialog_field6") - dialog_field_stub.create!(:name => "dialog_field9") - dialog_field_association_stub.create!(:trigger_id => dialog_field_stub.first.id, :respond_id => dialog_field_stub.second.id) - - expect(dialog_field_association_stub.count).to eq(1) - - migrate - - expect(dialog_field_association_stub.count).to eq(0) - end - end -end diff --git a/spec/migrations/20170928202851_migrate_middleware_server_to_wildfly_and_eap_spec.rb b/spec/migrations/20170928202851_migrate_middleware_server_to_wildfly_and_eap_spec.rb deleted file mode 100644 index 6b1c558e9..000000000 --- a/spec/migrations/20170928202851_migrate_middleware_server_to_wildfly_and_eap_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -require_migration - -describe MigrateMiddlewareServerToWildflyAndEap do - let(:mw_server_stub) { migration_stub(:MiddlewareServer) } - - migration_context :up do - it "sets new type for WildFly server" do - mw_server = mw_server_stub.create!( - :type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer", - :product => "WildFly Full" - ) - migrate - expect(mw_server.reload).to have_attributes( - :type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerWildfly" - ) - end - - it "sets new type for EAP server" do - mw_server = mw_server_stub.create!( - :type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer", - :product => "JBoss EAP" - ) - migrate - expect(mw_server.reload).to have_attributes( - :type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerEap" - ) - end - - it "leave type unchanged for other mw servers" do - mw_server = mw_server_stub.create!( - :type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer", - :product => "Hawkular" - ) - migrate - expect(mw_server.reload).to have_attributes( - :type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer" - ) - end - end - - migration_context :down do - it "reverts type for WildFly" do - mw_server = mw_server_stub.create!(:type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerWildfly") - migrate - expect(mw_server.reload).to have_attributes(:type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer") - end - - it "reverts type for EAP server" do - mw_server = mw_server_stub.create!(:type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerEap") - migrate - expect(mw_server.reload).to have_attributes(:type => "ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer") - end - end -end diff --git a/spec/migrations/20171011180000_move_openstack_refresher_settings_spec.rb b/spec/migrations/20171011180000_move_openstack_refresher_settings_spec.rb deleted file mode 100644 index 2c5c65708..000000000 --- a/spec/migrations/20171011180000_move_openstack_refresher_settings_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require_migration - -describe MoveOpenstackRefresherSettings do - let(:settings_stub) { migration_stub(:SettingsChange) } - - migration_context :up do - it 'Move Openstack provider refresher settings' do - settings_stub.create!(:key => '/ems/ems_openstack/refresh/inventory_object_refresh', :value => true) - settings_stub.create!(:key => '/ems/ems_openstack/refresh/heat/is_global_admin', :value => true) - settings_stub.create!(:key => '/ems/ems_openstack/refresh/is_admin', :value => true) - settings_stub.create!(:key => '/ems/ems_openstack/refresh/event_targeted_refresh', :value => true) - - migrate - - expect(settings_stub.where(:key => '/ems/ems_refresh/openstack/inventory_object_refresh').count).to eq(1) - expect(settings_stub.where(:key => '/ems/ems_refresh/openstack/heat/is_global_admin').count).to eq(1) - expect(settings_stub.where(:key => '/ems/ems_refresh/openstack/is_admin').count).to eq(1) - expect(settings_stub.where(:key => '/ems/ems_refresh/openstack/allow_targeted_refresh').count).to eq(1) - end - end -end diff --git a/spec/migrations/20171023170841_ensure_cloud_managers_spec.rb b/spec/migrations/20171023170841_ensure_cloud_managers_spec.rb deleted file mode 100644 index 861c2015a..000000000 --- a/spec/migrations/20171023170841_ensure_cloud_managers_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -require_migration - -describe EnsureCloudManagers do - let(:ems_stub) { migration_stub(:ExtManagementSystem) } - let(:zone_id) { anonymous_class_with_id_regions.region_to_range(anonymous_class_with_id_regions.my_region_number).begin } - - let!(:manager) do - ems_stub.create!( - :name => "My Amazon", - :type => "ManageIQ::Providers::Amazon::CloudManager", - :provider_region => "us-east-1", - :zone_id => zone_id - ) - end - - def assert_managers - emses = ems_stub.order(:type).collect do |ems| - ems.attributes.slice(*%w[name type provider_region zone_id parent_ems_id]) - end - - expect(emses).to eq( - [ - { - "name" => "My Amazon", - "type" => "ManageIQ::Providers::Amazon::CloudManager", - "provider_region" => "us-east-1", - "zone_id" => zone_id, - "parent_ems_id" => nil - }, - { - "name" => "My Amazon Network Manager", - "type" => "ManageIQ::Providers::Amazon::NetworkManager", - "provider_region" => "us-east-1", - "zone_id" => zone_id, - "parent_ems_id" => manager.id - }, - { - "name" => "My Amazon EBS Storage Manager", - "type" => "ManageIQ::Providers::Amazon::StorageManager::Ebs", - "provider_region" => "us-east-1", - "zone_id" => zone_id, - "parent_ems_id" => manager.id - }, - ] - ) - end - - migration_context :up do - it "creates managers for an Amazon CloudManager without child managers" do - migrate - - assert_managers - end - - it "handles an Amazon CloudManager already with child managers" do - ems_stub.create!( - :name => "My Amazon Network Manager", - :type => "ManageIQ::Providers::Amazon::NetworkManager", - :provider_region => "us-east-1", - :zone_id => zone_id, - :parent_ems_id => manager.id - ) - ems_stub.create!( - :name => "My Amazon EBS Storage Manager", - :type => "ManageIQ::Providers::Amazon::StorageManager::Ebs", - :provider_region => "us-east-1", - :zone_id => zone_id, - :parent_ems_id => manager.id - ) - - migrate - - assert_managers - end - end -end diff --git a/spec/migrations/20171025122732_move_ems_refresh_args_to_data_spec.rb b/spec/migrations/20171025122732_move_ems_refresh_args_to_data_spec.rb deleted file mode 100644 index 3821f0ab8..000000000 --- a/spec/migrations/20171025122732_move_ems_refresh_args_to_data_spec.rb +++ /dev/null @@ -1,88 +0,0 @@ -require_migration - -describe MoveEmsRefreshArgsToData do - let(:miq_queue_stub) { migration_stub(:MiqQueue) } - let(:targets) { [['Vm', 1], ['Host', 2]] } - let(:refresh_queue_options) do - { - :class_name => 'EmsRefresh', - :method_name => 'refresh', - :role => 'ems_inventory', - :queue_name => 'ems_1', - :zone => 'default', - } - end - let(:refresh_new_target_queue_options) do - { - :class_name => 'EmsRefresh', - :method_name => 'refresh_new_target', - :role => 'ems_inventory', - :queue_name => 'ems_1', - :zone => 'default', - } - end - - migration_context :up do - it "Moves EmsRefresh.refresh queue args to data" do - q_item = miq_queue_stub.create!(refresh_queue_options.merge(:args => [targets])) - - migrate - - expect(Marshal.load(q_item.reload.msg_data)).to match_array(targets) - end - - it "Leaves EmsRefresh.refresh args empty" do - q_item = miq_queue_stub.create!(refresh_queue_options.merge(:args => [targets])) - - migrate - - expect(q_item.reload.args).to match_array([]) - end - - it "Ignores unrelated queue items" do - args = [{:ems_ref => "vm-123"}] - q_item = miq_queue_stub.create!(refresh_new_target_queue_options.merge(:args => args)) - - migrate - - expect(q_item.reload.args).to match_array(args) - end - end - - migration_context :down do - it "Moves EmsRefresh.refresh data to args" do - q_item = miq_queue_stub.create!(refresh_queue_options.merge(:msg_data => Marshal.dump(targets))) - - migrate - - expect(q_item.reload.args).to match_array(targets) - end - - it "If there are no args" do - q_item = miq_queue_stub.create!(refresh_queue_options.merge(:msg_data => nil)) - - migrate - - expect(q_item.reload.args).to match_array([]) - end - - it "Handle invalid marshal format errors" do - # "\x03\x00\x00" is an empty array in Marshal version 3.0 - q_item = miq_queue_stub.create!(refresh_queue_options.merge(:msg_data => "\x03\x00\x00")) - - migrate - - expect { q_item.reload }.to raise_exception(ActiveRecord::RecordNotFound) - end - - it "Deletes invalid queue items but migrates the rest" do - # "\x03\x00\x00" is an empty array in Marshal version 3.0 - miq_queue_stub.create!(refresh_queue_options.merge(:msg_data => "\x03\x00\x00")) - q_item = miq_queue_stub.create!(refresh_queue_options.merge(:msg_data => Marshal.dump(targets))) - - migrate - - expect(q_item.reload.args).to match_array(targets) - end - end -end diff --git a/spec/migrations/20171026103833_add_cores_allocated_rate_detail_spec.rb b/spec/migrations/20171026103833_add_cores_allocated_rate_detail_spec.rb deleted file mode 100644 index 973dfcf78..000000000 --- a/spec/migrations/20171026103833_add_cores_allocated_rate_detail_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require_migration - -describe AddCoresAllocatedRateDetail do - let(:rate_stub) { migration_stub(:ChargebackRate) } - let(:detail_stub) { migration_stub(:ChargebackRateDetail) } - let(:field_stub) { migration_stub(:ChargeableField) } - let(:measure_stub) { migration_stub(:ChargebackRateDetailMeasure) } - - let(:default_rate) { rate_stub.create!(:rate_type => 'Compute', :default => :true) } - let(:custom_rate) { rate_stub.create!(:rate_type => 'Compute') } - - let(:rate_details) do - [ - {:metric => 'cpu_usagemhz_rate_average', :group => 'cpu', :source => 'used', :description => 'Used CPU'}, - {:metric => 'derived_vm_numvcpus', :group => 'cpu', :source => 'allocated', :description => 'Allocated CPU Count'}, - {:metric => 'disk_usage_rate_average', :group => 'disk_io', :source => 'used', :description => 'Used Disk I/O'} - ] - end - - let(:allocated_cores) { {:metric => 'derived_vm_numvcpus_cores', :group => 'cpu cores', :source => 'allocated', :description => 'Allocated CPU Cores'} } - - migration_context :up do - it 'Adds a "Allocated CPU Cores" rate detail to existing details' do - rate_details.each do |field| - detail_stub.create!(field.merge(:chargeback_rate_id => default_rate.id)) - detail_stub.create!(field.merge(:chargeback_rate_id => custom_rate.id)) - end - - migrate - - expect(default_rate.reload.chargeback_rate_details.where(:description => "Allocated CPU Cores").count).to eq(1) - expect(custom_rate.reload.chargeback_rate_details.where(:description => "Allocated CPU Cores").count).to eq(1) - end - end - - migration_context :down do - it 'Removes all "Allocated CPU Cores" rate details' do - detail_stub.create!(allocated_cores.merge(:chargeback_rate_id => default_rate.id)) - detail_stub.create!(allocated_cores.merge(:chargeback_rate_id => custom_rate.id)) - - migrate - - expect(detail_stub.where(:description => "Allocated CPU Cores").count).to eq(0) - end - end -end diff --git a/spec/migrations/20171026114327_add_deleted_on_to_container_quota_and_items_spec.rb b/spec/migrations/20171026114327_add_deleted_on_to_container_quota_and_items_spec.rb deleted file mode 100644 index 33d4ba9e9..000000000 --- a/spec/migrations/20171026114327_add_deleted_on_to_container_quota_and_items_spec.rb +++ /dev/null @@ -1,101 +0,0 @@ -require_migration - -describe AddDeletedOnToContainerQuotaAndItems do - let(:container_quota_stub) { migration_stub(:ContainerQuota) } - let(:container_quota_item_stub) { migration_stub(:ContainerQuotaItem) } - - let(:quota_data) do - { - :name => "compute-resources", - # This is a real example, quota existed in openshift 2 month before - # provider was even added and refresh created DB record. - :created_on => "2017-10-19 09:07:28 UTC", - :ems_created_on => "2017-08-09 11:56:21 UTC", - :ems_ref => "c2a9805e-7cf9-11e7-8ac6-001a4a162683", - :resource_version => "5553729", - # omitted ems_id, container_project_id. - } - end - let(:item_data) do - { - :resource => "cpu", - :quota_desired => 0.02, - :quota_enforced => 0.02, - :quota_observed => 0.0, - } - end - - migration_context :up do - it "works with a container_quota_item" do - quota = container_quota_stub.create!(quota_data) - item = container_quota_item_stub.create!(:container_quota_id => quota.id, **item_data) - - migrate - item.reload - - expect(item.created_at).to eq(quota.created_on) - expect(item.updated_at).not_to eq(nil) - end - - # really improbable but just in case - it "works with an item whose quota.created_on is null" do - quota = container_quota_stub.create!(quota_data) - quota.update_columns(:created_on => nil) - expect(quota.reload.created_on).to eq(nil) # verify we convinced rails to clear the timestamp - - item = container_quota_item_stub.create!(:container_quota_id => quota.id, **item_data) - - migrate - item.reload - - expect(item.deleted_on).to eq(nil) - expect(item.created_at).not_to eq(nil) - expect(item.updated_at).not_to eq(nil) - end - - it "works with an orphan item that has no parent quota" do - item = container_quota_item_stub.create!(:container_quota_id => nil, **item_data) - - migrate - item.reload - - expect(item.deleted_on).to eq(nil) - expect(item.created_at).not_to eq(nil) - expect(item.updated_at).not_to eq(nil) - end - end - - migration_context :down do - let(:quota_data_with_timestamps) do - quota_data.merge(:deleted_on => "2017-11-15 15:55:55 UTC") - end - let(:item_data_with_timestamps) do - item_data.merge(:created_at => "2017-10-21 11:11:11 UTC", - :updated_at => "2017-10-22 22:22:22 UTC", - :deleted_on => "2017-10-23 23:33:33 UTC") - end - - it "works with a container_quota_item" do - quota = container_quota_stub.create!(quota_data_with_timestamps) - container_quota_item_stub.create!(:container_quota_id => quota.id, **item_data_with_timestamps) - - migrate - end - - it "works with an item whose quota.created_on is null" do - quota = container_quota_stub.create!(quota_data_with_timestamps) - quota.update_columns(:created_on => nil) - expect(quota.reload.created_on).to eq(nil) # verify we convinced rails to clear the timestamp - - container_quota_item_stub.create!(:container_quota_id => quota.id, **item_data_with_timestamps) - - migrate - end - - it "works with an orphan item that has no parent quota" do - container_quota_item_stub.create!(:container_quota_id => nil, **item_data_with_timestamps) - - migrate - end - end -end diff --git a/spec/migrations/20171030131403_fix_hawkular_endpoints_with_port_nil_spec.rb b/spec/migrations/20171030131403_fix_hawkular_endpoints_with_port_nil_spec.rb deleted file mode 100644 index 975e059ec..000000000 --- a/spec/migrations/20171030131403_fix_hawkular_endpoints_with_port_nil_spec.rb +++ /dev/null @@ -1,65 +0,0 @@ -require_migration - -describe FixHawkularEndpointsWithPortNil do - let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } - let(:endpoint_stub) { migration_stub(:Endpoint) } - - migration_context :up do - it 'Modifies hawkular endpoints with nil port' do - ems = ext_management_system_stub.create!( - :name => 'container', - :type => 'ManageIQ::Providers::Openshift::ContainerManager' - ) - hawk = endpoint_stub.create!( - :role => "hawkular", - :hostname => "hawkname", - :port => nil, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - - migrate - - expect(hawk.reload.port).to eq(443) - end - - it 'Does not modify non-nil port, or non-containers-hawkular endpoints' do - ems = ext_management_system_stub.create!( - :name => 'container', - :type => 'ManageIQ::Providers::Openshift::ContainerManager' - ) - hawk = endpoint_stub.create!( - :role => "hawkular", - :hostname => "hawkname", - :port => 123, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - main = endpoint_stub.create!( - :role => "default", - :hostname => "hostname", - :port => nil, - :resource_type => "ExtManagementSystem", - :resource_id => ems.id - ) - - other_ems = ext_management_system_stub.create!( - :name => 'container', - :type => 'ManageIQ::Providers::Amazon::CloudManager' - ) - other = endpoint_stub.create!( - :role => "unrelated", - :hostname => "neverwhere", - :port => nil, - :resource_type => "ExtManagementSystem", - :resource_id => other_ems.id - ) - - migrate - - expect(hawk.reload.port).to eq(123) - expect(main.reload.port).to eq(nil) - expect(other.reload.port).to eq(nil) - end - end -end diff --git a/spec/migrations/data/20131125153220_import_provision_dialogs_spec/miq_provision_dialogs.rb b/spec/migrations/data/20131125153220_import_provision_dialogs_spec/miq_provision_dialogs.rb deleted file mode 100644 index d753c91e1..000000000 --- a/spec/migrations/data/20131125153220_import_provision_dialogs_spec/miq_provision_dialogs.rb +++ /dev/null @@ -1,155 +0,0 @@ -module MiqProvisionDialogs - def self.dialogs - { - :dialog_order => [:requester, :purpose, :service, :environment, :hardware, :network, :customize, :schedule], - :buttons => [:submit, :cancel], # :continue - :dialogs => { - :requester => { - :description => "Requester", - :display => :show, # :hide || :show || :ignore - :field_order => nil, # future - :fields => { # :display => :hide || :ignore || :show || :edit - :owner_email => {:data_type => :string, :display => :edit, :required => true, :description => "E-Mail"}, - :owner_first_name => {:data_type => :string, :display => :edit, :required => true, :description => "First Name"}, - :owner_last_name => {:data_type => :string, :display => :edit, :required => true, :description => "Last Name"}, - :owner_load_ldap => {:data_type => :button, :display => :show, :required => false, :description => "Look Up LDAP Email", :pressed => {:method => :retrieve_ldap}}, - :owner_address => {:data_type => :string, :display => :edit, :required => false, :description => "Address"}, - :owner_city => {:data_type => :string, :display => :edit, :required => false, :description => "City"}, - :owner_state => {:data_type => :string, :display => :edit, :required => false, :description => "State"}, - :owner_zip => {:data_type => :string, :display => :edit, :required => false, :description => "Zip code"}, - :owner_country => {:data_type => :string, :display => :edit, :required => false, :description => "Country/Region"}, - :owner_title => {:data_type => :string, :display => :edit, :required => false, :description => "Title"}, - :owner_company => {:data_type => :string, :display => :edit, :required => false, :description => "Company"}, - :owner_department => {:data_type => :string, :display => :edit, :required => false, :description => "Department"}, - :owner_office => {:data_type => :string, :display => :edit, :required => false, :description => "Office"}, - :owner_phone => {:data_type => :string, :display => :edit, :required => false, :description => "Phone"}, - :owner_phone_mobile => {:data_type => :string, :display => :edit, :required => false, :description => "Mobile"}, - :owner_manager => {:data_type => :string, :display => :edit, :required => false, :description => "Name"}, - :owner_manager_mail => {:data_type => :string, :display => :edit, :required => false, :description => "E-Mail"}, - :owner_manager_phone => {:data_type => :string, :display => :edit, :required => false, :description => "Phone"} - } - }, - :purpose => { - :description => "Purpose", - :display => :show, # :hide || :show || :ignore - :field_order => nil, # future - :fields => { - :vm_tags => {:data_type => :integer, :display => :edit, :required => false, :description => "Tags", :required_method => :validate_tags, :required_tags => [], :options => {:exclude => [], :include => [], :single_select => [], :order => []}}, - } - }, - :service => { - :description => "Catalog", - :display => :show, - :fields => { - :vm_filter => {:data_type => :integer, :display => :edit, :required => false, :description => "Filter", :values_from => {:method => :allowed_filters, :options => {:category => :Vm}}}, - :src_vm_id => {:data_type => :integer, :display => :edit, :required => true, :description => "Name", :values_from => {:method => :allowed_templates, :options => {:tag_filters => []}}, :notes => nil, :notes_display => :show}, - :provision_type => {:data_type => :string, :display => :edit, :required => true, :description => "Provision Type", :default => "vmware", :values_from => {:method => :allowed_provision_types}}, - :linked_clone => {:data_type => :boolean, :display => :edit, :required => false, :description => "Linked Clone", :default => false, :values => {false => 0, true => 1}, :notes => 'VM requires a snapshot', :notes_display => :show}, - :snapshot => {:data_type => :string, :display => :edit, :required => false, :description => "Snapshot", :values_from => {:method => :allowed_snapshots}, :auto_select_single => false}, - :number_of_vms => {:data_type => :integer, :display => :edit, :required => false, :description => "Count", :default => 1, :values_from => {:method => :allowed_number_of_vms, :options => {:max => 50}}}, - :vm_name => {:data_type => :string, :display => :edit, :required => true, :required_method => :validate_vm_name, :min_length => nil, :max_length => nil, :description => "VM Name", :notes => nil, :notes_display => :show}, - :vm_description => {:data_type => :string, :display => :edit, :required => false, :min_length => nil, :max_length => 100, :description => "VM Description"}, - :vm_prefix => {:data_type => :string, :display => :hide, :required => false, :required_method => :validate_vm_name, :description => "VM Name Prefix/Suffix"}, - :host_name => {:data_type => :string, :display => :hide, :required => false, :description => "Host Name"} - } - }, - :environment => { - :description => "Environment", - :display => :show, - :fields => { - :placement_auto => {:data_type => :boolean, :display => :edit, :required => false, :description => "Choose Automatically", :default => false, :values => {false => 0, true => 1}}, - :placement_folder_name => {:data_type => :integer, :display => :edit, :required => false, :description => "Name", :values_from => {:method => :allowed_folders}, :auto_select_single => false}, - :cluster_filter => {:data_type => :integer, :display => :edit, :required => false, :description => "Filter", :values_from => {:method => :allowed_filters, :options => {:category => :EmsCluster}}, :auto_select_single => false}, - :placement_cluster_name => {:data_type => :integer, :display => :edit, :required => false, :description => "Name", :values_from => {:method => :allowed_clusters}, :auto_select_single => false}, - :rp_filter => {:data_type => :integer, :display => :edit, :required => false, :description => "Filter", :values_from => {:method => :allowed_filters, :options => {:category => :ResourcePool}}, :auto_select_single => false}, - :placement_rp_name => {:data_type => :integer, :display => :edit, :required => false, :description => "Name", :values_from => {:method => :allowed_respools}, :auto_select_single => false}, - :host_filter => {:data_type => :integer, :display => :edit, :required => false, :description => "Filter", :values_from => {:method => :allowed_filters, :options => {:category => :Host}}, :auto_select_single => false}, - :placement_host_name => {:data_type => :integer, :display => :edit, :required => true, :required_method => :validate_placement, :description => "Name", :values_from => {:method => :allowed_hosts}, :auto_select_single => false, :required_description => "Host Name"}, - :new_datastore_create => {:data_type => :boolean, :display => :hide, :required => false, :description => "Create Datastore", :default => false, :values => {false => 0, true => 1}}, - :new_datastore_fs_type => {:data_type => :string, :display => :hide, :required => false, :description => "FS Type", :default => "NFS", :values => {"NFS" => "NFS", "VMFS" => "VMFS"}}, - :new_datastore_size => {:data_type => :integer, :display => :hide, :required => false, :description => "Size (GB)"}, - :new_datastore_name => {:data_type => :string, :display => :hide, :required => false, :description => "Name"}, - :new_datastore_thin_provision => {:data_type => :string, :display => :hide, :required => false, :description => "Thin Provision"}, - :new_datastore_autogrow => {:data_type => :string, :display => :hide, :required => false, :description => "Autogrow", :default => false, :values => {false => 0, true => 1}}, - :new_datastore_grow_increment => {:data_type => :integer, :display => :hide, :required => false, :description => "Grow Increment (GB)"}, - :new_datastore_max_size => {:data_type => :integer, :display => :hide, :required => false, :description => "Max Size (GB)"}, - :ds_filter => {:data_type => :integer, :display => :edit, :required => false, :description => "Filter", :values_from => {:method => :allowed_filters, :options => {:category => :Storage}}, :auto_select_single => false}, - :placement_ds_name => {:data_type => :integer, :display => :edit, :required => true, :required_method => :validate_placement, :description => "Name", :values_from => {:method => :allowed_storages}, :auto_select_single => false, :required_description => "Datastore Name"}, - } - }, - :hardware => { - :description => "Hardware", - :display => :show, - :fields => { - :number_of_cpus => {:data_type => :integer, :display => :edit, :required => false, :description => "Number of CPUs", :default => 1, :values => {1 => "1", 2 => "2", 4 => "4", 8 => "8"}}, - :vm_memory => {:data_type => :string, :display => :edit, :required => false, :description => "Memory (MB)", :default => "1024", :values => {"1024" => "1024", "2048" => "2048", "4096" => "4096"}}, - :network_adapters => {:data_type => :integer, :display => :hide, :required => false, :description => "Network Adapters", :default => 1, :values => {1 => "1", 2 => "2", 3 => "3", 4 => "4"}}, - :disk_format => {:data_type => :string, :display => :edit, :required => false, :description => "Disk Format", :default => "unchanged", :values => {"unchanged" => "Default", "thin" => "Thin", "thick" => "Thick"}}, - :cpu_limit => {:data_type => :integer, :display => :edit, :required => false, :description => "CPU (MHz)", :notes => "(-1 = Unlimited)", :notes_display => :show}, - :memory_limit => {:data_type => :integer, :display => :edit, :required => false, :description => "Memory (MB)", :notes => "(-1 = Unlimited)", :notes_display => :show}, - :cpu_reserve => {:data_type => :integer, :display => :edit, :required => false, :description => "CPU (MHz)"}, - :memory_reserve => {:data_type => :integer, :display => :edit, :required => false, :description => "Memory (MB)"} - } - }, - :network => { - :description => "Network", - :display => :show, - :fields => { - :vlan => {:data_type => :string, :display => :edit, :required => true, :description => "vLan", :values_from => {:method => :allowed_vlans, :options => {:dvs => true, :vlans => true}}}, - :mac_address => {:data_type => :string, :display => :hide, :required => false, :description => "MAC Address"}, - } - }, - :customize => { - :description => "Customize", - :display => :show, - :fields => { - :sysprep_enabled => {:data_type => :string, :display => :edit, :required => false, :description => "Customize", :default => "disabled", :values_from => {:method => :allowed_customization}}, - :sysprep_custom_spec => {:data_type => :string, :display => :edit, :required => false, :description => "Name", :values_from => {:method => :allowed_customization_specs}, :auto_select_single => false}, - :sysprep_spec_override => {:data_type => :boolean, :display => :edit, :required => false, :description => "Override Specification Values", :default => false, :values => {false => 0, true => 1}}, - :sysprep_upload_file => {:data_type => :string, :display => :edit, :required => false, :description => "Upload"}, - :sysprep_upload_text => {:data_type => :string, :display => :edit, :required => true, :required_method => :validate_sysprep_upload, :description => "Sysprep Text"}, - :sysprep_timezone => {:data_type => :string, :display => :edit, :required => true, :required_method => :validate_sysprep_field, :description => "Timezone", :values_from => {:method => :get_timezones}}, - :sysprep_auto_logon => {:data_type => :boolean, :display => :edit, :required => false, :description => "Auto Logon", :default => true, :values => {false => 0, true => 1}}, - :sysprep_auto_logon_count => {:data_type => :integer, :display => :edit, :required => false, :description => "Auto Logon Count", :default => 1, :values => {1 => "1", 2 => "2", 3 => "3"}}, - :sysprep_password => {:data_type => :string, :display => :edit, :required => false, :description => "New Administrator Password"}, - :sysprep_identification => {:data_type => :string, :display => :edit, :required => false, :description => "Identification", :default => "domain", :values => {"workgroup" => "Workgroup", "domain" => "Domain"}}, - :sysprep_workgroup_name => {:data_type => :string, :display => :edit, :required => false, :description => "Workgroup Name", :default => "WORKGROUP"}, - :sysprep_domain_name => {:data_type => :string, :display => :edit, :required => false, :description => "Domain Name", :values_from => {:method => :allowed_domains, :options => {:platform => nil, :active_proxy => nil}}, :auto_select_single => false}, - :ldap_ous => {:data_type => :string, :display => :edit, :required => false, :description => "LDAP Group", :values_from => {:method => :allowed_ous_tree}, :auto_select_single => false}, - :sysprep_domain_admin => {:data_type => :string, :display => :edit, :required => false, :description => "Domain Admin"}, - :sysprep_domain_password => {:data_type => :string, :display => :edit, :required => false, :description => "Domain Password"}, - :sysprep_full_name => {:data_type => :string, :display => :edit, :required => true, :required_method => :validate_sysprep_field, :description => "Full Name"}, - :sysprep_organization => {:data_type => :string, :display => :edit, :required => true, :required_method => :validate_sysprep_field, :description => "Organization"}, - :sysprep_product_id => {:data_type => :string, :display => :edit, :required => true, :required_method => :validate_sysprep_field, :description => "ProductID"}, - :sysprep_computer_name => {:data_type => :string, :display => :edit, :required => false, :description => "Computer Name"}, - :sysprep_change_sid => {:data_type => :boolean, :display => :edit, :required => false, :description => "Change SID", :default => true, :values => {false => 0, true => 1}}, - :sysprep_delete_accounts => {:data_type => :boolean, :display => :hide, :display_override => :hide, :required => false, :description => "Delete Accounts", :default => false, :values => {false => 0, true => 1}}, - :sysprep_server_license_mode => {:data_type => :string, :display => :edit, :required => false, :description => "Identification", :default => "perServer", :values => {"perSeat" => "Per seat", "perServer" => "Per server"}}, - :sysprep_per_server_max_connections => {:data_type => :string, :display => :edit, :required => false, :description => "Maximum Connections", :default => "5"}, - :linux_host_name => {:data_type => :string, :display => :edit, :required => false, :description => "Computer Name"}, - :linux_domain_name => {:data_type => :string, :display => :edit, :required => false, :description => "Domain Name"}, - :addr_mode => {:data_type => :string, :display => :edit, :required => false, :description => "Address Mode", :default => "dhcp", :values => {"dhcp" => "DHCP", "static" => "Static"}}, - :ip_addr => {:data_type => :string, :display => :edit, :required => false, :description => "IP Address", :notes => "(Enter starting IP address)", :notes_display => :hide}, - :subnet_mask => {:data_type => :string, :display => :edit, :required => false, :description => "Subnet Mask"}, - :gateway => {:data_type => :string, :display => :edit, :required => false, :description => "Gateway"}, - :dns_servers => {:data_type => :string, :display => :edit, :required => false, :description => "DNS Server list"}, - :dns_suffixes => {:data_type => :string, :display => :edit, :required => false, :description => "DNS Suffix List"}, - :wins_servers => {:data_type => :string, :display => :edit, :required => false, :description => "WINS Server list"} - } - }, - :schedule => { - :description => "Schedule", - :display => :show, - :fields => { - :schedule_type => {:data_type => :string, :display => :edit, :required => false, :description => "When to Provision", :default => "immediately", :values => {"immediately" => "Immediately on Approval", "schedule" => "Schedule"}}, - :schedule_time => {:data_type => :time, :display => :edit, :required => false, :description => "Provision on", :values_from => {:method => :default_schedule_time, :options => {:offset => 86400}}}, - :vm_auto_start => {:data_type => :boolean, :display => :edit, :required => false, :description => "Power on virtual machines after creation", :default => false, :values => {false => 0, true => 1}}, - :retirement => {:data_type => :integer, :display => :edit, :required => false, :description => "Time until Retirement", :default => 0, :values => {0 => "Indefinite", 1.month.to_i => "1 Month", 3.months.to_i => "3 Months", 6.months.to_i => "6 Months"}}, - :retirement_warn => {:data_type => :integer, :display => :edit, :required => true, :description => "Retirement Warning", :default => 1.week.to_i, :values_from => {:method => :values_less_then, :options => {:field => :retirement, :include_equals => false, :values => {1.week.to_i => "1 Week", 2.weeks.to_i => "2 Weeks", 30.days.to_i => "30 Days"}}}, - }, - } - } - } - } - end -end diff --git a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_csv.yaml b/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_csv.yaml deleted file mode 100644 index ee725481d..000000000 --- a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_csv.yaml +++ /dev/null @@ -1 +0,0 @@ ---- ! '\"Activity Sample - Timestamp (Day/Time)\",\" Usage (All) - Number of Operations\n per Second\"\n\n 12/06/12 12:00:00 EST,7.10748825642443\n\n 12/06/12 15:00:00 EST,13.9425255595468\n\n 12/06/12 16:00:00 EST,7.68057474440453\n\n 12/06/12 17:00:00 EST,9.13899721448468\n\n 12/06/12 18:00:00 EST,9.0740947075209\n\n 12/06/12 19:00:00 EST,7.54626532887401\n\n 12/06/12 20:00:00 EST,13.3020227209754\n\n 12/06/12 21:00:00 EST,9.0975677169707\n\n 12/06/12 22:00:00 EST,8.45097493036211\n\n 12/06/12 23:00:00 EST,9.09222624686542\n\n 12/07/12 00:00:00 EST,7.58050139275765\n\n 12/07/12 01:00:00 EST,10.4680144004431\n\n 12/07/12 02:00:00 EST,17.0133741989412\n\n 12/07/12 03:00:00 EST,7.48992547612476\n\n 12/07/12 04:00:00 EST,10.575208913649\n\n 12/07/12 05:00:00 EST,7.38839779005526\n\n 12/07/12 06:00:00 EST,9.31058691378827\n\n 12/07/12 07:00:00 EST,7.51284885327438\n\n 12/07/12 08:00:00 EST,9.14317548746519\n\n 12/07/12 09:00:00 EST,7.48950276243094\n\n 12/07/12 10:00:00 EST,9.19537346711259\n\n 12/07/12 11:00:00 EST,7.38629455650731\n\n'\n \ No newline at end of file diff --git a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_hash.yaml b/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_hash.yaml deleted file mode 100644 index 59cf6d09e..000000000 --- a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_hash.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- -id: 7 -name: Vendor and Guest OS -title: Vendor and Guest OS -rpt_group: Configuration Management - Virtual Machines -rpt_type: Default -priority: 22 -db: Vm -cols: -- vendor -- name -include: - operating_system: - columns: - - product_name - - name -col_order: -- vendor -- operating_system.product_name -- name -- operating_system.name -headers: -- Container -- OS Product Name -- Name -- OS Name -conditions: -order: Ascending -sortby: -- vendor -- operating_system.product_name -group: c -graph: - :type: ParallelThreedColumn - :count: 10 - :other: true -dims: 2 -created_on: 2008-08-14 15:05:45.108115000 Z -updated_on: 2008-08-14 15:19:12.682978000 Z -filename: 100_Configuration Management - Virtual Machines/022_Vendor and Guest OS.yaml -file_mtime: 2015-06-05 20:03:21.000000000 Z -categories: -timeline: -template_type: report -where_clause: -db_options: -generate_cols: -generate_rows: -col_formats: -tz: -time_profile_id: -display_filter: -col_options: -rpt_options: -miq_group_id: -user_id: -table: !ruby/object:Ruport::Data::Table - column_names: &1 - - vendor - - name - - operating_system.product_name - - operating_system.name - - id - record_class: Ruport::Data::Record - data: - - !ruby/object:Ruport::Data::Record - data: - vendor: OpenStack - name: s_appl_downstream-54z_150605_rosMD5Ry - operating_system.product_name: - operating_system.name: - id: 409 - attributes: *1 - - !ruby/object:Ruport::Data::Record - data: - vendor: OpenStack - name: s_appl_downstream-54z_150605_C9N35HpL - operating_system.product_name: - operating_system.name: - id: 410 - attributes: *1 - - !ruby/object:Ruport::Data::Record - data: - vendor: OpenStack - name: s_appl_downstream-54z_150605_hoJKJuCJ - operating_system.product_name: - operating_system.name: - id: 411 - attributes: *1 -sub_table: -filter_summary: -extras: - :grouping: - OpenStack: - :count: 11 - :row: - vendor: OpenStack - name: s_appl_downstream-54z_150605_rosMD5Ry - operating_system.product_name: - operating_system.name: - id: 409 - RedHat: - :count: 77 - :row: - vendor: RedHat - name: psav-scapy - operating_system.product_name: other - operating_system.name: - id: 286 - VMware: - :count: 194 - :row: - vendor: VMware - name: jkrocil-centos66-fvm - operating_system.product_name: CentOS 4/5/6 (64-bit) - operating_system.name: - id: 211 - :_total_: - :count: 282 - :row: {} -ids: -scoped_association: -html_title: -file_name: -record_id: -tl_times: -user_categories: [] -trend_data: {} -performance: -include_for_find: -report_run_time: -chart: -reserved: diff --git a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_obj.yaml b/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_obj.yaml deleted file mode 100644 index 780433153..000000000 --- a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/binary_blob_obj.yaml +++ /dev/null @@ -1,134 +0,0 @@ ---- !ruby/object:MiqReport -attributes: - id: 7 - name: Vendor and Guest OS - title: Vendor and Guest OS - rpt_group: Configuration Management - Virtual Machines - rpt_type: Default - priority: 22 - db: Vm - cols: - - vendor - - name - include: - operating_system: - columns: - - product_name - - name - col_order: - - vendor - - operating_system.product_name - - name - - operating_system.name - headers: - - Container - - OS Product Name - - Name - - OS Name - conditions: - order: Ascending - sortby: - - vendor - - operating_system.product_name - group: c - graph: - :type: ParallelThreedColumn - :count: 10 - :other: true - dims: 2 - created_on: 2008-08-14 15:05:45.108115000 Z - updated_on: 2008-08-14 15:19:12.682978000 Z - filename: 100_Configuration Management - Virtual Machines/022_Vendor and Guest OS.yaml - file_mtime: 2015-06-05 20:03:21.000000000 Z - categories: - timeline: - template_type: report - where_clause: - db_options: - generate_cols: - generate_rows: - col_formats: - tz: - time_profile_id: - display_filter: - col_options: - rpt_options: - miq_group_id: - user_id: -table: !ruby/object:Ruport::Data::Table - column_names: &1 - - vendor - - name - - operating_system.product_name - - operating_system.name - - id - record_class: Ruport::Data::Record - data: - - !ruby/object:Ruport::Data::Record - data: - vendor: OpenStack - name: s_appl_downstream-54z_150605_rosMD5Ry - operating_system.product_name: - operating_system.name: - id: 409 - attributes: *1 - - !ruby/object:Ruport::Data::Record - data: - vendor: OpenStack - name: s_appl_downstream-54z_150605_C9N35HpL - operating_system.product_name: - operating_system.name: - id: 410 - attributes: *1 - - !ruby/object:Ruport::Data::Record - data: - vendor: OpenStack - name: s_appl_downstream-54z_150605_hoJKJuCJ - operating_system.product_name: - operating_system.name: - id: 411 - attributes: *1 -sub_table: -filter_summary: -extras: - :grouping: - OpenStack: - :count: 11 - :row: - vendor: OpenStack - name: s_appl_downstream-54z_150605_rosMD5Ry - operating_system.product_name: - operating_system.name: - id: 409 - RedHat: - :count: 77 - :row: - vendor: RedHat - name: psav-scapy - operating_system.product_name: other - operating_system.name: - id: 286 - VMware: - :count: 194 - :row: - vendor: VMware - name: jkrocil-centos66-fvm - operating_system.product_name: CentOS 4/5/6 (64-bit) - operating_system.name: - id: 211 - :_total_: - :count: 282 - :row: {} -ids: -scoped_association: -html_title: -file_name: -record_id: -tl_times: -user_categories: [] -trend_data: {} -performance: -include_for_find: -report_run_time: -chart: -reserved: diff --git a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_hash.yaml b/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_hash.yaml deleted file mode 100644 index 0edf67226..000000000 --- a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_hash.yaml +++ /dev/null @@ -1,270 +0,0 @@ ---- -id: -name: cb - tag2 -title: cb - tag -rpt_group: Custom -rpt_type: Custom -priority: -db: Chargeback -cols: -- start_date -- display_range -- vm_name -- cpu_cost -- cpu_metric -- cpu_used_cost -- cpu_used_metric -include: {} -col_order: -- display_range -- vm_name -- cpu_cost -- cpu_metric -- cpu_used_cost -- cpu_used_metric -headers: -- Date Range -- VM Name -- CPU Total Cost -- CPU Total -- CPU Used Cost -- CPU Used -conditions: -order: Ascending -sortby: -- start_date -- vm_name -group: y -graph: -dims: -created_on: -updated_on: -filename: -file_mtime: -categories: [] -timeline: -template_type: report -where_clause: -db_options: - :rpt_type: chargeback - :options: - :interval: monthly - :interval_size: 1 - :end_interval_offset: 1 - :tag: "/managed/location/london" -generate_cols: -generate_rows: -col_formats: -- -- -- -- -- -- -tz: -time_profile_id: -display_filter: -col_options: - cpu_allocated_cost: - :grouping: - - :total - cpu_allocated_metric: - :grouping: - - :total - cpu_cost: - :grouping: - - :total - cpu_metric: - :grouping: - - :total - cpu_used_cost: - :grouping: - - :total - cpu_used_metric: - :grouping: - - :total - disk_io_cost: - :grouping: - - :total - disk_io_metric: - :grouping: - - :total - disk_io_used_cost: - :grouping: - - :total - disk_io_used_metric: - :grouping: - - :total - fixed_compute_1_cost: - :grouping: - - :total - fixed_compute_2_cost: - :grouping: - - :total - fixed_cost: - :grouping: - - :total - fixed_storage_1_cost: - :grouping: - - :total - fixed_storage_2_cost: - :grouping: - - :total - memory_allocated_cost: - :grouping: - - :total - memory_allocated_metric: - :grouping: - - :total - memory_cost: - :grouping: - - :total - memory_metric: - :grouping: - - :total - memory_used_cost: - :grouping: - - :total - memory_used_metric: - :grouping: - - :total - net_io_cost: - :grouping: - - :total - net_io_metric: - :grouping: - - :total - net_io_used_cost: - :grouping: - - :total - net_io_used_metric: - :grouping: - - :total - storage_allocated_cost: - :grouping: - - :total - storage_allocated_metric: - :grouping: - - :total - storage_cost: - :grouping: - - :total - storage_metric: - :grouping: - - :total - storage_used_cost: - :grouping: - - :total - storage_used_metric: - :grouping: - - :total - total_cost: - :grouping: - - :total -rpt_options: - :pdf: - :page_size: US-Letter - :queue_timeout: - :summary: - :hide_detail_rows: false -miq_group_id: 1 -user_id: 1 -table: -sub_table: -filter_summary: -extras: - :grouping: - 2015-05-01 00:00:00 UTC: - :count: 3 - :row: - start_date: 2015-05-01 00:00:00.000000000 Z - display_range: May 2015 - vm_name: cu-24x7 - cpu_cost: 102.69583333333337 - cpu_metric: 123757.0 - cpu_used_cost: 102.69583333333337 - cpu_used_metric: 123235.0 - id: - :total: - cpu_allocated_cost: 0.0 - cpu_allocated_metric: 0.0 - cpu_cost: 193.11083333333346 - cpu_metric: 232930.0 - cpu_used_cost: 193.11083333333346 - cpu_used_metric: 231733.0 - disk_io_cost: 0.0 - disk_io_metric: 0.0 - disk_io_used_cost: 0.0 - disk_io_used_metric: 0.0 - fixed_compute_1_cost: 0.0 - fixed_compute_2_cost: 0.0 - fixed_cost: 0.0 - fixed_storage_1_cost: 0.0 - fixed_storage_2_cost: 0.0 - memory_allocated_cost: 0.0 - memory_allocated_metric: 0.0 - memory_cost: 0.0 - memory_metric: 0.0 - memory_used_cost: 0.0 - memory_used_metric: 0.0 - net_io_cost: 0.0 - net_io_metric: 0.0 - net_io_used_cost: 0.0 - net_io_used_metric: 0.0 - storage_allocated_cost: 0.0 - storage_allocated_metric: 0.0 - storage_cost: 0.0 - storage_metric: 0.0 - storage_used_cost: 0.0 - storage_used_metric: 0.0 - total_cost: 0.0 - :_total_: - :count: 3 - :row: {} - :total: - cpu_allocated_cost: 0.0 - cpu_allocated_metric: 0.0 - cpu_cost: 193.11083333333346 - cpu_metric: 232930.0 - cpu_used_cost: 193.11083333333346 - cpu_used_metric: 231733.0 - disk_io_cost: 0.0 - disk_io_metric: 0.0 - disk_io_used_cost: 0.0 - disk_io_used_metric: 0.0 - fixed_compute_1_cost: 0.0 - fixed_compute_2_cost: 0.0 - fixed_cost: 0.0 - fixed_storage_1_cost: 0.0 - fixed_storage_2_cost: 0.0 - memory_allocated_cost: 0.0 - memory_allocated_metric: 0.0 - memory_cost: 0.0 - memory_metric: 0.0 - memory_used_cost: 0.0 - memory_used_metric: 0.0 - net_io_cost: 0.0 - net_io_metric: 0.0 - net_io_used_cost: 0.0 - net_io_used_metric: 0.0 - storage_allocated_cost: 0.0 - storage_allocated_metric: 0.0 - storage_cost: 0.0 - storage_metric: 0.0 - storage_used_cost: 0.0 - storage_used_metric: 0.0 - total_cost: 0.0 - :total_html_rows: 8 -ids: -scoped_association: -html_title: -file_name: -record_id: -tl_times: -user_categories: -trend_data: {} -performance: -include_for_find: -report_run_time: -chart: -reserved: diff --git a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_obj.yaml b/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_obj.yaml deleted file mode 100644 index cccc2fe36..000000000 --- a/spec/migrations/data/20150625220141_fix_serialized_reports_for_rails_four_spec/miq_report_obj.yaml +++ /dev/null @@ -1,271 +0,0 @@ ---- -- !ruby/object:MiqReport - attributes: - name: cb - tag - title: cb - tag - rpt_group: Custom - rpt_type: Custom - priority: - db: Chargeback - cols: - - start_date - - display_range - - vm_name - - cpu_cost - - cpu_metric - - cpu_used_cost - - cpu_used_metric - include: {} - col_order: - - display_range - - vm_name - - cpu_cost - - cpu_metric - - cpu_used_cost - - cpu_used_metric - headers: - - Date Range - - VM Name - - CPU Total Cost - - CPU Total - - CPU Used Cost - - CPU Used - conditions: - order: Ascending - sortby: - - start_date - - vm_name - group: y - graph: - dims: - created_on: - updated_on: - filename: - file_mtime: - categories: [] - timeline: - template_type: report - where_clause: - db_options: - :rpt_type: chargeback - :options: - :interval: daily - :interval_size: 1 - :end_interval_offset: 3 - :tag: "/managed/location/london" - generate_cols: - generate_rows: - col_formats: - - - - - - - - - - - - - tz: - time_profile_id: - display_filter: - col_options: - cpu_allocated_cost: - :grouping: - - :total - cpu_allocated_metric: - :grouping: - - :total - cpu_cost: - :grouping: - - :total - cpu_metric: - :grouping: - - :total - cpu_used_cost: - :grouping: - - :total - cpu_used_metric: - :grouping: - - :total - disk_io_cost: - :grouping: - - :total - disk_io_metric: - :grouping: - - :total - disk_io_used_cost: - :grouping: - - :total - disk_io_used_metric: - :grouping: - - :total - fixed_compute_1_cost: - :grouping: - - :total - fixed_compute_2_cost: - :grouping: - - :total - fixed_cost: - :grouping: - - :total - fixed_storage_1_cost: - :grouping: - - :total - fixed_storage_2_cost: - :grouping: - - :total - memory_allocated_cost: - :grouping: - - :total - memory_allocated_metric: - :grouping: - - :total - memory_cost: - :grouping: - - :total - memory_metric: - :grouping: - - :total - memory_used_cost: - :grouping: - - :total - memory_used_metric: - :grouping: - - :total - net_io_cost: - :grouping: - - :total - net_io_metric: - :grouping: - - :total - net_io_used_cost: - :grouping: - - :total - net_io_used_metric: - :grouping: - - :total - storage_allocated_cost: - :grouping: - - :total - storage_allocated_metric: - :grouping: - - :total - storage_cost: - :grouping: - - :total - storage_metric: - :grouping: - - :total - storage_used_cost: - :grouping: - - :total - storage_used_metric: - :grouping: - - :total - total_cost: - :grouping: - - :total - rpt_options: - :pdf: - :page_size: US-Letter - :queue_timeout: - :summary: - :hide_detail_rows: false - miq_group_id: 1 - user_id: 1 - table: - sub_table: - filter_summary: - extras: - :grouping: - 2015-06-07 00:00:00 UTC: - :count: 4 - :row: - start_date: 2015-06-07 00:00:00.000000000 Z - display_range: 06/07/2015 - vm_name: cu-24x7 - cpu_cost: 1.500045751633987 - cpu_metric: 1808.054901960784 - cpu_used_cost: 1.500045751633987 - cpu_used_metric: 1800.054901960784 - id: - :total: - cpu_allocated_cost: 0.0 - cpu_allocated_metric: 0.0 - cpu_cost: 2.430569230469965 - cpu_metric: 2931.683076563958 - cpu_used_cost: 2.430569230469965 - cpu_used_metric: 2916.683076563958 - disk_io_cost: 0.0 - disk_io_metric: 0.0 - disk_io_used_cost: 0.0 - disk_io_used_metric: 0.0 - fixed_compute_1_cost: 0.0 - fixed_compute_2_cost: 0.0 - fixed_cost: 0.0 - fixed_storage_1_cost: 0.0 - fixed_storage_2_cost: 0.0 - memory_allocated_cost: 0.0 - memory_allocated_metric: 0.0 - memory_cost: 0.0 - memory_metric: 0.0 - memory_used_cost: 0.0 - memory_used_metric: 0.0 - net_io_cost: 0.0 - net_io_metric: 0.0 - net_io_used_cost: 0.0 - net_io_used_metric: 0.0 - storage_allocated_cost: 0.0 - storage_allocated_metric: 0.0 - storage_cost: 0.0 - storage_metric: 0.0 - storage_used_cost: 0.0 - storage_used_metric: 0.0 - total_cost: 0.0 - :_total_: - :count: 4 - :row: {} - :total: - cpu_allocated_cost: 0.0 - cpu_allocated_metric: 0.0 - cpu_cost: 2.430569230469965 - cpu_metric: 2931.683076563958 - cpu_used_cost: 2.430569230469965 - cpu_used_metric: 2916.683076563958 - disk_io_cost: 0.0 - disk_io_metric: 0.0 - disk_io_used_cost: 0.0 - disk_io_used_metric: 0.0 - fixed_compute_1_cost: 0.0 - fixed_compute_2_cost: 0.0 - fixed_cost: 0.0 - fixed_storage_1_cost: 0.0 - fixed_storage_2_cost: 0.0 - memory_allocated_cost: 0.0 - memory_allocated_metric: 0.0 - memory_cost: 0.0 - memory_metric: 0.0 - memory_used_cost: 0.0 - memory_used_metric: 0.0 - net_io_cost: 0.0 - net_io_metric: 0.0 - net_io_used_cost: 0.0 - net_io_used_metric: 0.0 - storage_allocated_cost: 0.0 - storage_allocated_metric: 0.0 - storage_cost: 0.0 - storage_metric: 0.0 - storage_used_cost: 0.0 - storage_used_metric: 0.0 - total_cost: 0.0 - :total_html_rows: 9 - ids: - scoped_association: - html_title: - file_name: - record_id: - tl_times: - user_categories: - trend_data: {} - performance: - include_for_find: - report_run_time: - chart: - reserved: diff --git a/spec/migrations/data/20160127210624_convert_configurations_to_settings_changes_spec/simple.tmpl.yml b/spec/migrations/data/20160127210624_convert_configurations_to_settings_changes_spec/simple.tmpl.yml deleted file mode 100644 index 4ea52fd73..000000000 --- a/spec/migrations/data/20160127210624_convert_configurations_to_settings_changes_spec/simple.tmpl.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -values: - array: - - val1 - - val2 - boolean: true - empty_hash: {} - int_with_method: 10.minutes - integer: 10 - nil: - non_nil: some_value - string: some_value - string_of_numbers: '10' - extra_key1: x - extra_key2: y -very: - deeply: - nested: - string: deep_value