Changes between Version 1 and Version 2 of RelationalAIUsage
- Timestamp:
- 09/29/26 20:58:04 (9 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RelationalAIUsage
v1 v2 12 12 === Diagram === 13 13 14 The student produces `relational_schema.jpg` in DBeaver from the live `project` schema; see !RelationalDesignfor instructions.14 `relational_diagram_v4.png` was exported by the student in DBeaver from the live `project` schema, with the tables in the same positions as the entity sets of `ERModel_v05.png`; see [wiki:RelationalDesign] (section "How to regenerate it") for instructions. 15 15 16 16 === Results in details / description === … … 37 37 == Entire AI usage log == 38 38 39 See ERModelAIUsage— the full transcript of the 2026-04-21 conversation covers both P1 and P2 work. The specific prompts that drove the relational-design output were the same "make it work and make it fill in or to follow all of the needed instructions" instruction and the student's subsequent "do everything that you need to do".39 See [wiki:ERModelAIUsage] — the full transcript of the 2026-04-21 conversation covers both P1 and P2 work. The specific prompts that drove the relational-design output were the same "make it work and make it fill in or to follow all of the needed instructions" instruction and the student's subsequent "do everything that you need to do". 40 40 41 41 > '''Student action required:''' append any future consultations where you asked the AI to refine the schema, tune constraints, or write additional queries. … … 44 44 === Session 2 — 2026-08-06 / 2026-08-07 === 45 45 46 Prompts are logged in full in ERModelAIUsage(section "Session 2 — 2026-08-06 / 2026-08-07");46 Prompts are logged in full in [wiki:ERModelAIUsage] (section "Session 2 — 2026-08-06 / 2026-08-07"); 47 47 the one that drove this phase was ''"Also fix some database things or golang things if you think we can do it better"''. Changes to the P2 artefacts: 48 48 … … 53 53 `float64`, which was reported to the user as "Insufficient holding") was fixed 54 54 at the same time. 55 * !RelationalDesigngained an explicit account of the55 * [wiki:RelationalDesign] gained an explicit account of the 56 56 partial transformation: which ER construct each foreign key comes from, that 57 57 M:N relationships with attributes become tables whose foreign-key pair is a … … 70 70 71 71 Driven by the same design review logged in full in 72 ERModelAIUsage(section "Session 3 — 2026-09-16"):72 [wiki:ERModelAIUsage] (section "Session 3 — 2026-09-16"): 73 73 a sell order had nothing to check `holdings.quantity` against except itself, 74 74 so nothing stopped two sell orders from being granted the same units. … … 80 80 * `v_portfolio` gained `reserved_quantity` and the derived 81 81 `available_quantity = quantity - reserved_quantity`. 82 * !RelationalDesigngained a "Reservation and the order82 * [wiki:RelationalDesign] gained a "Reservation and the order 83 83 lifecycle" section explaining why the check is enforced at the database 84 84 level rather than trusted to application code, and why it does not conflict … … 90 90 (`-init` then `-load-data`), and against a manually seeded 2 BTC holding to 91 91 reproduce the exact scenario that motivated the change — see 92 UseCase0005Implementationfor92 [wiki:UseCase0005Implementation] for 93 93 the transcript. 94 94 … … 96 96 `trade.go` alone to keep the reservation consistent — the same reasoning 97 97 already applied to `avg_price NOT NULL` in session 2. 98 99 === Session 4 — 2026-09-29 (Claude Opus 5.5): correction after review === 100 101 '''Prompt (student, excerpt):''' I pasted the reviewer's comments on P2: 102 103 > the `contains` relationship from the model is implemented differently in the database 104 > the `holds` relationship from the model is implemented differently in the database 105 > there may be other inconsistencies that are difficult to spot; the Phase 2 diagram should 106 > have been created using DBeaver with a layout visually similar to the ERD 107 108 > I suggest correcting only the Phase 1 model so that it matches Phase 2 [...] For Phase 2, 109 > simply update the image according to the requirements. 110 111 '''Response (AI, summarised):''' 112 113 * Explained the mismatch. In the model, `Holds` and `Contains` were M:N relationships, whose table key would be the pair `{user_id, crypto_id}` / `{watchlist_id, crypto_id}`. But `holdings` and `watchlist_items` have their own `id` primary key, which is how an entity set is implemented. Following the reviewer's advice, P1 was corrected (v05, entity sets `Holdings` and `WatchlistItems`), and the database was not changed. 114 * Found the other inconsistencies between this page and the live schema. The page was missing `users.reserved_balance`, `orders.filled_quantity`, the status `partially_filled`, `market_trades.buy_order_id` / `sell_order_id` and the whole `order_events` table. The "10 tables", "5 indexes" and "the one nullable foreign key" counts were also out of date (really 11 tables, 8 indexes in `schema_creation.sql`, and 3 nullable foreign keys). 115 * Rewrote [wiki:RelationalDesign]. Each relation is labelled with its entity set and each foreign key with its relationship, and the transformation is a table of all 15 relationships → 15 foreign keys, with `NOT NULL` following participation. 116 * Wrote export instructions with a table grid that mirrors `ERModel_v05.png`. 117 118 '''What I decided:''' to correct P1 instead of the database, as the reviewer suggested. I 119 exported `relational_diagram_v4.png` from DBeaver myself, with the tables arranged like the 120 ER diagram.
