You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,7 +20,7 @@ on the client and map them to sequential IDs on the backend database (Supabase i
20
20
### Overview
21
21
Before we get started, let's outline the changes we will have to make:
22
22
<Steps>
23
-
<Steptitle={"Data model"}>
23
+
<Steptitle={"Schema"}>
24
24
Update the `lists` and `todos` tables
25
25
</Step>
26
26
@@ -46,14 +46,14 @@ Before we get started, let's outline the changes we will have to make:
46
46
</Step>
47
47
</Steps>
48
48
49
-
# Data Model
49
+
# Schema
50
50
51
51
In order to map the UUID to the integer ID, we need to update the
52
52
-`lists` table by adding a `uuid` column, which will be the secondary ID, and
53
53
-`todos` table by adding a `uuid` column, and a `list_uuid` foreign key column which references the `uuid` column in the `lists` table.
54
54
55
55
<CodeGroup>
56
-
```sqldata model {3, 13, 21, 26}
56
+
```sqlschema {3, 13, 21, 26}
57
57
createtablepublic.lists (
58
58
id serial,
59
59
uuid uuid not null unique,
@@ -84,7 +84,7 @@ In order to map the UUID to the integer ID, we need to update the
84
84
```
85
85
</CodeGroup>
86
86
87
-
With the data mode updated, we now need a method to synchronize and map the `list_id` and `list_uuid` in the `todos` table, with the `id` and `uuid` columns in the `lists` table.
87
+
With the schema updated, we now need a method to synchronize and map the `list_id` and `list_uuid` in the `todos` table, with the `id` and `uuid` columns in the `lists` table.
88
88
We can achieve this by creating SQL triggers.
89
89
90
90
# Create SQL Triggers
@@ -182,7 +182,7 @@ We will create the following two triggers that cover either scenario of updating
182
182
</Accordion>
183
183
</AccordionGroup>
184
184
185
-
We now have triggers in place that will handle the mapping for our updated data model and
185
+
We now have triggers in place that will handle the mapping for our updated schema and
186
186
can move on to updating the Sync Rules to use the UUID column instead of the integer ID.
0 commit comments