Files
sure/db/migrate/20260412120000_create_exchange_rate_pairs.rb
soky srm e40811b1ee Add improvements from security providers to FX providers also (#1445)
* FIX prefer provider rate always

- add debugging also

* Move logic from securities over

* FIXes

* Review fixes

* Update provided.rb

---------

Signed-off-by: soky srm <sokysrm@gmail.com>
2026-04-13 00:51:23 +02:00

17 lines
531 B
Ruby

class CreateExchangeRatePairs < ActiveRecord::Migration[7.2]
def change
create_table :exchange_rate_pairs, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :from_currency, null: false
t.string :to_currency, null: false
t.date :first_provider_rate_on
t.string :provider_name
t.timestamps
end
add_index :exchange_rate_pairs,
[ :from_currency, :to_currency ],
unique: true,
name: "index_exchange_rate_pairs_on_pair_unique"
end
end