-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
borrow migrations for tags, status & people from Phoenix MVP see: dwy…
- Loading branch information
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
defmodule App.Repo.Migrations.CreateTags do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create table(:tags) do | ||
add :text, :string | ||
|
||
timestamps() | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
defmodule App.Repo.Migrations.CreateStatus do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create table(:status) do | ||
add :text, :string | ||
|
||
timestamps() | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule App.Repo.Migrations.CreatePeople do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create table(:people) do | ||
add :username, :binary | ||
add :username_hash, :binary | ||
add :email, :binary | ||
add :email_hash, :binary | ||
add :givenName, :binary | ||
add :familyName, :binary | ||
add :password_hash, :binary | ||
add :key_id, :integer | ||
add :status, references(:status, on_delete: :nothing) | ||
add :tag, references(:tags, on_delete: :nothing) | ||
|
||
timestamps() | ||
end | ||
|
||
create index(:people, [:status]) | ||
create index(:people, [:tag]) | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defmodule App.Repo.Migrations.AddPersonIdToTag do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:tags) do | ||
add :person_id, references(:people, on_delete: :nothing) | ||
end | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
priv/repo/migrations/20191113141229_add_person_id_to_status.exs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defmodule App.Repo.Migrations.AddPersonIdToStatus do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:status) do | ||
add :person_id, references(:people, on_delete: :nothing) | ||
end | ||
end | ||
end |