mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
First pass at security price reference (#1388)
* First pass at security price reference
* Data cleanup
* Synth security fetching does better with a mic_code
* Update test suite
😭
* Update schema.rb
* Update generator.rb
This commit is contained in:
parent
bf695972e4
commit
490f44589e
16 changed files with 155 additions and 88 deletions
|
@ -0,0 +1,14 @@
|
|||
class AddReferenceToSecurityPrices < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_reference :security_prices, :security, foreign_key: true, type: :uuid
|
||||
|
||||
reversible do |dir|
|
||||
dir.up do
|
||||
Security::Price.find_each do |sp|
|
||||
security = Security.find_by(ticker: sp.ticker)
|
||||
sp.update_column(:security_id, security&.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue