Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments to the vms table. #64

Closed
wants to merge 251 commits into from
Closed

Add comments to the vms table. #64

wants to merge 251 commits into from

Conversation

djberg96
Copy link
Contributor

(copied/transferred from ManageIQ/manageiq#13954)

As of Rails 5 we can add comments to tables and columns within the database. This is useful for developers, both within RedHat and externally, to help develop for the application.

As per the Rails 5 documentation, "It's highly recommended to specify comments in migrations for applications with large databases as it helps people to understand data model and generate documentation."

To that end I've begun with the vms table, and documented as much as I could. However, I need your help to finish it. Anywhere that you see the word "HELP" means I don't fully understand what the column does and need someone to fill in that information for me.

@miq-bot
Copy link
Member

miq-bot commented Sep 11, 2017

Checked commit https://github.com/djberg96/manageiq-schema/commit/10f01e8f57676e986a919874a1a7dc2e80c4fae5 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 77 offenses detected

db/migrate/20170911200128_add_comments_to_vms_table.rb

@miq-bot
Copy link
Member

miq-bot commented Apr 9, 2018

This pull request has been automatically closed because it has not been updated for at least 6 months.

Feel free to reopen this pull request if these changes are still valid.

Thank you for all your contributions!

lpichler and others added 23 commits October 25, 2018 16:44
Migrate OrchestrationTemplateCfn to ManageIQ::Providers::Amazon::CloudManager::OrchestrationTemplate
OrchestrationTemplateHot to ManageIQ::Providers::Openstack::CloudManager::OrchestrationTemplate
OrchestrationTemplateAzure to ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate
OrchestrationTemplateVnfd to ManagerIQ::Provders::Openstack::CloudManager::VnfdTemplate

https://bugzilla.redhat.com/show_bug.cgi?id=1417021
The task `db:migrate:reset` is something that is included in rails, and
is effectively a `rake db:drop db:create db:migrate`.

Explanation
-----------

The definition of `rake db:drop` however looks like this:

    task :load_config do
      puts Rails.application.__id__
      ActiveRecord::Base.configurations       = ActiveRecord::Tasks::DatabaseTasks.database_configuration || {}
      ActiveRecord::Migrator.migrations_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths
    end

    # ...

    desc 'Drops the database from DATABASE_URL ....'
    task :drop => [:load_config, :check_protected_environments] do
      puts Rails.application.__id__
      db_namespace["drop:_unsafe"].invoke
    end

Importantly, the `db:drop` command doesn't require the Rails application
to be initialized, thus the `.migrations_paths` module method of
`ActiveRecord::Tasks::DatabaseTasks` is called prior to the rails
environment being loaded, and that method is memoized.  This means that
the defaults for rails are what are set for the `.migrations_paths` of
`ActiveRecord::Tasks::DatabaseTasks`, and not what we configure in the
`manageiq-schema` initializer.

This fix makes sure that we redefine this attribute when the
`:environment` task is called, but what might make more sense is to
instead have this path changing to a method, and have it be called out
to in `config/application.rb` in the main app.  This would then prevent
the need for the line:

    ActiveRecord::Migrator.migrations_paths = app.config.paths["db/migrate"]

Being necessary.
it belongs to an isomorphic "resource"
carbonin and others added 27 commits October 25, 2018 16:46
This will allow the global to track the changes generated by each
migration as they are replicated.

We don't add the data to the column here because the patch to
AR::Migration#migrate which runs after the column is added
will handle that

https://bugzilla.redhat.com/show_bug.cgi?id=1601015
This will ensure that we catch all the issues that may have been
introduced.
When creating a tenant, if there are already groups in the database,
it would assign a random group.
This would manifest by having a seemingly random group assigned to newly
discovered VMs/Hosts. There can then be privilege issues as the admins
possibly don't have access to the group.

This only happens for customers who had a database before tenancy
was introduced in 2015. It incorrectly assigned during the migration
process in 20151021174140_assign_tenant_default_group

This also will probably only happen for the default tenant.

The fix: When a tenant points to a group that is not a tenant group,
change the default group to point to a new tenant group.
The old group was an incorrect group.

https://bugzilla.redhat.com/show_bug.cgi?id=1625788

I also changed the MiqGroup code to choose the correct group.
Fix an invalid polymorphic resource_type from
#281 which resulted in
the type being "AddConversionHostIdToMiqRequestTasks::Host" instead of
"Host".
If the current rabbitmq password contains special characters it
will fail a new preflight check in the setup playbook.

This is fixed for new installations by
ManageIQ/manageiq#18092 but because we
re-run the setup playbook when we upgrade the tower version, we
also need to correct existing ones.

https://bugzilla.redhat.com/show_bug.cgi?id=1638009
@agrare agrare reopened this Oct 25, 2018
@djberg96 djberg96 closed this Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.