Hi,
I have the following program with Octopus.
When I run "rake" it fails with message of missing tables. After the
failure I log in my database and I see that the test database does not
contain any tables. This probably means that "rake", which invokes
"db:schema:load" didn't manage to run successfully.
I try "rake test:units" (which also fails) and put on "--trace" and I
see that it tries to drop the tables on my development database. Not
the test database.
When I remove the "shards.yml" file from my config directory, "rake"
and "rake test:units" works perfect.
I am using Octopus 0.4.0.
Does anybody have any clue about this problem?
Here are logs to help you out from mysql general log:
This is when I use shards.yml in my config file:
(as you can see though it creates the test database, it is connected
to the development database and tries to drop the accounts table).
120104 15:54:43 440 Query select 1
440 Query SHOW TABLES
440 Query select 1
440 Query SHOW TABLES
440 Query select 1
440 Query SHOW FIELDS FROM `schema_migrations`
440 Query select 1
440 Query select 1
440 Query select 1
440 Query select 1
440 Query SELECT `schema_migrations`.`version`
FROM `schema_migrations`
120104 15:54:45 440 Query select 1
440 Query select 1
440 Query SHOW TABLES
440 Query select 1
440 Query SHOW FIELDS FROM `schema_migrations`
440 Query select 1
440 Query select 1
440 Query select 1
440 Query select 1
440 Query SELECT `schema_migrations`.`version`
FROM `schema_migrations`
440 Quit
441 Connect
ro...@10.0.0.123 on shop_development
441 Query SET SQL_AUTO_IS_NULL=0, NAMES 'utf8',
@@wait_timeout = 2592000
441 Query select 1
441 Query DROP DATABASE IF EXISTS `shop_test`
441 Query CREATE DATABASE `shop_test` DEFAULT
CHARACTER SET `utf8`
441 Query select 1
441 Query SHOW TABLES
441 Query DROP TABLE `accounts`
.....
This is when I do not have shards.yml in my config file:
(as you can see after getting the schema_migrations from development
database, it then goes to the test database0
120104 15:56:33 442 Connect
ro...@10.0.0.123 on shop_development
442 Query SET SQL_AUTO_IS_NULL=0, NAMES 'utf8',
@@wait_timeout = 2592000
442 Query select 1
442 Query SHOW TABLES
442 Query SHOW TABLES
442 Query SHOW FIELDS FROM `schema_migrations`
442 Query SELECT `schema_migrations`.`version`
FROM `schema_migrations`
120104 15:56:35 442 Query SHOW TABLES
442 Query SHOW FIELDS FROM `schema_migrations`
442 Query SELECT `schema_migrations`.`version`
FROM `schema_migrations`
442 Quit
443 Connect
ro...@10.0.0.123 on shop_test
443 Query SET SQL_AUTO_IS_NULL=0, NAMES 'utf8',
@@wait_timeout = 2592000
443 Query select 1
443 Query DROP DATABASE IF EXISTS `shop_test`
443 Query CREATE DATABASE `shop_test` DEFAULT
CHARACTER SET `utf8`
443 Quit
444 Connect
ro...@10.0.0.123 on shop_test
444 Query SET SQL_AUTO_IS_NULL=0, NAMES 'utf8',
@@wait_timeout = 2592000
444 Query select 1
444 Query SHOW TABLES
444 Query CREATE TABLE `accounts` (`id`
......
Panayotis