Sign up for Hasura Newsletter
Loading...

todosテーブルを作成する

では、もう 1 つのモデル todos を作成してみましょう。

todos テーブルには、以下の列が表示されます。

  • id(タイプ整数(自動インクリメント))、
  • title(タイプテキスト)、
  • is_completed(タイプブーリアン、デフォルトはfalse)
  • is_public(タイプブーリアン、デフォルトはfalse)
  • created_at(タイムスタンプ、デフォルトはnow())
  • user_id(タイプテキスト)

これらの列は、todo項目のプロパティと関連付けられています。

id列をプライマリキーに設定する事を忘れないでください。

Hasuraコンソールで、DATA タブセクションに移動して、Create Table をクリックします。上記の通り、テーブルを作成する値を入力します。

テーブルユーザーを作成する

完了後、Add Table ボタンをクリックして、テーブルを作成します。

Did you find this page helpful?
Start with GraphQL on Hasura for Free
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2024 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin