mirror of
https://github.com/kou029w/hasura-rest-hands-on.git
synced 2025-02-23 17:15:15 +00:00
24 lines
1.6 KiB
Markdown
24 lines
1.6 KiB
Markdown
# テーブルの作成
|
|
|
|
[Data Manager] > [View Database] > [Create Table]を選択し、新しいテーブルを作成します。
|
|
|
|
このハンズオンでは、次のデータモデルを作成します。
|
|
|
|
テーブル名: `pages` - メモ帳のページ
|
|
|
|
| 項目 | 型 | 説明 |
|
|
| --------- | ------------------------ | ----------------------------------------------------------------------------------- |
|
|
| `id` \* | Integer (auto-increment) | ページの識別子 |
|
|
| `content` | JSONB | ページの本文 ([Quill Deltaオブジェクト](https://quilljs.com/docs/delta/)を使う想定) |
|
|
|
|
\*: Primary Key
|
|
|
|
データモデルのための必要事項を入力し、テーブルを作成します。Primary Keyとして `id` (ページの識別子)を選択します。
|
|
|
|

|
|
|
|
テーブルの作成が完了するとその作成したテーブルの[Modify]パネルが表示されます。作成したテーブルへの変更はHasuraによって自動的に追従されます。
|
|
|
|

|
|
|
|
これでHasuraからGraphQLによるデータへの操作が可能になります。
|