From c87e2fdbec80b903399bbbd5aa7fceab49c77ab4 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Mon, 5 Aug 2019 15:18:58 +0800 Subject: [PATCH] .. --- db/migrate/20190805004505_sync_index_to_users.rb | 2 +- .../20190805061306_add_exec_time_to_evaluate_records.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190805061306_add_exec_time_to_evaluate_records.rb diff --git a/db/migrate/20190805004505_sync_index_to_users.rb b/db/migrate/20190805004505_sync_index_to_users.rb index 28393f4b6..33adca30c 100644 --- a/db/migrate/20190805004505_sync_index_to_users.rb +++ b/db/migrate/20190805004505_sync_index_to_users.rb @@ -1,6 +1,6 @@ class SyncIndexToUsers < ActiveRecord::Migration[5.2] def change - # add_index :users, :login, unique: true + add_index :users, :login, unique: true add_index :users, :mail, unique: true add_index :users, :phone, unique: true end diff --git a/db/migrate/20190805061306_add_exec_time_to_evaluate_records.rb b/db/migrate/20190805061306_add_exec_time_to_evaluate_records.rb new file mode 100644 index 000000000..10af1733e --- /dev/null +++ b/db/migrate/20190805061306_add_exec_time_to_evaluate_records.rb @@ -0,0 +1,7 @@ +class AddExecTimeToEvaluateRecords < ActiveRecord::Migration[5.2] + def change + remove_columns :evaluate_records, :exec_time if User.first.attributes.include?("exec_time") + + add_column :evaluate_records, :exec_time, :integer + end +end