Closed chrisle closed 12 years ago
the next version of the gem will tell you if a column doesn't exist - which is i think what happened here.
please let me know if using the new example from the readme fixed the issue.
Works! It works when I had nothing in the database. Here is the example:
Loading development environment (Rails 3.2.6)
1.9.3p194 :001 > Country.run_data_miner!
(8.2ms) CREATE TABLE `data_miner_runs` (`model_name` varchar(255), `aasm_state` varchar(255), `created_at` datetime, `stopped_at` datetime, `updated_at` datetime, `error` text, `row_count_before` int(11), `row_count_after` int(11), `id` int(11) DEFAULT NULL auto_increment PRIMARY KEY) ENGINE=InnoDB
(9.8ms) CREATE INDEX `index_data_miner_runs_on_model_name` ON `data_miner_runs` (`model_name`)
(8.0ms) CREATE INDEX `index_data_miner_runs_on_aasm_state` ON `data_miner_runs` (`aasm_state`)
(0.0ms) BEGIN
SQL (0.6ms) INSERT INTO `data_miner_runs` (`aasm_state`, `created_at`, `error`, `model_name`, `row_count_after`, `row_count_before`, `stopped_at`, `updated_at`) VALUES ('limbo', '2012-07-12 17:01:10', NULL, 'Country', NULL, NULL, NULL, '2012-07-12 17:01:10')
(0.2ms) COMMIT
(3.1ms) CREATE TABLE `countries` (`iso_3166_code` varchar(255) PRIMARY KEY, `iso_3166_numeric_code` int(11), `iso_3166_alpha_3_code` varchar(255), `name` varchar(255)) ENGINE=InnoDB
(0.0ms) BEGIN
(0.2ms) UPDATE `data_miner_runs` SET `aasm_state` = 'succeeded', `updated_at` = '2012-07-12 17:01:11' WHERE `data_miner_runs`.`id` = 1
(0.4ms) COMMIT
(0.2ms) SELECT COUNT(*) FROM `countries`
(0.1ms) BEGIN
(0.2ms) UPDATE `data_miner_runs` SET `row_count_after` = 249, `stopped_at` = '2012-07-12 17:01:11', `updated_at` = '2012-07-12 17:01:11' WHERE `data_miner_runs`.`id` = 1
(0.2ms) COMMIT
=> #<DataMiner::Run model_name: "Country", aasm_state: "succeeded", created_at: "2012-07-12 17:01:10", stopped_at: "2012-07-12 17:01:11", updated_at: "2012-07-12 17:01:11", error: nil, row_count_before: nil, row_count_after: 249, id: 1>
1.9.3p194 :002 >
I'm taking this gem for a test drive. Looks really interesting!
Environment
Ruby 1.9.3p194. Rails 3.2.6.
Steps to recreate:
mysql2
,data_miner
, andunicode_utils
to the Gemfile and bundle installedCountry.run_data_miner!
"I got the following error. I also tried this in an existing app and got the same error.
Stacktrace
Have you seen this before?