Create users table

Let's get started by creating the users table.

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 associated with properties of users. 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 the Heroku database (from the left side navigation) that we connected earlier. Once you land on the public schema, click on Create Table. Enter the values for creating the table as mentioned above.

Create table users

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

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


Get Started with GraphQL Now

Hasura Cloud gives you a fully managed, production ready GraphQL API as a service to help you build modern apps faster.