Commit 857d8003 authored by Zac Wood's avatar Zac Wood

mysql updates

parent 14f8c1d0
Pipeline #5204 passed with stage
in 7 minutes and 57 seconds
......@@ -9,9 +9,9 @@ default: &default
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# development:
# <<: *default
# database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
......@@ -20,6 +20,16 @@ test:
<<: *default
database: db/test.sqlite3
development:
adapter: mysql2
database: <%= ENV.fetch("DB_DATABASE") { "schedules" } %>
username: <%= ENV.fetch("DB_USERNAME") { "root" } %>
password: <%= ENV.fetch("DB_PASSWORD") { "root" } %>
host: <%= ENV.fetch("DB_HOST") { "localhost" } %>
port: <%= ENV.fetch("DB_PORT") { 5432 } %>
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
production:
adapter: mysql2
encoding: unicode
......
class ChangeDescriptionType < ActiveRecord::Migration[6.0]
def change
change_column :courses, :description, :text
end
end
class ChangeTypesToText < ActiveRecord::Migration[6.0]
def change
change_column :courses, :prereqs, :text
change_column :course_sections, :notes, :text
end
end
......@@ -2,25 +2,25 @@
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
# This file is the source Rails uses to define your schema when running `rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20190307042304) do
ActiveRecord::Schema.define(version: 2019_11_24_220126) do
create_table "closures", force: :cascade do |t|
create_table "closures", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci", force: :cascade do |t|
t.date "date"
t.integer "semester_id"
t.bigint "semester_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["semester_id"], name: "index_closures_on_semester_id"
end
create_table "course_sections", force: :cascade do |t|
create_table "course_sections", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci", force: :cascade do |t|
t.string "name"
t.string "crn"
t.string "section_type"
......@@ -33,41 +33,45 @@ ActiveRecord::Schema.define(version: 20190307042304) do
t.string "location"
t.string "status"
t.string "campus"
t.string "notes"
t.text "notes"
t.integer "size_limit"
t.integer "course_id"
t.bigint "course_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "instructor_id"
t.integer "semester_id"
t.bigint "instructor_id"
t.bigint "semester_id"
t.string "rating_questions"
t.index ["course_id"], name: "index_course_sections_on_course_id"
t.index ["instructor_id"], name: "index_course_sections_on_instructor_id"
t.index ["semester_id"], name: "index_course_sections_on_semester_id"
end
create_table "courses", force: :cascade do |t|
create_table "courses", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci", force: :cascade do |t|
t.string "subject"
t.string "course_number"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "description"
t.text "description"
t.string "credits"
t.string "title"
t.string "prereqs"
t.text "prereqs"
end
create_table "instructors", force: :cascade do |t|
create_table "instructors", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "semesters", force: :cascade do |t|
create_table "semesters", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci", force: :cascade do |t|
t.string "season"
t.string "year"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_foreign_key "closures", "semesters"
add_foreign_key "course_sections", "courses"
add_foreign_key "course_sections", "instructors"
add_foreign_key "course_sections", "semesters"
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment