Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
857d8003
Commit
857d8003
authored
Nov 24, 2019
by
Zac Wood
Browse files
mysql updates
parent
14f8c1d0
Pipeline
#5204
passed with stage
in 7 minutes and 57 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
schedules/config/database.yml
View file @
857d8003
...
...
@@ -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
...
...
schedules/db/migrate/20191124215715_change_description_type.rb
0 → 100644
View file @
857d8003
class
ChangeDescriptionType
<
ActiveRecord
::
Migration
[
6.0
]
def
change
change_column
:courses
,
:description
,
:text
end
end
schedules/db/migrate/20191124220126_change_types_to_text.rb
0 → 100644
View file @
857d8003
class
ChangeTypesToText
<
ActiveRecord
::
Migration
[
6.0
]
def
change
change_column
:courses
,
:prereqs
,
:text
change_column
:course_sections
,
:notes
,
:text
end
end
schedules/db/schema.rb
View file @
857d8003
...
...
@@ -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 authoritativ
e
s
our
ce for your
# d
atabase 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 defin
e
y
our
schema when running `rails
# d
b: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:
2019
0307042304
)
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
.
int
eger
"semester_id"
t
.
big
int
"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
.
int
eger
"course_id"
t
.
big
int
"course_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
int
eger
"instructor_id"
t
.
int
eger
"semester_id"
t
.
big
int
"instructor_id"
t
.
big
int
"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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment