gabrielshufelt / Real-Ratings-SOEN-341_Project_F24

0 stars 1 forks source link

Migrations for User Model and and Creating Join Tables #71

Closed gabrielshufelt closed 5 days ago

gabrielshufelt commented 2 weeks ago

Description

This issue focuses on creating and updating migrations for models (Course, Evaluation, Project, Team, User) and establishing the necessary join tables (CourseRegistrations and TeamMemberships).

Migrations

Courses

Create the CourseModel with the fields title (ex. "Software Process"), code (ex. "SOEN 341").

# Example Migration for Courses
class CreateCourses < ActiveRecord::Migration[6.0]
  def change
    create_table :courses do |t|
      t.string :title, null: false
      t.references :instructor, null: false, foreign_key: { to_table: :users }
      t.timestamps
    end
    add_index :courses, :instructor_id
  end
end

Evaluations

Projects

Teams

Users

CourseRegistrations

TeamMemberships