Created
November 18, 2017 16:52
-
-
Save Hajto/71ee4f1c211088413cf2715409199a63 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 TalkMe.Repo.Migrations.CreateHobbies do | |
use Ecto.Migration | |
def change do | |
create table(:hobbies) do | |
add :name, :string | |
add :icon_url, :string | |
timestamps() | |
end | |
end | |
end |
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 TalkMe.Repo.Migrations.CreateUsers do | |
use Ecto.Migration | |
def change do | |
create table(:users) do | |
add :name, :string | |
add :age, :integer | |
add :avatar_url, :string | |
timestamps() | |
end | |
end | |
end |
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 TalkMe.Repo.Migrations.CreateInBetweenHobbyLink do | |
use Ecto.Migration | |
def change do | |
create table(:user_hobby_links) do | |
add :user_id, references :users | |
add :hobby_id, references :hobbies | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment