17 lines
365 B
Elixir
17 lines
365 B
Elixir
defmodule Confient.Repo.Migrations.CreateAssignments do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:assignments) do
|
|
add :title, :string
|
|
add :slug, :string
|
|
add :due, :date
|
|
add :class_id, references(:classes, on_delete: :delete_all)
|
|
|
|
timestamps()
|
|
end
|
|
|
|
create unique_index(:assignments, [:title, :class_id])
|
|
end
|
|
end
|