For reasons that I don’t want to go into unless I must, I want to only
run file 2 on my production database (file 1 contains a bunch of table
creation stuff for already existing tables).
I figured if I created a schema_info table and set the version in it to
1, then I could just run rake db:migrate RAILS_ENV=production and just
file 2 would get run.
However, it keeps trying to run file1 and fails because as I said, those
things already exist. Basically, it is ignoring or not seeing the
schema_info version. I am pretty sure that it should be able to read
the version from that table.
So, I am led to believe that the first time that you run rake
db:migrate, it must be looking for something in addition to/instead of
the version in the schema_info table to figure out that it wants to run
starting with the first migration file.
I’ve verified that it is looking only at schema_info.
There must be something wrong with my production DB setup so that
schema_info can’t be seen.
When rake runs for a given environment, won’t it connect to the database
as the user specified in database.yml for the environment name specified
in RAILS_ENV?
I’ve verified that it is looking only at schema_info.
There must be something wrong with my production DB setup so that
schema_info can’t be seen.
When rake runs for a given environment, won’t it connect to the database
as the user specified in database.yml for the environment name specified
in RAILS_ENV?
try connecting to the database as that user from the command line client
Craig
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.