I installed mailman server to receive emails. and then I run the command
bundle exec script/mailman_server start
to read emails. It access my development DB whenever I run this command. But I want to access my test DB. so I changed my command like bundle exec script/mailman_server start --environment=test
.
Now this command runs in test mode. But it does not access my test DB. instead, it throws some error like
Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails (`cd_dashboard_dev`.`data_uats`, CONSTRAINT `data_uat_f_project_id` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`)): INSERT INTO `data_uats` (`build_no`, `company_id`, `created_at`, `critical_defects`, `high_defects`, `low_defects`, `medium_defects`, `project_id`, `release_cycle_no`, `test_date`, `updated_at`) VALUES ('B_2', 1, '2014-12-16 04:59:08', 3, 4, 5, 5, 31, '1', '2014-12-16', '2014-12-16 04:59:08') (ActiveRecord::InvalidForeignKey)
Anyone knows why I am getting this MySQL error? please help. It is kind of emergency. Any help would be grateful. Thanks in advance