This course is no longer maintained and may be out-of-date. While it remains available for reference, its content may not reflect the latest updates, best practices, or supported features.
Database Schema
We will be using two tables for our app. You can create these tables from the Hasura console.
Users
The users
table will contain two fields
- auth0_id: text primary key unique
- name: text
Todos
The todos
table will contain the following fields
- id: text primary key unique
- userId: text
- text: text
- isCompleted: boolean
- deleted: boolean; default: false
- createdAt: timestamp with timezone, default: now()
- updatedAt: timestamp with time zone, default: now()
Permissions
A user is able to create, select, update and delete only todos that belong to them. This can be enforced by setting permissions as shown below:
Did you find this page helpful?
Start with GraphQL on Hasura for Free
Build apps and APIs 10x faster
Built-in authorization and caching
8x more performant than hand-rolled APIs
![Promo](/learn/graphql/react-rxdb-offline-first/static/hasura-free-ff60e409244e0ea12b5a3045d1a9096b.png)
![footer illustration](https://graphql-engine-cdn.hasura.io/learn-hasura/assets/footer-img.png)