Why would, in an upgrade from 3.0.1 to 3.0.3, a rake db:migrate run
this:
SELECT "schema_migrations"."version" FROM "schema_migrations"
vs this ?
SELECT `schema_migrations`.`version` FROM `schema_migrations`
__ rake db:migrate output __
rake aborted!
Mysql::Error: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near '."version" FROM "schema_migrations"' at line 1: SELECT
"schema_migrations"."version" FROM "schema_migrations"
Mysql::Error: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near '."version" FROM "schema_migrations"' at line 1: SELECT
"schema_migrations"."version" FROM "schema_migrations"
namespace :test do
desc 'reset test db'
task :reset => :environment do
rails_env = Rails.env
Rails.env = 'test'
if ActiveRecord::Migrator.new(:up, 'db/
migrate').pending_migrations.size > 0 or ENV['FORCE']
puts "Resetting test database"
Rake::Task["db:migrate:reset"].invoke
end
Rails.env = rails_env
end
end
and it's this rake job which fails.
running just RACK_ENV=test db:migrate:reset on it's own is successful
however.
so it would seem it's just this task on production which fails.
So I solved it by doing a RACK_ENV=test before running my task. I
suspect a bug since this probably shouldn't have been required and
luckily all my related tasks here were to do with test, but they may
not have been.
So I solved it by doing a RACK_ENV=test before running my task. I
suspect a bug since this probably shouldn't have been required and
luckily all my related tasks here were to do with test, but they may
not have been.