1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added a precision and scale to the school score to make sure decimals are stored in mysql

This commit is contained in:
2021-02-22 16:22:06 +00:00
parent 1e30344be8
commit 63b0541aa4
2 changed files with 9 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
class AddScaleToTeamScoreDecimal < ActiveRecord::Migration[6.1]
def change
change_column :schools, :score, :decimal, precision: 15, scale: 1
end
end

View File

@@ -2,15 +2,15 @@
# of editing this file, please use the migrations feature of Active Record to # of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition. # incrementally modify your database, and then regenerate this schema definition.
# #
# This file is the source Rails uses to define your schema when running `rails # This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your # 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 from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code. # migrations use external dependencies or application code.
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_11_26_174257) do ActiveRecord::Schema.define(version: 2021_02_22_161151) do
create_table "delayed_jobs", force: :cascade do |t| create_table "delayed_jobs", force: :cascade do |t|
t.integer "priority", default: 0, null: false t.integer "priority", default: 0, null: false
@@ -74,7 +74,7 @@ ActiveRecord::Schema.define(version: 2019_11_26_174257) do
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.integer "tournament_id" t.integer "tournament_id"
t.decimal "score" t.decimal "score", precision: 15, scale: 1
t.index ["tournament_id"], name: "index_schools_on_tournament_id" t.index ["tournament_id"], name: "index_schools_on_tournament_id"
end end