Initial commit
This commit is contained in:
10
db/migrate/20180403115050_add_tid_to_deposit.rb
Normal file
10
db/migrate/20180403115050_add_tid_to_deposit.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
# encoding: UTF-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTIDToDeposit < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :deposits, :tid, :string, limit: 64
|
||||
execute %{UPDATE deposits SET tid = CONCAT('TID', id, currency_id, member_id) WHERE tid IS NULL}
|
||||
change_column :deposits, :tid, :string, null: false, index: { unique: true }, limit: 64
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user