Last active
June 9, 2017 03:32
-
-
Save abadongutierrez/c89aaa0efd9ef0c5ef36d40055e99614 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Ecto101MigrationsSchemas.Repo.Migrations.EmployeeTable do | |
use Ecto.Migration | |
def change do | |
create table(:employee) do | |
add :first_name, :text, null: false | |
add :last_name, :text, null: false | |
add :hire_date, :date, null: false | |
add :department_id, | |
references(:department, | |
on_delete: :delete_all, | |
on_update: :update_all), | |
null: false | |
timestamps() | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment