-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteps.txt
17 lines (11 loc) · 848 Bytes
/
steps.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# create users
mix phx.gen.schema User users email:string:unique phone:string password_hash:string
# Insert users into DB
Poaster.Repo.insert!(Poaster.User.changeset(%Poaster.User{}, %{email: "[email protected]", password: "poaster!2020", phone: "3142017135"}))
# create auth tokens
mix phx.gen.schema AuthToken auth_tokens user_id:references:users token:text:unique revoked:boolean revoked_at:utc_datetime
# create personas
mix phx.gen.schema Persona personas user_id:references:users username:string:unique name:string bio:string profile_image_url:string background_image_url:string
# Insert persona into DB
Poaster.Repo.insert!(Poaster.User.changeset(%Poaster.User{}, %{email: "[email protected]", password: "poaster!2020", phone: "3142017135"}))
u = Poaster.Repo.get(Poaster.User, 1) |> Poaster.Repo.preload([:personas])