mirror of
https://github.com/we-promise/sure
synced 2026-04-25 17:15:07 +02:00
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>
This commit is contained in:
16
db/migrate/20260412120000_create_exchange_rate_pairs.rb
Normal file
16
db/migrate/20260412120000_create_exchange_rate_pairs.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
12
db/schema.rb
generated
12
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2026_04_11_082125) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2026_04_12_120000) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
enable_extension "plpgsql"
|
||||
@@ -551,6 +551,16 @@ ActiveRecord::Schema[7.2].define(version: 2026_04_11_082125) do
|
||||
t.index ["tags"], name: "index_eval_samples_on_tags", using: :gin
|
||||
end
|
||||
|
||||
create_table "exchange_rate_pairs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade 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.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["from_currency", "to_currency"], name: "index_exchange_rate_pairs_on_pair_unique", unique: true
|
||||
end
|
||||
|
||||
create_table "exchange_rates", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.string "from_currency", null: false
|
||||
t.string "to_currency", null: false
|
||||
|
||||
Reference in New Issue
Block a user