mirror of
https://github.com/we-promise/sure.git
synced 2026-04-09 07:14:47 +00:00
* 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
15 lines
392 B
Ruby
15 lines
392 B
Ruby
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
|