-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diffs cardinality many through (#153)
- Loading branch information
1 parent
b91baf0
commit 3ff4479
Showing
7 changed files
with
430 additions
and
10 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
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
18 changes: 18 additions & 0 deletions
18
priv/repo/migrations/20230915120413_create_resources_toys.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,18 @@ | ||
defmodule EctoDiff.Repo.Migrations.CreateResources do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create table(:resources) do | ||
add :pet_id, references(:pets) | ||
add :refid, :uuid | ||
end | ||
|
||
create table(:toys) do | ||
add :name, :string | ||
add :type, :string | ||
add :quantity, :integer, default: 1 | ||
add :resource_id, references(:resources) | ||
add :refid, :uuid | ||
end | ||
end | ||
end |
Oops, something went wrong.