Skip to content

Commit

Permalink
create src/mvp/15-item-cid.md for dwyl/mvp#410
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Aug 24, 2023
1 parent f963da6 commit d3a0d21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/mvp/15-item-cid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Use `cid` for `items`

By default the `items` table uses an auto-incrementing (`Serial`)
for the `id` (Primary Key):

![items-id-integer](https://github.com/dwyl/mvp/assets/194400/d3020e53-2ad8-43ff-b0ed-95251ee21a87)

This is fine for a _server_-side rendered app
with a _single_ relational database instance.
But our ambition has always been
to build a mobile + offline-first distributed App.

4 changes: 3 additions & 1 deletion src/mvp/17-list_items.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ if we want to avoid conflicts.

As previously noted, the
`mix phx.gen.schema` command
does not create any `CRUD` functions
does _not_ create any `CRUD` functions
or the corresponding `test` file
for the `schema`.
In our case that's OK,
because we want to write a few bespoke functions.

Create the file with the path:
`test/app/list_items_test.exs`
Expand Down
Empty file added touch
Empty file.

0 comments on commit d3a0d21

Please sign in to comment.