From 0e253c4e9ff49390be670977e22ac6231493cc45 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 22 Sep 2017 20:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=85=B3=E5=8D=A1=E5=BE=97?= =?UTF-8?q?=E5=88=86=E9=BB=98=E8=AE=A4=E5=80=BC=E8=AE=BE=E7=BD=AE=E4=B8=BA?= =?UTF-8?q?100=E5=88=86=EF=BC=8C=E5=B9=B6=E8=BF=81=E7=A7=BB=E4=BB=A5?= =?UTF-8?q?=E5=BE=80=E5=88=86=E6=95=B0=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- ...0922114504_add_score_default_value_for_challenge.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20170922114504_add_score_default_value_for_challenge.rb diff --git a/Gemfile b/Gemfile index d29d5c856..2a11f7477 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ unless RUBY_PLATFORM =~ /w32/ gem 'nokogiri' end -gem 'simple_xlsx_reader' +#gem 'simple_xlsx_reader' gem 'wechat',path: 'lib/wechat' gem 'grack', path:'lib/grack' gem 'gitlab', path: 'lib/gitlab-cli' diff --git a/db/migrate/20170922114504_add_score_default_value_for_challenge.rb b/db/migrate/20170922114504_add_score_default_value_for_challenge.rb new file mode 100644 index 000000000..bb3494e2d --- /dev/null +++ b/db/migrate/20170922114504_add_score_default_value_for_challenge.rb @@ -0,0 +1,10 @@ +class AddScoreDefaultValueForChallenge < ActiveRecord::Migration + def up + challenges = Challenge.where(:score => nil) + challenges.update_all(:score => 100) + change_column :challenges, :score, :integer, :default => 100 + end + + def down + end +end