Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
# encoding: UTF-8
# frozen_string_literal: true
class NormalizeAddressesAndTransactions < ActiveRecord::Migration[4.2]
class Ccy < ActiveRecord::Base
serialize :options, JSON
self.table_name = 'currencies'
self.inheritance_column = :disabled
end
def change
Ccy.where(type: :coin).find_each do |ccy|
if ccy.code.in?(%w[eth ethd])
ccy.options['bitgo_wallet_address'].try(:downcase!)
ccy.options['erc20_contract_address'].try(:downcase!)
ccy.save
execute %[UPDATE deposits SET address = LOWER(address), txid = LOWER(txid) WHERE currency_id = #{ccy.id}]
execute %[UPDATE payment_addresses SET address = LOWER(address) WHERE currency_id = #{ccy.id}]
execute %[UPDATE withdraws SET rid = LOWER(rid), txid = LOWER(txid) WHERE type = 'Withdraws::Coin' AND currency_id = #{ccy.id}]
else
ccy.options['case_sensitive'] = true
ccy.save
end
end
end
end