From d3a0d21b0fd5a1d760cb47198c7d565876075bd5 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Wed, 23 Aug 2023 23:57:25 +0100 Subject: [PATCH] create src/mvp/15-item-cid.md for https://github.com/dwyl/mvp/issues/410 --- src/mvp/15-item-cid.md | 12 ++++++++++++ src/mvp/17-list_items.md | 4 +++- touch | 0 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/mvp/15-item-cid.md create mode 100644 touch diff --git a/src/mvp/15-item-cid.md b/src/mvp/15-item-cid.md new file mode 100644 index 0000000..7dc53f7 --- /dev/null +++ b/src/mvp/15-item-cid.md @@ -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. + diff --git a/src/mvp/17-list_items.md b/src/mvp/17-list_items.md index 4201604..9266fb2 100644 --- a/src/mvp/17-list_items.md +++ b/src/mvp/17-list_items.md @@ -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` diff --git a/touch b/touch new file mode 100644 index 0000000..e69de29