Coder Social home page Coder Social logo

manageiq-schema's Introduction

ManageIQ::Schema

CI Maintainability Test Coverage

Chat

Build history for master branch

SQL Schema and migrations for ManageIQ.

Development

See the section on plugins in the ManageIQ Developer Setup

For quick local setup run bin/setup, which will clone the core ManageIQ repository under the spec directory and setup necessary config files. If you have already cloned it, you can run bin/update to bring the core ManageIQ code up to date.

Testing

Unlike other ManageIQ plugins, the schema plugin uses a dummy application in spec/dummy instead of the usual spec/manageiq. This ensure that schema migrations are not dependent on any models or files in ManageIQ core.

To run the tests:

  1. If necessary, copy spec/dummy/config/database.tmpl.yml to spec/dummy/config/database.yml and modify it to access your local database
  2. Run: bin/setup
    • Copies spec/dummy/config/database.tmpl.yml to spec/dummy/config/database.yml if it doesn't exist
    • Performs bundle update
    • Generates random database region number
    • Creates/resets dummy_test database
  3. Run: rspec spec/migrations/<spec_file> or rake (Run all migration tests)

License

The gem is available as open source under the terms of the Apache License 2.0.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

manageiq-schema's People

Contributors

agrare avatar bdunne avatar blomquisg avatar bzwei avatar carbonin avatar chessbyte avatar chrisarcand avatar d-m-u avatar fabiendupont avatar fryguy avatar gmcculloug avatar gtanzillo avatar h-kataria avatar himdel avatar hsong-rh avatar isimluk avatar jameswnl avatar jprause avatar jrafanie avatar kbrock avatar ladas avatar lfu avatar lpichler avatar mansam avatar martinpovolny avatar mkanoor avatar nicklamuro avatar skateman avatar yrudman avatar zakiva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

manageiq-schema's Issues

[V2V] Create conversion hosts for appropriately tagged vms

Prior to the existence of the conversion_hosts table, we were relying on a specific tag on the resource to identify it as a conversion host. Specifically, the /managed/v2v_transformation_host/true tag.

So, we should write a migration that looks for resources with that tag that aren't already in the conversion_hosts table, and create a basic conversion_host record for it, along with an associated authentication if the resource (or provider) has one.

Avoid using hardcoded number literals for ids in specs

In general we should avoid using hardcoded number literal for ids in specs, because it ignores the reality of regions. That is, if the database is created in a random region, then we are creating data from technically a different region. I'm not against hardcoding ids, as that is generally useful so we don't have to create extra unnecessary records, but when doing so we should have some helper method to get an id "in this region"

git grep "_\?id\s*=>\?\s*[0-9]" spec is a list of where we've done this.

Change rake tasks so that rake spec does everything

Unlike other repos, rake spec does not run spec:migrations but instead only the "other" specs. We should change the current spec to something like spec:common and then rake spec will do both. (The rake default would then just be calling rake spec)

remove CINDER storage object

Based on discussing with @himdel and @hstastna we found that support for Storage object with store_type = CINDER has been removed.

So we need to remove such objects from DB with migration.

I believe that query to determine what to remove is
Storage.where(:store_type => 'CINDER')
@himdel is it enough ?

Links

After discussion in ManageIQ/manageiq-ui-classic#3742

UI related issue: ManageIQ/manageiq-ui-classic#3743

Screenshot

(highlighted is object to remove for example)

Need to revert bd5ce03e due to GitHub API rate limiting

It turns out we ARE being rate limited, and master is failing because of it. I'm not sure how we are hitting the rate limit, but we will need to revert bd5ce03 . However, I don't like the prior way either, so we'll need to come up with something else.

Example error on travis:

