Hi Everyone, <br><br>I am trying to get CruiseControl running using migrations with foreign keys, and I'm having some difficulties. I have a project that builds and passes CC.rb
. I can add some manual foreign key creation to the migration scrips, and everything works fine outside of cruisecontrol. (everything works fine running rake from command line, even in the cruisecontrol work directory). However, once I run the build from inside CruiseControl, it fails with this error:
<br><br><div id="mb_0">[CruiseControl] Invoking Rake task "test"
/usr/bin/ruby1.8 -Ilib:test
"/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake_test_loader.rb"
Mysql::Error: Table 'apples' already exists: CREATE TABLE apples (`id`
int(11) DEFAULT NULL auto_increment PRIMARY KEY, `color` varchar(255)
DEFAULT NULL, `size` varchar(255) DEFAULT NULL) ENGINE=InnoDB
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract_adapter.rb:128:in
`log'
/usr/lib/ruby/gems/1.8/gems</div><br>Here is a simple example that this happens with:<br><br> create_table :apples do |t|<br> t.column :color, :string<br> t.column :size, :string <br> end<br><br> create_table :oranges do |t|
<br> t.column :name, :string<br> t.column :apple_id, :integer
<br> end<br> execute "alter table oranges add constraint fk_oranges_apples foreign key (apple_id) references apples(id)"<br><br>And it results with the error above. This happens even if I add a "drop foreign" key in my down script before dropping the table.
<br><br>Thanks!<br><br><br>