Skip to content

Commit 11b8023

Browse files
nelsonicSteffenDE
authored andcommitted
split commands from output in guides/data_modelling/in_context_relationships.md ref: #6442
1 parent 4d53dbd commit 11b8023

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

guides/data_modelling/in_context_relationships.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ For now, categories will contain only textual information. Our first order of bu
99
```console
1010
$ mix phx.gen.context Catalog Category categories \
1111
title:string:unique --no-scope
12+
```
13+
14+
You will see the following output in your terminal:
1215

16+
```console
1317
You are generating into an existing context.
1418
...
1519
Would you like to proceed? [Yn] y
@@ -28,7 +32,11 @@ This time around, we used `mix phx.gen.context`, which is just like `mix phx.gen
2832

2933
```console
3034
$ mix ecto.gen.migration create_product_categories
35+
```
36+
37+
You will see the following output confirming the migration file was created:
3138

39+
```console
3240
* creating priv/repo/migrations/20250203192958_create_product_categories.exs
3341
```
3442

@@ -58,7 +66,11 @@ With our migrations in place, we can migrate up.
5866

5967
```console
6068
$ mix ecto.migrate
69+
```
70+
71+
You will see the following output confirming the migration succeeded:
6172

73+
```
6274
18:20:36.489 [info] == Running 20250222231834 Hello.Repo.Migrations.CreateCategories.change/0 forward
6375
6476
18:20:36.493 [info] create table categories
@@ -90,7 +102,11 @@ We simply enumerate over a list of category titles and use the generated `create
90102

91103
```console
92104
$ mix run priv/repo/seeds.exs
105+
```
106+
107+
The output in the terminal confirms the `seeds.exs` executed successfully:
93108

109+
```
94110
[debug] QUERY OK db=3.1ms decode=1.1ms queue=0.7ms idle=2.2ms
95111
INSERT INTO "categories" ("title","inserted_at","updated_at") VALUES ($1,$2,$3) RETURNING "id" ["Home Improvement", ~N[2025-02-03 19:39:53], ~N[2025-02-03 19:39:53]]
96112
[debug] QUERY OK db=1.2ms queue=1.3ms idle=12.3ms

0 commit comments

Comments
 (0)