prop/priv/repo/migrations/20260408192634_add_approved_to_beacons.exs
Graham McIntire 80f2725cd5 Beacon submission approval workflow
Non-admin users can now submit beacons but they are held in an
unapproved state until an admin approves them. Only approved beacons
appear in the public list; pending submissions are shown in a separate
admin-only section on /beacons with Approve and Delete actions. The
show page surfaces a pending badge and an admin-only Approve button
when viewing an unapproved beacon.

Also formats EIRP (mW) on the index page without scientific notation.
2026-04-08 15:42:32 -05:00

12 lines
328 B
Elixir

defmodule Microwaveprop.Repo.Migrations.AddApprovedToBeacons do
use Ecto.Migration
def change do
alter table(:beacons) do
add :approved, :boolean, null: false, default: false
end
# Existing beacons were admin-created, so mark them approved.
execute "UPDATE beacons SET approved = true", ""
end
end