Initial commit
This commit is contained in:
16
priv/repo/migrations/20201128151154_create_assignments.exs
Normal file
16
priv/repo/migrations/20201128151154_create_assignments.exs
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
Reference in New Issue
Block a user