$ bundle exec rake spec:setup
Dropped database 'dummy_test'
Created database 'dummy_test'
.rake aborted!
TypeError: no implicit conversion of String into Integer
lib/tasks_private/spec.rake:37:in `[]'
lib/tasks_private/spec.rake:37:in `block in released_migrations'
lib/tasks_private/spec.rake:36:in `each'
lib/tasks_private/spec.rake:36:in `map'
lib/tasks_private/spec.rake:36:in `released_migrations'
lib/tasks_private/spec.rake:26:in `write_released_migrations'
lib/tasks_private/spec.rake:9:in `block (2 levels) in <top (required)>'
/home/travis/build/ManageIQ/manageiq-schema/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in `load'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:27:in `run'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:360:in `exec'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:20:in `dispatch'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:10:in `start'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/exe/bundle:35:in `block in <top (required)>'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/exe/bundle:27:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.4.1/bin/bundle:23:in `load'
/home/travis/.rvm/gems/ruby-2.4.1/bin/bundle:23:in `<main>'
/home/travis/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => spec:setup => spec:setup_released_migrations
(See full trace by running task with --trace)

The command "bundle exec rake spec:setup" failed and exited with 1 during .

This occurs when the API response payload is:

{
  "message": "API rate limit exceeded for 1.2.3.4. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://developer.github.com/v3/#rate-limiting"
}

cc @carbonin

Seeing "already initialized constant" with respect to JSON

After each pass of the migrations specs (i.e. after the up and after the down), I see the following warning, but I can't figure out where it's coming from.

/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/version.rb:4: warning: already initialized constant JSON::VERSION
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/version.rb:4: warning: previous definition of VERSION was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/version.rb:5: warning: already initialized constant JSON::VERSION_ARRAY
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/version.rb:5: warning: previous definition of VERSION_ARRAY was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/version.rb:6: warning: already initialized constant JSON::VERSION_MAJOR
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/version.rb:6: warning: previous definition of VERSION_MAJOR was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/version.rb:7: warning: already initialized constant JSON::VERSION_MINOR
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/version.rb:7: warning: previous definition of VERSION_MINOR was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/version.rb:8: warning: already initialized constant JSON::VERSION_BUILD
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/version.rb:8: warning: previous definition of VERSION_BUILD was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/common.rb:100: warning: already initialized constant JSON::NaN
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/common.rb:100: warning: previous definition of NaN was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/common.rb:102: warning: already initialized constant JSON::Infinity
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/common.rb:102: warning: previous definition of Infinity was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/common.rb:104: warning: already initialized constant JSON::MinusInfinity
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/common.rb:104: warning: previous definition of MinusInfinity was here
/Users/jfrey/.rubies/ruby-2.4.1/lib/ruby/2.4.0/json/common.rb:129: warning: already initialized constant JSON::UnparserError
/Users/jfrey/.gem/ruby/2.4.1/gems/json-2.1.0/lib/json/common.rb:129: warning: previous definition of UnparserError was here

CVE-2024-28103 (Medium) detected in actionpack-6.1.7.7.gem - autoclosed

CVE-2024-28103 - Medium Severity Vulnerability

Vulnerable Library - actionpack-6.1.7.7.gem

Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.

Library home page: https://rubygems.org/gems/actionpack-6.1.7.7.gem

Path to dependency file: /Gemfile.lock

Path to vulnerable library: /home/wss-scanner/.gem/ruby/3.2.0/cache/actionpack-6.1.7.7.gem

Dependency Hierarchy:

  • rspec-rails-6.1.2.gem (Root Library)
    • โŒ actionpack-6.1.7.7.gem (Vulnerable Library)

Found in base branch: master

Vulnerability Details

Action Pack is a framework for handling and responding to web requests. Since 6.1.0, the application configurable Permissions-Policy is only served on responses with an HTML related Content-Type. This vulnerability is fixed in 6.1.7.8, 7.0.8.2, and 7.1.3.3.

Publish Date: 2024-06-04

URL: CVE-2024-28103

CVSS 3 Score Details (5.4)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-fwhr-88qx-h9g7

Release Date: 2024-06-04

Fix Resolution: actionpack - 6.1.7.8,7.0.8.4,7.1.3.4


Step up your Open Source Security Game with Mend here

Document use of external databases

using a database.yml configuration file does not change the database configuration, thus preventing the usage of any database that is not local (i.e. any database that is not using sockets but configured as localhost)

Custom tables break db:migrate

This seems to be caused by #504, cc @NickLaMuro

When the database contains tables not in the schema, db:migrate can now fail in various ways..


I copied metric_rollups_01 to xmetric_rollups_01 as a backup. That caused...

$ be rake db:migrate
** override_gem("manageiq-ui-classic", :path=>"/home/himdel/manageiq-ui-classic") at /home/himdel/manageiq/bundler.d/Gemfile.dev.rb:8
** ManageIQ master, codename: Kasparov
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/home/himdel/.rbenv/versions/2.6.6/bin/bundle:23:in `load'
/home/himdel/.rbenv/versions/2.6.6/bin/bundle:23:in `<main>'
Tasks: TOP => db:schema:dump
(See full trace by running task with --trace)

Specifically failing on..

** Execute db:schema:dump
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/home/himdel/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/bundler/gems/manageiq-schema-6e7d2e7b5c75/lib/manageiq/schema/schema_dumper.rb:100:in `determine_table_parent'
/home/himdel/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/bundler/gems/manageiq-schema-6e7d2e7b5c75/lib/manageiq/schema/schema_dumper.rb:91:in `track_miq_metric_table_inheritance'
/home/himdel/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/bundler/gems/manageiq-schema-6e7d2e7b5c75/lib/manageiq/schema/schema_dumper.rb:16:in `table'
/home/himdel/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/schema_dumper.rb:93:in `block in tables'
...
/home/himdel/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/bundler/gems/manageiq-schema-6e7d2e7b5c75/lib/manageiq/schema/schema_dumper.rb:7:in `tables'
...

(with table_name being xmetric_rollups_01).


Just adding a custom table with nothing in it...

 create table aaa (id serial);

db:migrate fails with..

NoMethodError: undefined method `comment' for nil:NilClass
/home/himdel/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/bundler/gems/manageiq-schema-6e7d2e7b5c75/lib/manageiq/schema/schema_dumper.rb:22:in `add_id_column_comment'
/home/himdel/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/bundler/gems/manageiq-schema-6e7d2e7b5c75/lib/manageiq/schema/schema_dumper.rb:15:in `table'

(Dropping the offending tables fixes the issue)

Fetching the released migrations pollutes the local repo

When the migrations lived in ManageIQ proper, fetching a different branch locally was ok, because it was the same repo. Now that the schema has been separated out, fetching the ManageIQ/manageiq code into the ManageIQ/manageiq-schema repo pollutes the repo with the remote branches and tags. Unfortunately those tags will collide, for example when we cut gaprindashvili-1 on both repos, then try to fetch, you will get duplicate tag names, and I have no idea what will happen. We need an alternative now.

cc @carbonin

Database migration fails with unknown migration version 5.1

Hi, I'm getting this error when trying to migrate the DB on my developer setup:

ArgumentError: Unknown migration version "5.1"; expected one of "4.2", "5.0"
/home/fhlavac/.rbenv/versions/2.5.5/bin/bundle:23:in `load'
/home/fhlavac/.rbenv/versions/2.5.5/bin/bundle:23:in `<main>'
ArgumentError: Unknown migration version "5.1"; expected one of "4.2", "5.0"
/home/fhlavac/.rbenv/versions/2.5.5/bin/bundle:23:in `load'
/home/fhlavac/.rbenv/versions/2.5.5/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate

