Packages

An open and opinionated DeFi/CeFi/TradFi trading platform using productive & familiar open source libraries and tools for strategy research, execution and operation

Current section

Files

Jump to
prop priv repo migrations 20210803045118_create_history_trades.exs
Raw

priv/repo/migrations/20210803045118_create_history_trades.exs

defmodule Prop.Repo.Migrations.CreateHistoryTrades do
use Ecto.Migration
def up do
create table(:trades) do
add(:time, :utc_datetime, null: false)
add(:venue, :string, null: false)
add(:product, :string, null: false)
add(:venue_order_id, :string, null: false)
add(:side, :string, null: false)
add(:price, :decimal, null: false)
add(:qty, :decimal, null: false)
add(:liquidation, :boolean)
add(:source, :string, null: false)
timestamps()
end
create unique_index(:trades, [:time, :venue, :product, :source])
end
def down do
drop table(:trades)
end
end