frankfurter/db/migrate/002_denormalise_currencies.rb
Hakan Ensari cf373f3efb Denormalise database schema
This way, we will have no issue fitting the entire dataset on the free tier of Heroku
2018-10-07 01:08:45 +01:00

23 lines
385 B
Ruby

# frozen_string_literal: true
Sequel.migration do
up do
create_table :days do
date :date
jsonb :rates
index :date, unique: true
end
drop_table :currencies
end
down do
create_table :currencies do
date :date
string :iso_code
float :rate
index %i[date iso_code], unique: true
end
drop_table :days
end
end