From 0cf1dc075bf3a80dcb4990d2f904111f20046a2b Mon Sep 17 00:00:00 2001 From: Raymond Cheng Date: Mon, 11 Mar 2024 08:12:58 -0600 Subject: [PATCH] fix: run build in hasura/ to create new tables (#1020) * Also fixed the path in the GitHub workflow for deploys --- .github/workflows/deploy-hasura.yml | 2 +- .../tables/code_metrics_by_collection.yaml | 22 +++++++++++++++++++ .../tables/code_metrics_by_project.yaml | 22 +++++++++++++++++++ .../tables/onchain_metrics_by_collection.yaml | 22 +++++++++++++++++++ .../tables/onchain_metrics_by_project.yaml | 22 +++++++++++++++++++ .../databases/cloudsql/tables/tables.yaml | 8 +++---- 6 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_collection.yaml create mode 100644 apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_project.yaml create mode 100644 apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_collection.yaml create mode 100644 apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_project.yaml diff --git a/.github/workflows/deploy-hasura.yml b/.github/workflows/deploy-hasura.yml index b8409e4dc..64f4b3ecd 100644 --- a/.github/workflows/deploy-hasura.yml +++ b/.github/workflows/deploy-hasura.yml @@ -12,7 +12,7 @@ on: branches: - main paths: - - hasura/** + - apps/hasura/** # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_collection.yaml b/apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_collection.yaml new file mode 100644 index 000000000..dc784b96d --- /dev/null +++ b/apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_collection.yaml @@ -0,0 +1,22 @@ +table: + name: code_metrics_by_collection + schema: public +select_permissions: + - role: anonymous + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: user + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: developer + permission: + columns: "*" + filter: {} + allow_aggregations: true + comment: "" diff --git a/apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_project.yaml b/apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_project.yaml new file mode 100644 index 000000000..a01419ebd --- /dev/null +++ b/apps/hasura/metadata/databases/cloudsql/tables/code_metrics_by_project.yaml @@ -0,0 +1,22 @@ +table: + name: code_metrics_by_project + schema: public +select_permissions: + - role: anonymous + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: user + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: developer + permission: + columns: "*" + filter: {} + allow_aggregations: true + comment: "" diff --git a/apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_collection.yaml b/apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_collection.yaml new file mode 100644 index 000000000..16e105f3f --- /dev/null +++ b/apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_collection.yaml @@ -0,0 +1,22 @@ +table: + name: onchain_metrics_by_collection + schema: public +select_permissions: + - role: anonymous + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: user + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: developer + permission: + columns: "*" + filter: {} + allow_aggregations: true + comment: "" diff --git a/apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_project.yaml b/apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_project.yaml new file mode 100644 index 000000000..1b20bd4f6 --- /dev/null +++ b/apps/hasura/metadata/databases/cloudsql/tables/onchain_metrics_by_project.yaml @@ -0,0 +1,22 @@ +table: + name: onchain_metrics_by_project + schema: public +select_permissions: + - role: anonymous + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: user + permission: + columns: "*" + filter: {} + allow_aggregations: false + comment: "" + - role: developer + permission: + columns: "*" + filter: {} + allow_aggregations: true + comment: "" diff --git a/apps/hasura/metadata/databases/cloudsql/tables/tables.yaml b/apps/hasura/metadata/databases/cloudsql/tables/tables.yaml index 00cc298c3..d0ce7877e 100644 --- a/apps/hasura/metadata/databases/cloudsql/tables/tables.yaml +++ b/apps/hasura/metadata/databases/cloudsql/tables/tables.yaml @@ -1,7 +1,5 @@ -- "!include onchain_metrics_by_collection_arbitrum.yaml" -- "!include onchain_metrics_by_project_arbitrum.yaml" -- "!include github_metrics_by_collection.yaml" -- "!include github_metrics_by_project.yaml" +- "!include onchain_metrics_by_collection.yaml" +- "!include onchain_metrics_by_project.yaml" - "!include event_types.yaml" - "!include first_contribution_to_project.yaml" - "!include last_contribution_to_project.yaml" @@ -29,3 +27,5 @@ - "!include collections.yaml" - "!include projects.yaml" - "!include projects_by_collection.yaml" +- "!include code_metrics_by_collection.yaml" +- "!include code_metrics_by_project.yaml"