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

1190 restructure migrations #1195

Merged
merged 10 commits into from
Feb 23, 2015
Merged

1190 restructure migrations #1195

merged 10 commits into from
Feb 23, 2015

Conversation

eugenk
Copy link
Member

@eugenk eugenk commented Feb 11, 2015

This shall fix #1190.

  • Used squasher to squash the migrations prior to the last Ontohub release into one big schema.
  • Adds data_migrate to separate schema migrations from data migrations. The important data like ontology file extensions and file extension to mime type mappings are still in the schema migrations because we always want to migrate them instantly and they don't depend on other Ontohub code.

As for this pull request, the data migrations can be executed with rake data:migrate. This is a synchronous job. It can be executed asynchronously in two ways:

  • in an ssh connection with nohup rake data:migrate &. Then the job continues its work even if the ssh connection is closed. Its output is written into a file called nohup.out.
  • by rake data:migrate:async which creates a Sidekiq job that runs rake data:migrate. Interestingly, on my machine, the job is not added to the default queue, but to the queue with the empty name and stay "Enqueued". I can't explain why this happens. Your ideas are welcome :)

For future coding: Other than schema migrations, data migrations are supposed to be changed whenever the code they depend on changes.

`20140915123503_move_to_has_and_belongs_to_many_for_ontologies_tasks`
has been split into two files:
`20140915123503_move_to_has_and_belongs_to_many_for_ontologies_tasks`,
`20140915123504_move_to_has_and_belongs_to_many_for_ontologies_tasks_end`
because its data migration needs to be executed between two schema
migrations.
@@ -0,0 +1,871 @@
class InitSchema < ActiveRecord::Migration

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/ClassLength: Class definition is too long. [732/100]

@eugenk
Copy link
Member Author

eugenk commented Feb 11, 2015

Sorry Hound, I ignore your comments on the 20140615175553_init_schema.rb because that file is mostly generated.

@eugenk
Copy link
Member Author

eugenk commented Feb 16, 2015

test this please

raise 'Can not revert initial migration'
end

def up

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assignment Branch Condition size for up is too high. [576/15]

@0robustus1
Copy link
Contributor

👍

eugenk added a commit that referenced this pull request Feb 23, 2015
@eugenk eugenk merged commit 3e4a923 into staging Feb 23, 2015
@eugenk eugenk deleted the 1190-restructure_migrations branch February 23, 2015 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix migrations
3 participants