Database Schema

We will be using two tables for our app. You can create these tables from the Hasura console.


The users table will contain two fields

  • auth0_id: text primary key unique
  • name: text


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()


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: