Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby ActiveRecord Basics Migrations and Relationships Has and Belongs to Many

Hmm any idea where I messed up? Mysql2::Error: Table 'biller_development.employees' doesn't exist: SELECT `employees`.*

Mysql2::Error: Table 'biller_development.employees' doesn't exist: SELECT `employees`.* FROM `employees` INNER JOIN `employees_projects` ON `employees`.`id` = `employees_projects`.`employee_id` WHERE `employees_projects`.`project_id` = 1
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'biller_development.employees' doesn't exist: SELECT `employees`.* FROM `employees` INNER JOIN `employees_projects` ON `employees`.`id` = `employees_projects`.`employee_id` WHERE `employees_projects`.`project_id` = 1

3 Answers

The error is saying that the table "employees" doesn't exist. Did you run the migrations?

i did rake db:migrate .... doesn't seem to help.

Hrm, could you try the following and post the output? Might be something wrong with a migration in there somewhere.

  rake db:drop db:create db:migrate --trace

I was having the same issue. I did rake db:drop db:create db:migrate --trace and once everything was reset it worked. Thanks Geoff!

gregory fenwick
gregory fenwick
7,569 Points

I was having a similar issue, Excellent command, thanks.