Initial commit
This commit is contained in:
15
priv/repo/migrations/20201128001745_create_students.exs
Normal file
15
priv/repo/migrations/20201128001745_create_students.exs
Normal file
@@ -0,0 +1,15 @@
|
||||
defmodule Confient.Repo.Migrations.CreateStudents do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:students) do
|
||||
add :lastname, :string
|
||||
add :firstname, :string
|
||||
add :class_id, references(:classes, on_delete: :delete_all)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create unique_index(:students, [:lastname, :firstname, :class_id])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user