459 B · text History 0429b57
defmodule OhMyExOhIrcd.Repo.Migrations.CreateKlines do
  use Ecto.Migration

  def change do
    create table(:klines) do
      # IRC-style glob applied to `user@host` of the connecting client.
      add :mask, :string, null: false
      add :reason, :text
      add :set_by, :string, null: false
      # NULL = permanent.
      add :expires_at, :utc_datetime

      timestamps(type: :utc_datetime)
    end

    create index(:klines, [:expires_at])
  end
end