priv/repo/migrations/20260817060000_add_module_surface_to_route_receipts.exs

main at 58e6347eeb72 · 508 B

defmodule Sarah.Repo.Migrations.AddModuleSurfaceToRouteReceipts do
  use Ecto.Migration

  def up do
    alter table(:module_route_receipts) do
      add :surface, :string, null: false, default: "text"
    end

    create constraint(:module_route_receipts, :module_route_receipt_surface_check,
             check: "surface IN ('text','voice','search','computer','repository','mcp','agent')"
           )
  end

  def down do
    alter table(:module_route_receipts) do
      remove :surface
    end
  end
end