Sign up for Hasura Newsletter
Loading...

应用迁移

我们先为 Slack 应用程序创建表和关系。

下载带有迁移的 Hasura 项目

  1. 克隆 learn-graphql 代码库。在终端执行以下命令:
# make sure git version is >= v2.26
git clone --filter=blob:none --sparse git@github.com:hasura/learn-graphql.git
cd learn-graphql
git sparse-checkout init --cone
git sparse-checkout add tutorials/backend/hasura-auth-slack/slack-backend
  1. 导航至 slack-backend 目录。
cd tutorials/backend/hasura-auth-slack/slack-backend

配置端点,以指向 Hasura Cloud 应用程序 URL。打开 config.yaml 文件,并设置端点值。

version: 3
endpoint: https://ready-panda-91.hasura.app
...

注:你的端点因 Hasura 项目不同而有所不同。

现在,我们来应用迁移。

hasura metadata apply --admin-secret xxxx
hasura migrate apply --admin-secret xxxx
hasura metadata reload --admin-secret xxxx

这将为 Slack 应用程序创建表和关系。

太棒了!现在导航至 Hasura 控制台,以查看包含关系的表。

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