Contacts can be marked private at submit time (single form, CSV import, ADIF import) and edit time. Private contacts are hidden from the public map, the public /u/callsign profile, and the browse table for anonymous and non-owning viewers. The original submitter and admins see them inline on the browse table with a "Yes" badge, and the detail page shows a lock icon. Non-authorized viewers get a 404 on the detail page.
14 lines
349 B
Elixir
14 lines
349 B
Elixir
defmodule Microwaveprop.Repo.Migrations.AddPrivateToContacts do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
alter table(:contacts) do
|
|
add :private, :boolean, null: false, default: false
|
|
end
|
|
|
|
create index(:contacts, [:user_id],
|
|
where: "private = true",
|
|
name: :contacts_private_user_id_idx
|
|
)
|
|
end
|
|
end
|