defmodule Exgradebook.Repo.Migrations.CreateSemesters do
  use Ecto.Migration

  def change do
    create table(:semesters, primary_key: false) do
      add :id, :binary_id, primary_key: true
      add :name, :string, null: false
      add :ended_on, :date, null: false
      add :started_on, :date, null: false

      timestamps()
    end
    create unique_index(:semesters, [:name])
  end
end
