[rspec-users] Spec migrations?
harm.aarts at innovationfactory.nl
Fri Apr 25 08:57:14 EDT 2008
I am in the process of writing on an app with is already running. I
need to create a couple of structural database changes for which I use
migrations. However I want to be absolutely sure I do not destroy any
existing data. So RSpec is the way to go! Or so I thought.
1. dropped the test database.
2. create the database.
3. migrate to the version just before the critical migration
4. insert some stuff in the database
5. run the critical migration
6. see if the result is as I expected
But I receive the following error:
Mysql::Error: #HY000Lock wait timeout exceeded; try restarting
transaction: ALTER TABLE `members` DROP `manager`
And I do not know if this is the way forward. Does any one have any
(relevant) thoughts on this?
With kind regards,
PS the actual spec:
describe Member, "should migrate properly" do
it "should migrate correctly from a column manager to a role
`rake db:migrate VERSION=59`
m1 = Member.new(:manager => true)
m2 = Member.new(:manager => true)
m3 = Member.new(:manager => true)
`rake db:migrate VERSION=60`
More information about the rspec-users