I think is better not to have migrations dependent on models. It breaks when models changes. I prefer to define local minimal models to migrate the data, e.g.
```ruby
class RepositoryAddContentView < ActiveRecord::Migration
  class Organization < ActiveRecord::Base; end
  class KTEnvironment < ActiveRecord::Base
    belongs_to :organization
    has_one :default_content_view
  end
  # ...
```
this is probably wrong and incomplete but I hope it explains what i mean.