Is there a way to run migrations just on the development database.
I use Heroku Connect where I sync certain tables in Postgres with certain tables in Salesforce.
Presently I did some hack where I made some migrations that mirror tables in Postgres that I am syncing with Salesforce.
Then I remove the migration files (put them in a separate folder), before I push to heroku. This needs to be done because the migrations files will mess with how heroku connect works. Just for context. The models look something like this.
class MyModel < ApplicationRecord
self.table_name = 'salesforce.someTable__c' unless Rails.env.development?
end
So cannot really do migrations for my_models tables in db.
Problem is any time I have to change the nature of the syncing, I need to bring those files back in, roll back the db, update those original migration files, migrate the database, then remove those migration files.
Not really the best solution.
So back to the question. Is there a way to just run migrations on development, such that when I run migrations on production it will skip those migrations that are only for development. Something like:
if Rails.env.development?
...
else
...
end
or
if Rails.env.production?
...
else
...
end