Create table users

Let's get started by creating the table users.

The users table will have the following columns:

  • id (type text),
  • name (type text),
  • created_at (type timestamp and default now())
  • last_seen (type timestamp and nullable)

The columns are mostly self-explanatory. The last_seen column is used to store the latest timestamp of when the user was online.

In the Hasura Console, head over to the Data tab section and click on Create Table. Enter the values for creating the table as mentioned above.

Create table users

Once you are done, click on Create button to create the table.

Great! You have created the first table required for the app.