@skateman says that there's something wrong with the migration version in some files and there!s some kind of rails 5.1 issue.

@miq-bot add_label bug
@miq-bot assign @carbonin

Unique index on security_groups_vms

There should be

add_index :security_groups_vms, [:security_group_id, :vm_id], :unique => true

but even cartridge is throwing exception, that means the real data will be probably corrupted too, so we will need some migration script along with this change, that will clean up the table


This issue was moved to this repository from ManageIQ/manageiq#3419, originally opened by @Ladas

Missing benchmark timing around 'Seeding :schema_migrations_ran table'

I just upgraded a database from ivanchuk to jansa and noticed that each migration took at least 10 seconds according to the production.log, but the screen logging of the migration time was less than 1 second for each.

I believe there is unaccounted time in the Seeding :schema_migrations_ran table step and possibly others and this unaccounted time might have some low hanging ๐Ÿ’ ๐Ÿ‡ to speed it up.

[----] I, [2020-04-27T10:31:03.356414 #60950:3fd4a4032e20]  INFO -- : Migrating to AddEmsIdToStorages (20190729165913)
[----] I, [2020-04-27T10:31:14.093146 #60950:3fd4a4032e20]  INFO -- : Migrating to SplitStoragesPerEms (20190729170013)
[----] I, [2020-04-27T10:31:25.213419 #60950:3fd4a4032e20]  INFO -- : Migrating to AddInitiatorTypeToMiqRequests (20190731175747)
[----] I, [2020-04-27T10:31:37.329564 #60950:3fd4a4032e20]  INFO -- : Migrating to AddEmsRefToDisk (20190801025013)
[----] I, [2020-04-27T10:31:49.562474 #60950:3fd4a4032e20]  INFO -- : Migrating to AddEmsRefToGuestDevice (20190801025156)
[----] I, [2020-04-27T10:32:01.290981 #60950:3fd4a4032e20]  INFO -- : Migrating to RenameServiceDisplayToVisible (20190827141149)
[----] I, [2020-04-27T10:32:12.112341 #60950:3fd4a4032e20]  INFO -- : Migrating to AddSpeedToGuestDevices (20190830133434)
[----] I, [2020-04-27T10:32:24.393485 #60950:3fd4a4032e20]  INFO -- : Migrating to AddApplicationBuildTime (20190916132550)
[----] I, [2020-04-27T10:32:36.607199 #60950:3fd4a4032e20]  INFO -- : Migrating to AddApplicationUrl (20190916150002)
[----] I, [2020-04-27T10:32:46.943496 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveRailsServerFromSettings (20190918133037)
[----] I, [2020-04-27T10:32:58.401292 #60950:3fd4a4032e20]  INFO -- : Migrating to AddResourceGroupIdToCloudNetwork (20190930054405)
[----] I, [2020-04-27T10:33:11.610149 #60950:3fd4a4032e20]  INFO -- : Migrating to AddResourceGroupIdToNetworkPort (20190930054416)
[----] I, [2020-04-27T10:33:22.082191 #60950:3fd4a4032e20]  INFO -- : Migrating to AddResourceGroupIdToSecurityGroup (20190930054424)
[----] I, [2020-04-27T10:33:34.833832 #60950:3fd4a4032e20]  INFO -- : Migrating to RenameChargebackRateDetailCurrencyToCurrency (20191001174700)
[----] I, [2020-04-27T10:33:47.163154 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveQuadiconSettings (20191002103406)
[----] I, [2020-04-27T10:33:59.854438 #60950:3fd4a4032e20]  INFO -- : Migrating to AddGeneralIndexes (20191017211747)
[----] I, [2020-04-27T10:34:12.042723 #60950:3fd4a4032e20]  INFO -- : Migrating to UpdateOpenstackHostsUidEms (20191023180130)
[----] I, [2020-04-27T10:34:23.257553 #60950:3fd4a4032e20]  INFO -- : Migrating to AddEmsRefType (20191023180149)
[----] I, [2020-04-27T10:34:34.094119 #60950:3fd4a4032e20]  INFO -- : Migrating to SubclassEmsCluster (20191023180308)
[----] I, [2020-04-27T10:34:45.813718 #60950:3fd4a4032e20]  INFO -- : Migrating to MigrateEmsRefObjToEmsRefType (20191023180330)
[----] I, [2020-04-27T10:35:02.471067 #60950:3fd4a4032e20]  INFO -- : Migrating to CopyOwnerIdToGroupIdForDashboards (20191112132759)
[----] I, [2020-04-27T10:35:15.533692 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveEmsRefObj (20191113200451)
[----] I, [2020-04-27T10:35:28.842003 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveMiqwidgetRss (20191114131917)
[----] I, [2020-04-27T10:35:42.470636 #60950:3fd4a4032e20]  INFO -- : Migrating to CreateMiqWorkerTypes (20191115164358)
[----] I, [2020-04-27T10:35:54.856436 #60950:3fd4a4032e20]  INFO -- : Migrating to AddTypeToResourcePools (20191118161213)
[----] I, [2020-04-27T10:36:09.697624 #60950:3fd4a4032e20]  INFO -- : Migrating to SubclassResourcePools (20191118161319)
[----] I, [2020-04-27T10:36:23.242021 #60950:3fd4a4032e20]  INFO -- : Migrating to SubclassEmsFolders (20191118191722)
[----] I, [2020-04-27T10:36:35.204080 #60950:3fd4a4032e20]  INFO -- : Migrating to ReplaceServerCapabilitiesWithVixDiskLib (20191122203218)
[----] I, [2020-04-27T10:36:46.653117 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveMiddlewareColumnsInEventStreams (20191126204129)
[----] I, [2020-04-27T10:36:58.561659 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveMiddlewareTables (20191126204211)
[----] I, [2020-04-27T10:37:10.864266 #60950:3fd4a4032e20]  INFO -- : Migrating to AddRestartNeededToVms (20191128111630)
[----] I, [2020-04-27T10:37:22.814334 #60950:3fd4a4032e20]  INFO -- : Migrating to DropEmsRefFromHostStorage (20191209162705)
[----] I, [2020-04-27T10:37:33.423428 #60950:3fd4a4032e20]  INFO -- : Migrating to AddMaintenanceModeToStorages (20191210135022)
[----] I, [2020-04-27T10:37:44.637845 #60950:3fd4a4032e20]  INFO -- : Migrating to AddTypeToStorages (20191210162908)
[----] I, [2020-04-27T10:37:56.224731 #60950:3fd4a4032e20]  INFO -- : Migrating to SubclassStorages (20191210163518)
[----] I, [2020-04-27T10:38:07.345826 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveMiqVimBrokerWorkerRows (20200103191549)
[----] I, [2020-04-27T10:38:20.509001 #60950:3fd4a4032e20]  INFO -- : Migrating to AddDescStringToMiqGroup (20200109190758)
[----] I, [2020-04-27T10:38:31.418964 #60950:3fd4a4032e20]  INFO -- : Migrating to UpgradeDropboxToSupportTool (20200122215829)
[----] I, [2020-04-27T10:38:47.103022 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveVimTypesFromEmsEvents (20200126203714)
[----] I, [2020-04-27T10:39:00.384914 #60950:3fd4a4032e20]  INFO -- : Migrating to AddTypeColumnToServiceOrder (20200128122000)
[----] I, [2020-04-27T10:39:10.811633 #60950:3fd4a4032e20]  INFO -- : Migrating to DropRedHatDomain (20200211181329)
[----] I, [2020-04-27T10:39:22.739668 #60950:3fd4a4032e20]  INFO -- : Migrating to RemoveOvirtSdk4FromEventStream (20200212171537)
[----] I, [2020-04-27T10:39:36.593898 #60950:3fd4a4032e20]  INFO -- : Migrating to AddThinAndFormatToDisk (20200219125312)
[----] I, [2020-04-27T10:39:49.767989 #60950:3fd4a4032e20]  INFO -- : Migrating to AddAncestryToMiqAeNamespace (20200221200855)
[----] I, [2020-04-27T10:40:03.721574 #60950:3fd4a4032e20]  INFO -- : Migrating to DropRegionMigrationsRan (20200227195911)
10:30:53 ~/Code/manageiq (jansa) (2.5.7) + RAILS_ENV=production bin/rake db:migrate
== 20190729165913 AddEmsIdToStorages: migrating ===============================
-- add_reference(:storages, :ems, {:type=>:bigint, :index=>true, :references=>:ext_management_system})
   -> 0.0082s
== 20190729165913 AddEmsIdToStorages: migrated (0.0083s) ======================

Seeding :schema_migrations_ran table...
== 20190729170013 SplitStoragesPerEms: migrating ==============================
== 20190729170013 SplitStoragesPerEms: migrated (0.0246s) =====================

Seeding :schema_migrations_ran table...
== 20190731175747 AddInitiatorTypeToMiqRequests: migrating ====================
-- add_column(:miq_requests, :initiated_by, :string)
   -> 0.0018s
== 20190731175747 AddInitiatorTypeToMiqRequests: migrated (0.0018s) ===========

Seeding :schema_migrations_ran table...
== 20190801025013 AddEmsRefToDisk: migrating ==================================
-- add_column(:disks, :ems_ref, :string)
   -> 0.0009s
== 20190801025013 AddEmsRefToDisk: migrated (0.0009s) =========================

Seeding :schema_migrations_ran table...
== 20190801025156 AddEmsRefToGuestDevice: migrating ===========================
-- add_column(:guest_devices, :ems_ref, :string)
   -> 0.0009s
== 20190801025156 AddEmsRefToGuestDevice: migrated (0.0010s) ==================

Seeding :schema_migrations_ran table...
== 20190827141149 RenameServiceDisplayToVisible: migrating ====================
-- rename_column(:services, :display, :visible)
   -> 0.0102s
== 20190827141149 RenameServiceDisplayToVisible: migrated (0.0103s) ===========

Seeding :schema_migrations_ran table...
== 20190830133434 AddSpeedToGuestDevices: migrating ===========================
-- add_column(:guest_devices, :speed, :bigint)
   -> 0.0010s
== 20190830133434 AddSpeedToGuestDevices: migrated (0.0011s) ==================

Seeding :schema_migrations_ran table...
== 20190916132550 AddApplicationBuildTime: migrating ==========================
-- add_column(:guest_applications, :build_time, :timestamp)
   -> 0.0008s
== 20190916132550 AddApplicationBuildTime: migrated (0.0009s) =================

Seeding :schema_migrations_ran table...
== 20190916150002 AddApplicationUrl: migrating ================================
-- add_column(:guest_applications, :url, :string)
   -> 0.0009s
== 20190916150002 AddApplicationUrl: migrated (0.0009s) =======================

Seeding :schema_migrations_ran table...
== 20190918133037 RemoveRailsServerFromSettings: migrating ====================
-- Remove rails_server settings
   -> 0.0072s
   -> 0 rows
== 20190918133037 RemoveRailsServerFromSettings: migrated (0.0074s) ===========

Seeding :schema_migrations_ran table...
== 20190930054405 AddResourceGroupIdToCloudNetwork: migrating =================
-- add_reference(:cloud_networks, :resource_group, {:type=>:bigint, :index=>true})
   -> 0.0043s
== 20190930054405 AddResourceGroupIdToCloudNetwork: migrated (0.0044s) ========

Seeding :schema_migrations_ran table...
== 20190930054416 AddResourceGroupIdToNetworkPort: migrating ==================
-- add_reference(:network_ports, :resource_group, {:type=>:bigint, :index=>true})
   -> 0.0047s
== 20190930054416 AddResourceGroupIdToNetworkPort: migrated (0.0047s) =========

Seeding :schema_migrations_ran table...
== 20190930054424 AddResourceGroupIdToSecurityGroup: migrating ================
-- add_reference(:security_groups, :resource_group, {:type=>:bigint, :index=>true})
   -> 0.0049s
== 20190930054424 AddResourceGroupIdToSecurityGroup: migrated (0.0050s) =======

Seeding :schema_migrations_ran table...
== 20191001174700 RenameChargebackRateDetailCurrencyToCurrency: migrating =====
-- rename_table(:chargeback_rate_detail_currencies, :currencies)
   -> 0.0129s
== 20191001174700 RenameChargebackRateDetailCurrencyToCurrency: migrated (0.0129s)

Seeding :schema_migrations_ran table...
== 20191002103406 RemoveQuadiconSettings: migrating ===========================
-- Dropping quadicon settings keys from user settings
   -> 0.0057s
== 20191002103406 RemoveQuadiconSettings: migrated (0.0058s) ==================

Seeding :schema_migrations_ran table...
== 20191017211747 AddGeneralIndexes: migrating ================================
-- add_index(:miq_schedules, :updated_at)
   -> 0.0035s
-- add_index(:blacklisted_events, [:ems_id, :enabled])
   -> 0.0031s
-- add_index(:key_pairs_vms, :vm_id)
   -> 0.0030s
-- add_index(:miq_requests, [:tenant_id, :approval_state])
   -> 0.0028s
-- add_index(:miq_roles_features, :miq_user_role_id)
   -> 0.0032s
-- add_index(:miq_queue, [:state, :handler_type, :handler_id])
   -> 0.0089s
-- add_index(:vms, :tenant_id)
   -> 0.0054s
-- add_index(:entitlements, :miq_group_id)
   -> 0.0034s
-- add_index(:endpoints, [:resource_id, :resource_type])
   -> 0.0032s
== 20191017211747 AddGeneralIndexes: migrated (0.0372s) =======================

Seeding :schema_migrations_ran table...
== 20191023180130 UpdateOpenstackHostsUidEms: migrating =======================
== 20191023180130 UpdateOpenstackHostsUidEms: migrated (0.0255s) ==============

Seeding :schema_migrations_ran table...
== 20191023180149 AddEmsRefType: migrating ====================================
-- add_column(:ems_clusters, :ems_ref_type, :string)
   -> 0.0009s
-- add_column(:ems_folders, :ems_ref_type, :string)
   -> 0.0006s
-- add_column(:hosts, :ems_ref_type, :string)
   -> 0.0005s
-- add_column(:resource_pools, :ems_ref_type, :string)
   -> 0.0004s
-- add_column(:snapshots, :ems_ref_type, :string)
   -> 0.0004s
-- add_column(:storages, :ems_ref_type, :string)
   -> 0.0004s
-- add_column(:vms, :ems_ref_type, :string)
   -> 0.0004s
== 20191023180149 AddEmsRefType: migrated (0.0040s) ===========================

Seeding :schema_migrations_ran table...
== 20191023180308 SubclassEmsCluster: migrating ===============================
== 20191023180308 SubclassEmsCluster: migrated (0.0789s) ======================

Seeding :schema_migrations_ran table...
== 20191023180330 MigrateEmsRefObjToEmsRefType: migrating =====================
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::EmsCluster
   -> 0.0242s
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::EmsFolder
   -> 0.0222s
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::Host
   -> 0.0286s
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::ResourcePool
   -> 0.0263s
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::Snapshot
   -> 0.0274s
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::Storage
   -> 0.0250s
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::VmOrTemplate
   -> 0.0426s
== 20191023180330 MigrateEmsRefObjToEmsRefType: migrated (0.1966s) ============

Seeding :schema_migrations_ran table...
== 20191112132759 CopyOwnerIdToGroupIdForDashboards: migrating ================
-- Copying owner_id to group_id in miq_sets table for each dashboard assigned to group
   -> 0.0310s
   -> 1 rows
== 20191112132759 CopyOwnerIdToGroupIdForDashboards: migrated (0.0311s) =======

Seeding :schema_migrations_ran table...
== 20191113200451 RemoveEmsRefObj: migrating ==================================
-- remove_column(:ems_clusters, :ems_ref_obj, :string)
   -> 0.0041s
-- remove_column(:ems_folders, :ems_ref_obj, :string)
   -> 0.0004s
-- remove_column(:hosts, :ems_ref_obj, :string)
   -> 0.0007s
-- remove_column(:resource_pools, :ems_ref_obj, :string)
   -> 0.0009s
-- remove_column(:snapshots, :ems_ref_obj, :string)
   -> 0.0003s
-- remove_column(:storages, :ems_ref_obj, :string)
   -> 0.0007s
-- remove_column(:vms, :ems_ref_obj, :string)
   -> 0.0004s
== 20191113200451 RemoveEmsRefObj: migrated (0.0079s) =========================

Seeding :schema_migrations_ran table...
== 20191114131917 RemoveMiqwidgetRss: migrating ===============================
== 20191114131917 RemoveMiqwidgetRss: migrated (0.0079s) ======================

Seeding :schema_migrations_ran table...
== 20191115164358 CreateMiqWorkerTypes: migrating =============================
-- create_table(:miq_worker_types, {:id=>:bigserial})
   -> 0.0140s
== 20191115164358 CreateMiqWorkerTypes: migrated (0.0144s) ====================

Seeding :schema_migrations_ran table...
== 20191118161213 AddTypeToResourcePools: migrating ===========================
-- add_column(:resource_pools, :type, :string)
   -> 0.0009s
== 20191118161213 AddTypeToResourcePools: migrated (0.0010s) ==================

Seeding :schema_migrations_ran table...
== 20191118161319 SubclassResourcePools: migrating ============================
== 20191118161319 SubclassResourcePools: migrated (0.0576s) ===================

Seeding :schema_migrations_ran table...
== 20191118191722 SubclassEmsFolders: migrating ===============================
== 20191118191722 SubclassEmsFolders: migrated (0.0741s) ======================

Seeding :schema_migrations_ran table...
== 20191122203218 ReplaceServerCapabilitiesWithVixDiskLib: migrating ==========
-- add_column(:miq_servers, :has_vix_disk_lib, :boolean)
   -> 0.0010s
-- remove_column(:miq_servers, :capabilities)
   -> 0.0433s
== 20191122203218 ReplaceServerCapabilitiesWithVixDiskLib: migrated (0.0517s) =

Seeding :schema_migrations_ran table...
== 20191126204129 RemoveMiddlewareColumnsInEventStreams: migrating ============
-- remove_column(:event_streams, :middleware_server_id)
   -> 0.0007s
-- remove_column(:event_streams, :middleware_server_name)
   -> 0.0006s
-- remove_column(:event_streams, :middleware_deployment_id)
   -> 0.0004s
-- remove_column(:event_streams, :middleware_deployment_name)
   -> 0.0004s
-- remove_column(:event_streams, :middleware_domain_id)
   -> 0.0003s
-- remove_column(:event_streams, :middleware_domain_name)
   -> 0.0003s
== 20191126204129 RemoveMiddlewareColumnsInEventStreams: migrated (0.0031s) ===

Seeding :schema_migrations_ran table...
== 20191126204211 RemoveMiddlewareTables: migrating ===========================
-- drop_table(:middleware_datasources, {})
   -> 0.0029s
-- drop_table(:middleware_deployments, {})
   -> 0.0012s
-- drop_table(:middleware_diagnostic_reports, {})
   -> 0.0011s
-- drop_table(:middleware_domains, {})
   -> 0.0026s
-- drop_table(:middleware_messagings, {})
   -> 0.0016s
-- drop_table(:middleware_server_groups, {})
   -> 0.0018s
-- drop_table(:middleware_servers, {})
   -> 0.0017s
== 20191126204211 RemoveMiddlewareTables: migrated (0.0748s) ==================

Seeding :schema_migrations_ran table...
== 20191128111630 AddRestartNeededToVms: migrating ============================
-- add_column(:vms, :restart_needed, :boolean)
   -> 0.0011s
== 20191128111630 AddRestartNeededToVms: migrated (0.0011s) ===================

Seeding :schema_migrations_ran table...
== 20191209162705 DropEmsRefFromHostStorage: migrating ========================
-- remove_column(:host_storages, :ems_ref, :string)
   -> 0.0006s
== 20191209162705 DropEmsRefFromHostStorage: migrated (0.0006s) ===============

Seeding :schema_migrations_ran table...
== 20191210135022 AddMaintenanceModeToStorages: migrating =====================
-- add_column(:storages, :maintenance, :boolean)
   -> 0.0009s
-- add_column(:storages, :maintenance_reason, :string)
   -> 0.0007s
== 20191210135022 AddMaintenanceModeToStorages: migrated (0.0017s) ============

Seeding :schema_migrations_ran table...
== 20191210162908 AddTypeToStorages: migrating ================================
-- add_column(:storages, :type, :string)
   -> 0.0009s
== 20191210162908 AddTypeToStorages: migrated (0.0010s) =======================

Seeding :schema_migrations_ran table...
== 20191210163518 SubclassStorages: migrating =================================
== 20191210163518 SubclassStorages: migrated (0.0646s) ========================

Seeding :schema_migrations_ran table...
== 20200103191549 RemoveMiqVimBrokerWorkerRows: migrating =====================
== 20200103191549 RemoveMiqVimBrokerWorkerRows: migrated (0.0078s) ============

Seeding :schema_migrations_ran table...
== 20200109190758 AddDescStringToMiqGroup: migrating ==========================
-- add_column(:miq_groups, :detailed_description, :string)
   -> 0.0011s
== 20200109190758 AddDescStringToMiqGroup: migrated (0.0012s) =================

Seeding :schema_migrations_ran table...
== 20200122215829 UpgradeDropboxToSupportTool: migrating ======================
== 20200122215829 UpgradeDropboxToSupportTool: migrated (0.0233s) =============

Seeding :schema_migrations_ran table...
== 20200126203714 RemoveVimTypesFromEmsEvents: migrating ======================
-- Removing Vim Types from EmsEvents
   -> Processing 0 rows
   -> 0.0336s
== 20200126203714 RemoveVimTypesFromEmsEvents: migrated (0.0337s) =============

Seeding :schema_migrations_ran table...
== 20200128122000 AddTypeColumnToServiceOrder: migrating ======================
-- add_column(:service_orders, :type, :string)
   -> 0.0009s
-- Set service_orders type
   -> 0.0270s
   -> 0 rows
== 20200128122000 AddTypeColumnToServiceOrder: migrated (0.0280s) =============

Seeding :schema_migrations_ran table...
== 20200211181329 DropRedHatDomain: migrating =================================
-- Remove RedHat domain
   -> 0.2316s
== 20200211181329 DropRedHatDomain: migrated (0.2316s) ========================

Seeding :schema_migrations_ran table...
== 20200212171537 RemoveOvirtSdk4FromEventStream: migrating ===================
-- Removing OvirtSDK4 types from EmsEvents
   -> Processing 0 rows
   -> 0.0237s
== 20200212171537 RemoveOvirtSdk4FromEventStream: migrated (0.0238s) ==========

Seeding :schema_migrations_ran table...
== 20200219125312 AddThinAndFormatToDisk: migrating ===========================
-- add_column(:disks, :thin, :boolean)
   -> 0.0011s
-- add_column(:disks, :format, :string)
   -> 0.0005s
== 20200219125312 AddThinAndFormatToDisk: migrated (0.0017s) ==================

Seeding :schema_migrations_ran table...
== 20200221200855 AddAncestryToMiqAeNamespace: migrating ======================
-- add_column(:miq_ae_namespaces, :ancestry, :string)
   -> 0.0009s
-- add_index(:miq_ae_namespaces, :ancestry)
   -> 0.0249s
-- Converting MiqAeNamespaces from parent_id to ancestry
   -> 0.2172s
-- remove_index(:miq_ae_namespaces, {:column=>:parent_id})
   -> 0.0207s
-- remove_column(:miq_ae_namespaces, :parent_id)
   -> 0.0006s
== 20200221200855 AddAncestryToMiqAeNamespace: migrated (0.2646s) =============

Seeding :schema_migrations_ran table...
== 20200227195911 DropRegionMigrationsRan: migrating ==========================
-- remove_column(:miq_regions, :migrations_ran)
   -> 0.0008s
== 20200227195911 DropRegionMigrationsRan: migrated (0.0009s) =================

Seeding :schema_migrations_ran table...
10:40:25 ~/Code/manageiq (jansa) (2.5.7)

Note, it took 10 minutes to run a migration locally from ivanchuk to jansa on a small database and none of the steps claimed to take more than 1 second.

db:seed tries to touch a non-existent arbitration_settings table

Running bin/setup from a rather old version of the database fails for me. It fails on running bundle exec rake db:seed with the following error.

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "arbitration_settings" does not exist
LINE 8:                WHERE a.attrelid = '"arbitration_settings"'::...
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
             (SELECT c.collname FROM pg_collation c, pg_type t
               WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation),
                     col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"arbitration_settings"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

I see that the arbitration_settings table has been dropped in 20170418141731. So that might be the cause. Maybe the model still exists and is used by some migration?

[RFE] Speed up `rake test:vmdb:setup`

Migrations take a while to run (see benchmarks), and probably could be collapsed to save time at this point.

We have 7ish years of migrations built up that have to run on every build that a test:vmdb:setup or evm:db:reset task is run. This takes a lot of time for devs and build time on CI with no real value in doing that beyond them having them run semi-often in this repo.

Benchmarks

Note: Times below don't include db:seed, which could also be improved, but not the focus this RFE.

rake db:migrate (before)

$ time rake test:vmdb:setup

real    1m36.398s
user    1m6.130s
sys     0m4.525s

rake db:shema:load (after)

$ time rake evm:db:destroy db:schema:load

...

real    0m14.210s
user    0m6.666s
sys     0m3.044

(Note: metrics_rollups_* style tables are commented out for these to properly run, but the performance impact of those extra would be minimal, as most of the 14sec above is booting the Rails env)

Proposals

One of the following probably could be done to solve this:

  • Fix rake db:schema:load (in other words, fix the db/schema.rb file) so it can be run (hard)
  • Do another _collapse_initial_migration.rb that is up to date (hard?)

The advantage to the first is that we can execute the "faster" code pretty much any time after a bin/update has been done. So we can get to a state of re:seeding much quicker, not just after a "collapse" has happened. That said, updating how the schema is generated to support this would be probably a significant bit of monkey patching to accomplish, and not a quick turn around.

That said, the "collapse" migration is basically a schema, so figuring out how collapse would probably lead to how we could generate the schema. It also might be worth "archiving" migrations after every release so that migrations are "versioned" to some degree.

Testing is also something we probably would want to consider with either approach. The advantage again with the first is that we don't have to be concerned using it in production, since it is only a dev speed up. Making sure we get the collapse correct would probably require some testing interface that runs the full collection of migrations from the beginning, and then tests them from a snapshot onward (if something like this doesn't already exist).

Links

Interrupting migration during 20150806211453 leaves DB un-migratable

db/migrate/20150806211453_rename_ems_event_table_to_event_stream.rb uses disable_ddl_transaction! for re-entrancy, but it does both data and schema making it non-reentrant. This is really bad because if someone interrupts the migration during this PR, their database will be in an un-migratable state, because the rename_column will get run, not rolled back, and then is not runnable again.

The proper fix is to split this migration into 3... pre schema, then data, then post schema. However, we have to deal with any database that have already migrated past this point.

cc @lfu @gtanzillo

Fix coverage

The default rake task actually runs multiple rake tasks under the covers, and so we need to change it to use simplecov, but merge the results, then send those merged results to codeclimate.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

bundler
Gemfile
github-actions
.github/workflows/ci.yaml
  • actions/checkout v4
  • ruby/setup-ruby v1
  • paambaati/codeclimate-action v8
  • manageiq/postgresql 13
npm
spec/dummy/package.json
  • @rails/ujs ^6.0.0
  • turbolinks ^5.2.0
  • @rails/activestorage ^6.0.0
  • @rails/actioncable ^6.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Add unique index to tags and/or classifications table

Label->tag mapping creates tag "entries" on demand during inventory refresh.
This has to be done atomically, as tags don't have an ems_id, they're global.
Without a unique index it's slow (the best solution I had was DB locking on the parent category row).

Migration has a too long of name

While trying to build a manageiq-schema.gem I got the following error:

ERROR:  While executing gem ... (Gem::Package::TooLongFileName)
    File "db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb" has a too long name (should be 100 or less)

I think I remember @Fryguy mentioning something about this. Was there a workaround?

Missing migrations for hawkular removal

Hawkular was dropped in 2018,
yet, I'm still getting...

[----] E, [2019-10-03T12:53:18.973782 #18727:2b1f12158f18] ERROR -- : [ActiveRecord::SubclassNotFound]: The single-table inheritance mechanism failed to locate the subclass: 'ManageIQ::Providers::Hawkular::MiddlewareManager::EventCatcher'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite MiqWorker.inheritance_column to use another column for that information. Method:[block (2 levels) in <class:LogProxy>]

Seems like we're missing migrations to remove the no longer supported class instances from our db.

Related to:

Update collapsed initial migration

With the release of Jansa there are many appliance-level changes which makes it effectively a major upgrade. What this means is users will be forced to upgrade first to ivanchuk latest before continuing to upgrade to Jansa. As such, we should take advantage of this to collapse the initial migration to improve migration times. If we don't do it at this Jansa inflection point, it will be more complicated to do it later.

cc @chessbyte

Displaying notifications causes ActiveRecord::Attribute error

We just upgraded rails and the ActiveRecord::Attribute model moved over to ActiveModel::Attribute.

We are storing some of these records in the database and this is causing issues.

FATAL -- : Error caught: [ArgumentError] undefined class/module ActiveRecord::Attribute::

app/models/notification.rb:101:in `text_bindings_dynamic'
app/models/notification.rb:84:in `text_bindings'
app/models/notification.rb:41:in `to_h'
app/models/notification_recipient.rb:10:in `details'

Notification#options for the field contains:

 :subject: !ruby/object:ManageIQ::Providers::Openstack::CloudManager::CloudVolume
   raw_attributes:
     ems_id: 5
     cloud_tenant_id: 2
     ems_ref: 2b0993c0-d1fe-4e08-b65d-9cbec9047cf1
     id: 102
     type: ManageIQ::Providers::Openstack::CloudManager::CloudVolume
     size: 10737418240
     availability_zone_id: 1
     cloud_volume_snapshot_id:
     name: voltwo
     status: available
     description:
     volume_type:
     bootable: false
     creation_time: '2017-11-08 02:33:11'
     iops:
     encrypted:
     href_slug:
     region_number:
     region_description:
   attributes: !ruby/object:ActiveRecord::AttributeSet
     attributes: !ruby/object:ActiveRecord::LazyAttributeHash
       delegate_hash:
         ems_id: !ruby/object:ActiveRecord::Attribute::FromDatabase
           name: ems_id
           value_before_type_cast: 5
           type: &1 !ruby/object:ActiveModel::Type::Integer
             precision:

Our previous fix was: #390

We need to create a similar schema migration to remove or fix these records

Add a spec that verifies that stub models have inheritance check

I'm not sure how, but it might help data migration authors if the stub models they create were verified as to whether or not they require the

self.inheritance_column = :_type_disabled # disable STI

We might be able to do it by creating a separate test as part of

context "##{direction}", :migrations => direction do
before(:all) do
prepare_migrate
end
around do |example|
Rails.logger.debug("============================================================")
clearing_caches(&example)
end
it("with empty tables") { migrate }
instance_eval(&block)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.