defmodule OhMyExOhIrcd.Repo.Migrations.CreateShortLinkClicks do
use Ecto.Migration
# One row per clickthrough, for referrer / user-agent / over-time metrics.
# No PII beyond the request's own Referer + User-Agent headers; client IPs
# are deliberately not stored. `updated_at` is omitted — clicks are
# immutable events.
def change do
create table(:short_link_clicks) do
add :short_link_id, references(:short_links, on_delete: :delete_all), null: false
add :referer, :text
add :user_agent, :text
timestamps(type: :utc_datetime, updated_at: false)
end
create index(:short_link_clicks, [:short_link_id, :inserted_at])
end
end
neiam
/oh-my-ex-oh-ircd
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
679 B · text
History
4b6fe3b