ruby on rails - I have a following mistake: PG::UndefinedColumn: ERROR: column students.year_course_id does not exist LINE 1 -


Change your code! I have a mistake: PG :: unchanged columns: error: students in the column. Ureusures_id is not present 1 line: SELECT COUNT () "students" from "students" where "Year_cour ... ^: SELECT COUNT ()" students "from WHERE" students "." Year_course_id "$ 1

The error clearly states that the year_course_id column students does not exist in the table. To solve this problem, create it.

When you specify

  class student & lt; ActiveRecord :: Base is_to: year_course end  

You must refer to students in the year_course_id field year_courses Table.

UPDATE

You can add students to the year_course_id column table migrate

P>

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -