diff --git a/db/migrate/20261013103442_drop_jobs_courses_course_tutors_and_course_invitations_tables.rb b/db/migrate/20261013103442_drop_jobs_courses_course_tutors_and_course_invitations_tables.rb new file mode 100644 index 000000000..0e73090e9 --- /dev/null +++ b/db/migrate/20261013103442_drop_jobs_courses_course_tutors_and_course_invitations_tables.rb @@ -0,0 +1,83 @@ +class DropJobsCoursesCourseTutorsAndCourseInvitationsTables < ActiveRecord::Migration[7.0] + def up + safety_assured do + drop_table :course_tutors + drop_table :course_invitations + drop_table :courses + drop_table :jobs + end + end + + def down + create_table :courses, id: :serial do |t| + t.string :title + t.string :short_description + t.text :description + t.integer :tutor_id + t.datetime :date_and_time, precision: nil + t.integer :seats, default: 0 + t.string :slug + t.string :url + t.datetime :created_at, precision: nil + t.datetime :updated_at, precision: nil + t.integer :sponsor_id + t.string :ticket_url + t.integer :chapter_id + t.datetime :ends_at, precision: nil + + t.index :chapter_id, name: "index_courses_on_chapter_id" + t.index :sponsor_id, name: "index_courses_on_sponsor_id" + t.index :tutor_id, name: "index_courses_on_tutor_id" + end + + create_table :course_tutors, id: :serial do |t| + t.integer :course_id + t.integer :tutor_id + t.datetime :created_at, precision: nil + t.datetime :updated_at, precision: nil + + t.index :course_id, name: "index_course_tutors_on_course_id" + t.index :tutor_id, name: "index_course_tutors_on_tutor_id" + end + + create_table :course_invitations, id: :serial do |t| + t.integer :course_id + t.integer :member_id + t.boolean :attending + t.boolean :attended + t.text :note + t.string :token + t.datetime :created_at, precision: nil + t.datetime :updated_at, precision: nil + + t.index :course_id, name: "index_course_invitations_on_course_id" + t.index :member_id, name: "index_course_invitations_on_member_id" + end + + create_table :jobs, id: :serial do |t| + t.string :title + t.text :description + t.string :location + t.datetime :expiry_date, precision: nil + t.string :email + t.string :link_to_job + t.integer :created_by_id + t.boolean :approved, default: false + t.boolean :submitted, default: false + t.datetime :created_at, precision: nil + t.datetime :updated_at, precision: nil + t.string :company + t.integer :approved_by_id + t.string :company_website + t.string :company_address + t.string :company_postcode + t.datetime :published_on, precision: nil + t.boolean :remote + t.integer :salary + t.string :slug + t.integer :status, default: 0 + + t.index :created_by_id, name: "index_jobs_on_created_by_id" + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 8f96d3762..fa1431a2d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -135,48 +135,6 @@ t.index ["sponsor_id"], name: "index_contacts_on_sponsor_id" end - create_table "course_invitations", id: :serial, force: :cascade do |t| - t.boolean "attended" - t.boolean "attending" - t.integer "course_id" - t.datetime "created_at", precision: nil - t.integer "member_id" - t.text "note" - t.string "token" - t.datetime "updated_at", precision: nil - t.index ["course_id"], name: "index_course_invitations_on_course_id" - t.index ["member_id"], name: "index_course_invitations_on_member_id" - end - - create_table "course_tutors", id: :serial, force: :cascade do |t| - t.integer "course_id" - t.datetime "created_at", precision: nil - t.integer "tutor_id" - t.datetime "updated_at", precision: nil - t.index ["course_id"], name: "index_course_tutors_on_course_id" - t.index ["tutor_id"], name: "index_course_tutors_on_tutor_id" - end - - create_table "courses", id: :serial, force: :cascade do |t| - t.integer "chapter_id" - t.datetime "created_at", precision: nil - t.datetime "date_and_time", precision: nil - t.text "description" - t.datetime "ends_at", precision: nil - t.integer "seats", default: 0 - t.string "short_description" - t.string "slug" - t.integer "sponsor_id" - t.string "ticket_url" - t.string "title" - t.integer "tutor_id" - t.datetime "updated_at", precision: nil - t.string "url" - t.index ["chapter_id"], name: "index_courses_on_chapter_id" - t.index ["sponsor_id"], name: "index_courses_on_sponsor_id" - t.index ["tutor_id"], name: "index_courses_on_tutor_id" - end - create_table "delayed_jobs", id: :serial, force: :cascade do |t| t.integer "attempts", default: 0, null: false t.datetime "created_at", precision: nil @@ -360,31 +318,6 @@ t.index ["verified_by_id"], name: "index_invitations_on_verified_by_id" end - create_table "jobs", id: :serial, force: :cascade do |t| - t.boolean "approved", default: false - t.integer "approved_by_id" - t.string "company" - t.string "company_address" - t.string "company_postcode" - t.string "company_website" - t.datetime "created_at", precision: nil - t.integer "created_by_id" - t.text "description" - t.string "email" - t.datetime "expiry_date", precision: nil - t.string "link_to_job" - t.string "location" - t.datetime "published_on", precision: nil - t.boolean "remote" - t.integer "salary" - t.string "slug" - t.integer "status", default: 0 - t.boolean "submitted", default: false - t.string "title" - t.datetime "updated_at", precision: nil - t.index ["created_by_id"], name: "index_jobs_on_created_by_id" - end - create_table "meeting_invitations", id: :serial, force: :cascade do |t| t.boolean "attended", default: false t.boolean "attending"