Add oban web, securities table and accounts table

This commit is contained in:
2025-01-28 09:46:52 +01:00
parent 2f03f92481
commit f7a1488f27
7 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
defmodule Tradex.Repo.Migrations.AddSecuritiesTable do
use Ecto.Migration
def change do
create table(:securities, primary_key: false) do
add :id, :binary_id, primary_key: true
add :name, :string, null: false
add :ticker, :string
add :wkn, :string
add :isin, :string
add :expiration_date, :date
add :strike_price, :decimal
timestamps(type: :utc_datetime)
end
create unique_index(:securities, [:name])
end
end

View File

@@ -0,0 +1,15 @@
defmodule Tradex.Repo.Migrations.AddAccountsTable do
use Ecto.Migration
def change do
create table(:accounts, primary_key: false) do
add :id, :binary_id, primary_key: true
add :name, :string, null: false
add :owner_id, references(:users, type: :binary_id), null: false
timestamps(type: :utc_datetime)
end
create index(:accounts, [:owner_id])
end
end