defmodule DaProductApp.Repo.Migrations.CreateFollowupRequests do use Ecto.Migration def change do create table(:followup_requests) do add :transaction_id, references(:transactions, on_delete: :delete_all), null: false add :kind, :string, null: false # chktxn | reversal add :status, :string, null: false, default: "scheduled" # scheduled|sent|completed|timeout add :attempt_no, :integer, null: false, default: 1 add :deadline_at, :utc_datetime, null: false add :sent_at, :utc_datetime add :response_code, :string add :response_payload, :map timestamps(updated_at: false) end create index(:followup_requests, [:transaction_id]) create index(:followup_requests, [:kind]) create index(:followup_requests, [:status]) create index(:followup_requests, [:deadline_at]) end end