defmodule VavPipeline.Repo.Migrations.Hakhel do use Ecto.Migration @moduledoc """ Hakhel (bishe'arecha §VIII; Devarim 31:9–13, 26): the specimen corpus — the scroll set beside the ark as a witness — read again on a cycle against the readings as they now are. The record keeps the date, the corpus's hash and size, the readings' commit, the counts and the precision/recall on the hand labels. Never a specimen. Append-only. """ def change do create table(:hakhel) do add :hakhel_ref, :string, null: false add :date, :date, null: false add :corpus_sha256, :string, null: false add :corpus_size, :integer, null: false add :readings_ref, :string add :doorpost_hash, :string add :counts, :jsonb, default: "{}", null: false add :labelled, :jsonb, default: "{}", null: false add :recorded_at, :utc_datetime, null: false timestamps(type: :utc_datetime, updated_at: false) end create unique_index(:hakhel, [:hakhel_ref]) create index(:hakhel, [:date]) end end