From 60021ee54170de6d8298eb84279a0be6777ac1c0 Mon Sep 17 00:00:00 2001 From: Suvij Surya Date: Thu, 24 Oct 2024 12:47:49 +0530 Subject: [PATCH 1/4] fix: trace id in logs from custom modules (#1299) --- router-tests/modules/module_test.go | 48 +++++++++++++++++++++++++++++ router/cmd/custom/module/module.go | 2 ++ router/core/graph_server.go | 8 +++-- 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/router-tests/modules/module_test.go b/router-tests/modules/module_test.go index 9d308e1167..02f1900dab 100644 --- a/router-tests/modules/module_test.go +++ b/router-tests/modules/module_test.go @@ -4,6 +4,9 @@ import ( "encoding/json" "testing" + "github.com/wundergraph/cosmo/router/pkg/trace/tracetest" + "go.uber.org/zap/zapcore" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/wundergraph/cosmo/router-tests/testenv" @@ -39,3 +42,48 @@ func TestModuleSetCustomHeader(t *testing.T) { assert.JSONEq(t, res.Body, `{"data":{"employees":[{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":7},{"id":8},{"id":10},{"id":11},{"id":12}]}}`) }) } + +func TestCustomModuleLogs(t *testing.T) { + cfg := config.Config{ + Graph: config.Graph{}, + Modules: map[string]interface{}{ + "myModule": module.MyModule{ + Value: 1, + }, + }, + } + + exporter := tracetest.NewInMemoryExporter(t) + + testenv.Run(t, &testenv.Config{ + RouterOptions: []core.Option{ + core.WithModulesConfig(cfg.Modules), + }, + LogObservation: testenv.LogObservationConfig{ + Enabled: true, + LogLevel: zapcore.InfoLevel, + }, + TraceExporter: exporter, + }, func(t *testing.T, xEnv *testenv.Environment) { + res, err := xEnv.MakeGraphQLRequest(testenv.GraphQLRequest{ + Query: `query MyQuery { employees { id } }`, + OperationName: json.RawMessage(`"MyQuery"`), + }) + require.NoError(t, err) + + assert.Equal(t, 200, res.Response.StatusCode) + assert.JSONEq(t, res.Body, `{"data":{"employees":[{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":7},{"id":8},{"id":10},{"id":11},{"id":12}]}}`) + + requestLog := xEnv.Observer().FilterMessage("Test custom module logs") + assert.Equal(t, requestLog.Len(), 1) + requestContext := requestLog.All()[0].ContextMap() + + expectedKeys := []string{ + "trace_id", "request_id", "hostname", "pid", + } + + for _, key := range expectedKeys { + assert.NotEmpty(t, requestContext[key]) + } + }) +} diff --git a/router/cmd/custom/module/module.go b/router/cmd/custom/module/module.go index e7681a2ade..11758f1dfe 100644 --- a/router/cmd/custom/module/module.go +++ b/router/cmd/custom/module/module.go @@ -80,6 +80,8 @@ func (m *MyModule) Middleware(ctx core.RequestContext, next http.Handler) { operation := ctx.Operation() + logger := ctx.Logger() + logger.Info("Test custom module logs") // Access the GraphQL operation context fmt.Println( operation.Name(), diff --git a/router/core/graph_server.go b/router/core/graph_server.go index 1516f5e18a..84fb377937 100644 --- a/router/core/graph_server.go +++ b/router/core/graph_server.go @@ -485,12 +485,16 @@ func (s *graphServer) buildGraphMux(ctx context.Context, rtrace.WithTracePreHandler( func(r *http.Request, w http.ResponseWriter) { reqContext := getRequestContext(r.Context()) + traceID := rtrace.GetTraceID(r.Context()) + requestLogger := reqContext.Logger().With(logging.WithTraceID(traceID)) + + reqContext.logger = requestLogger + span := oteltrace.SpanFromContext(r.Context()) span.SetAttributes(reqContext.telemetry.CommonAttrs()...) // Set the trace ID in the response header if s.traceConfig.ResponseTraceHeader.Enabled { - traceID := rtrace.GetTraceID(r.Context()) w.Header().Set(s.traceConfig.ResponseTraceHeader.HeaderName, traceID) } }), @@ -523,7 +527,7 @@ func (s *graphServer) buildGraphMux(ctx context.Context, subgraphResolver := NewSubgraphResolver(subgraphs) httpRouter.Use(func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - requestLogger := s.logger.With(logging.WithRequestID(middleware.GetReqID(r.Context())), logging.WithTraceID(rtrace.GetTraceID(r.Context()))) + requestLogger := s.logger.With(logging.WithRequestID(middleware.GetReqID(r.Context()))) r = r.WithContext(withSubgraphResolver(r.Context(), subgraphResolver)) reqContext := buildRequestContext(requestContextOptions{ From 660c2b66abd64e73e7a174bc3ff7429ea9657d35 Mon Sep 17 00:00:00 2001 From: hardworker-bot Date: Thu, 24 Oct 2024 07:27:13 +0000 Subject: [PATCH 2/4] chore(release): Publish [skip ci] - router@0.130.1 --- router/CHANGELOG.md | 7 +++++++ router/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/router/CHANGELOG.md b/router/CHANGELOG.md index f2e983efbb..35a08bc12f 100644 --- a/router/CHANGELOG.md +++ b/router/CHANGELOG.md @@ -4,6 +4,13 @@ Binaries are attached to the github release otherwise all images can be found [h All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.130.1](https://github.com/wundergraph/cosmo/compare/router@0.130.0...router@0.130.1) (2024-10-24) + +### Bug Fixes + +* exclude query plan fetches from field usage count ([#1297](https://github.com/wundergraph/cosmo/issues/1297)) ([437bc76](https://github.com/wundergraph/cosmo/commit/437bc764fb83087d036f89243d0ef2365ed2a67f)) (@JivusAyrus) +* trace id in logs from custom modules ([#1299](https://github.com/wundergraph/cosmo/issues/1299)) ([60021ee](https://github.com/wundergraph/cosmo/commit/60021ee54170de6d8298eb84279a0be6777ac1c0)) (@JivusAyrus) + # [0.130.0](https://github.com/wundergraph/cosmo/compare/router@0.129.2...router@0.130.0) (2024-10-22) ### Features diff --git a/router/package.json b/router/package.json index 9fd4a50336..6dfd931491 100644 --- a/router/package.json +++ b/router/package.json @@ -1,6 +1,6 @@ { "name": "router", - "version": "0.130.0", + "version": "0.130.1", "private": true, "description": "Placeholder package to simplify versioning and releasing with lerna.", "keywords": [ From c4d6d9d4fbcf446b889be2f89731efa48799f3d5 Mon Sep 17 00:00:00 2001 From: El Bouchaibi Yassine <46449697+YassineElbouchaibi@users.noreply.github.com> Date: Thu, 24 Oct 2024 06:30:53 -0400 Subject: [PATCH 3/4] fix: data migration to maintain table name traces_mv (#1301) Co-authored-by: Nithin Kumar B --- .../1726744316_add_span_id_to_trace/files/migrate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_migrations/controlplane/1726744316_add_span_id_to_trace/files/migrate.go b/data_migrations/controlplane/1726744316_add_span_id_to_trace/files/migrate.go index 744e9b382f..b95f9cf17a 100644 --- a/data_migrations/controlplane/1726744316_add_span_id_to_trace/files/migrate.go +++ b/data_migrations/controlplane/1726744316_add_span_id_to_trace/files/migrate.go @@ -86,7 +86,7 @@ ORDER BY ( TTL toDateTime(Timestamp) + toIntervalDay(30) SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1; -CREATE MATERIALIZED VIEW IF NOT EXISTS cosmo.temp_traces_mv TO cosmo.traces AS +CREATE MATERIALIZED VIEW IF NOT EXISTS cosmo.traces_mv TO cosmo.traces AS SELECT TraceId, SpanId, toDateTime(Timestamp, 'UTC') as Timestamp, From b16c2d0d84d061e725507e35808928e7af5c1acf Mon Sep 17 00:00:00 2001 From: Nithin Kumar B Date: Thu, 24 Oct 2024 16:43:42 +0530 Subject: [PATCH 4/4] fix: subgraph and schema version foreign key constraint (#1303) --- .../migrations/0102_common_tiger_shark.sql | 7 + .../migrations/meta/0102_snapshot.json | 5074 +++++++++++++++++ controlplane/migrations/meta/_journal.json | 7 + controlplane/src/db/schema.ts | 2 +- 4 files changed, 5089 insertions(+), 1 deletion(-) create mode 100644 controlplane/migrations/0102_common_tiger_shark.sql create mode 100644 controlplane/migrations/meta/0102_snapshot.json diff --git a/controlplane/migrations/0102_common_tiger_shark.sql b/controlplane/migrations/0102_common_tiger_shark.sql new file mode 100644 index 0000000000..be7695f3e3 --- /dev/null +++ b/controlplane/migrations/0102_common_tiger_shark.sql @@ -0,0 +1,7 @@ +ALTER TABLE "subgraphs" DROP CONSTRAINT "subgraphs_schema_version_id_schema_versions_id_fk"; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "subgraphs" ADD CONSTRAINT "subgraphs_schema_version_id_schema_versions_id_fk" FOREIGN KEY ("schema_version_id") REFERENCES "public"."schema_versions"("id") ON DELETE set null ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/controlplane/migrations/meta/0102_snapshot.json b/controlplane/migrations/meta/0102_snapshot.json new file mode 100644 index 0000000000..a1716c1c64 --- /dev/null +++ b/controlplane/migrations/meta/0102_snapshot.json @@ -0,0 +1,5074 @@ +{ + "id": "135533f6-d4ab-493b-a404-8d066c0bb5b0", + "prevId": "84b2107a-6c0e-4026-ad17-6a65946364d6", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.api_key_permissions": { + "name": "api_key_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "api_key_id": { + "name": "api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission": { + "name": "permission", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "api_key_permissions_api_key_id_api_keys_id_fk": { + "name": "api_key_permissions_api_key_id_api_keys_id_fk", + "tableFrom": "api_key_permissions", + "tableTo": "api_keys", + "columnsFrom": [ + "api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.api_key_resources": { + "name": "api_key_resources", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "api_key_id": { + "name": "api_key_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "api_key_resources_api_key_id_api_keys_id_fk": { + "name": "api_key_resources_api_key_id_api_keys_id_fk", + "tableFrom": "api_key_resources", + "tableTo": "api_keys", + "columnsFrom": [ + "api_key_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "api_key_resources_target_id_targets_id_fk": { + "name": "api_key_resources_target_id_targets_id_fk", + "tableFrom": "api_key_resources", + "tableTo": "targets", + "columnsFrom": [ + "target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.api_keys": { + "name": "api_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "apikey_name_idx": { + "name": "apikey_name_idx", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "api_keys_user_id_users_id_fk": { + "name": "api_keys_user_id_users_id_fk", + "tableFrom": "api_keys", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "api_keys_organization_id_organizations_id_fk": { + "name": "api_keys_organization_id_organizations_id_fk", + "tableFrom": "api_keys", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "api_keys_key_unique": { + "name": "api_keys_key_unique", + "nullsNotDistinct": false, + "columns": [ + "key" + ] + } + } + }, + "public.audit_logs": { + "name": "audit_logs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "audit_action": { + "name": "audit_action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "auditable_type": { + "name": "auditable_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auditable_display_name": { + "name": "auditable_display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "target_type": { + "name": "target_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_display_name": { + "name": "target_display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_namespace_id": { + "name": "target_namespace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_namespace": { + "name": "target_namespace", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_id": { + "name": "actor_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "actor_display_name": { + "name": "actor_display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_type": { + "name": "actor_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "audit_logs_organization_id_organizations_id_fk": { + "name": "audit_logs_organization_id_organizations_id_fk", + "tableFrom": "audit_logs", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.billing_plans": { + "name": "billing_plans", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "price": { + "name": "price", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "features": { + "name": "features", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "stripe_price_id": { + "name": "stripe_price_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "weight": { + "name": "weight", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.billing_subscriptions": { + "name": "billing_subscriptions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "price_id": { + "name": "price_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "cancel_at_period_end": { + "name": "cancel_at_period_end", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cancel_at": { + "name": "cancel_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "canceled_at": { + "name": "canceled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "current_period_start": { + "name": "current_period_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "current_period_end": { + "name": "current_period_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "ended_at": { + "name": "ended_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "trial_start": { + "name": "trial_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "trial_end": { + "name": "trial_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "billing_subscriptions_organization_id_organizations_id_fk": { + "name": "billing_subscriptions_organization_id_organizations_id_fk", + "tableFrom": "billing_subscriptions", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.contracts": { + "name": "contracts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "source_federated_graph_id": { + "name": "source_federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "downstream_federated_graph_id": { + "name": "downstream_federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "exclude_tags": { + "name": "exclude_tags", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by_id": { + "name": "created_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "updated_by_id": { + "name": "updated_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "contracts_source_federated_graph_id_federated_graphs_id_fk": { + "name": "contracts_source_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "contracts", + "tableTo": "federated_graphs", + "columnsFrom": [ + "source_federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "contracts_downstream_federated_graph_id_federated_graphs_id_fk": { + "name": "contracts_downstream_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "contracts", + "tableTo": "federated_graphs", + "columnsFrom": [ + "downstream_federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "contracts_created_by_id_users_id_fk": { + "name": "contracts_created_by_id_users_id_fk", + "tableFrom": "contracts", + "tableTo": "users", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "contracts_updated_by_id_users_id_fk": { + "name": "contracts_updated_by_id_users_id_fk", + "tableFrom": "contracts", + "tableTo": "users", + "columnsFrom": [ + "updated_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "federated_graph_source_downstream_id": { + "name": "federated_graph_source_downstream_id", + "nullsNotDistinct": false, + "columns": [ + "source_federated_graph_id", + "downstream_federated_graph_id" + ] + } + } + }, + "public.discussion_thread": { + "name": "discussion_thread", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "discussion_id": { + "name": "discussion_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "content_markdown": { + "name": "content_markdown", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content_json": { + "name": "content_json", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by_id": { + "name": "created_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "is_deleted": { + "name": "is_deleted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "discussion_thread_discussion_id_discussions_id_fk": { + "name": "discussion_thread_discussion_id_discussions_id_fk", + "tableFrom": "discussion_thread", + "tableTo": "discussions", + "columnsFrom": [ + "discussion_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "discussion_thread_created_by_id_users_id_fk": { + "name": "discussion_thread_created_by_id_users_id_fk", + "tableFrom": "discussion_thread", + "tableTo": "users", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.discussions": { + "name": "discussions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "schema_version_id": { + "name": "schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "reference_line": { + "name": "reference_line", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "is_resolved": { + "name": "is_resolved", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "discussions_target_id_targets_id_fk": { + "name": "discussions_target_id_targets_id_fk", + "tableFrom": "discussions", + "tableTo": "targets", + "columnsFrom": [ + "target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "discussions_schema_version_id_schema_versions_id_fk": { + "name": "discussions_schema_version_id_schema_versions_id_fk", + "tableFrom": "discussions", + "tableTo": "schema_versions", + "columnsFrom": [ + "schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.feature_flags_to_feature_subgraphs": { + "name": "feature_flags_to_feature_subgraphs", + "schema": "", + "columns": { + "feature_flag_id": { + "name": "feature_flag_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "feature_subgraph_id": { + "name": "feature_subgraph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "feature_flags_to_feature_subgraphs_feature_flag_id_feature_flags_id_fk": { + "name": "feature_flags_to_feature_subgraphs_feature_flag_id_feature_flags_id_fk", + "tableFrom": "feature_flags_to_feature_subgraphs", + "tableTo": "feature_flags", + "columnsFrom": [ + "feature_flag_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "feature_flags_to_feature_subgraphs_feature_subgraph_id_subgraphs_id_fk": { + "name": "feature_flags_to_feature_subgraphs_feature_subgraph_id_subgraphs_id_fk", + "tableFrom": "feature_flags_to_feature_subgraphs", + "tableTo": "subgraphs", + "columnsFrom": [ + "feature_subgraph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "feature_flags_to_feature_subgraphs_feature_flag_id_feature_subgraph_id_pk": { + "name": "feature_flags_to_feature_subgraphs_feature_flag_id_feature_subgraph_id_pk", + "columns": [ + "feature_flag_id", + "feature_subgraph_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.feature_flags": { + "name": "feature_flags", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "namespace_id": { + "name": "namespace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "labels": { + "name": "labels", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "is_enabled": { + "name": "is_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "feature_flags_organization_id_organizations_id_fk": { + "name": "feature_flags_organization_id_organizations_id_fk", + "tableFrom": "feature_flags", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "feature_flags_namespace_id_namespaces_id_fk": { + "name": "feature_flags_namespace_id_namespaces_id_fk", + "tableFrom": "feature_flags", + "tableTo": "namespaces", + "columnsFrom": [ + "namespace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "feature_flags_created_by_users_id_fk": { + "name": "feature_flags_created_by_users_id_fk", + "tableFrom": "feature_flags", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.feature_subgraphs_to_base_subgraphs": { + "name": "feature_subgraphs_to_base_subgraphs", + "schema": "", + "columns": { + "feature_subgraph_id": { + "name": "feature_subgraph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "base_subgraph_id": { + "name": "base_subgraph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "feature_subgraphs_to_base_subgraphs_feature_subgraph_id_subgraphs_id_fk": { + "name": "feature_subgraphs_to_base_subgraphs_feature_subgraph_id_subgraphs_id_fk", + "tableFrom": "feature_subgraphs_to_base_subgraphs", + "tableTo": "subgraphs", + "columnsFrom": [ + "feature_subgraph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "feature_subgraphs_to_base_subgraphs_base_subgraph_id_subgraphs_id_fk": { + "name": "feature_subgraphs_to_base_subgraphs_base_subgraph_id_subgraphs_id_fk", + "tableFrom": "feature_subgraphs_to_base_subgraphs", + "tableTo": "subgraphs", + "columnsFrom": [ + "base_subgraph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "feature_subgraphs_to_base_subgraphs_feature_subgraph_id_base_subgraph_id_pk": { + "name": "feature_subgraphs_to_base_subgraphs_feature_subgraph_id_base_subgraph_id_pk", + "columns": [ + "feature_subgraph_id", + "base_subgraph_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.federated_graph_clients": { + "name": "federated_graph_clients", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by_id": { + "name": "created_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "updated_by_id": { + "name": "updated_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "federated_graph_clients_federated_graph_id_federated_graphs_id_fk": { + "name": "federated_graph_clients_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "federated_graph_clients", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_graph_clients_created_by_id_users_id_fk": { + "name": "federated_graph_clients_created_by_id_users_id_fk", + "tableFrom": "federated_graph_clients", + "tableTo": "users", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "federated_graph_clients_updated_by_id_users_id_fk": { + "name": "federated_graph_clients_updated_by_id_users_id_fk", + "tableFrom": "federated_graph_clients", + "tableTo": "users", + "columnsFrom": [ + "updated_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "federated_graph_client_name": { + "name": "federated_graph_client_name", + "nullsNotDistinct": false, + "columns": [ + "federated_graph_id", + "name" + ] + } + } + }, + "public.federated_graph_persisted_operations": { + "name": "federated_graph_persisted_operations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "operation_id": { + "name": "operation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_path": { + "name": "file_path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "operation_names": { + "name": "operation_names", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "operation_content": { + "name": "operation_content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by_id": { + "name": "created_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "updated_by_id": { + "name": "updated_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "federated_graph_persisted_operations_federated_graph_id_federated_graphs_id_fk": { + "name": "federated_graph_persisted_operations_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "federated_graph_persisted_operations", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_graph_persisted_operations_client_id_federated_graph_clients_id_fk": { + "name": "federated_graph_persisted_operations_client_id_federated_graph_clients_id_fk", + "tableFrom": "federated_graph_persisted_operations", + "tableTo": "federated_graph_clients", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_graph_persisted_operations_created_by_id_users_id_fk": { + "name": "federated_graph_persisted_operations_created_by_id_users_id_fk", + "tableFrom": "federated_graph_persisted_operations", + "tableTo": "users", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "federated_graph_persisted_operations_updated_by_id_users_id_fk": { + "name": "federated_graph_persisted_operations_updated_by_id_users_id_fk", + "tableFrom": "federated_graph_persisted_operations", + "tableTo": "users", + "columnsFrom": [ + "updated_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "federated_graph_persisted_operations_file_path_unique": { + "name": "federated_graph_persisted_operations_file_path_unique", + "nullsNotDistinct": false, + "columns": [ + "file_path" + ] + }, + "federated_graph_operation_id": { + "name": "federated_graph_operation_id", + "nullsNotDistinct": false, + "columns": [ + "federated_graph_id", + "client_id", + "operation_id" + ] + } + } + }, + "public.federated_graphs": { + "name": "federated_graphs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "routing_url": { + "name": "routing_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "composed_schema_version_id": { + "name": "composed_schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "admission_webhook_url": { + "name": "admission_webhook_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "admission_webhook_secret": { + "name": "admission_webhook_secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "supports_federation": { + "name": "supports_federation", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + } + }, + "indexes": {}, + "foreignKeys": { + "federated_graphs_target_id_targets_id_fk": { + "name": "federated_graphs_target_id_targets_id_fk", + "tableFrom": "federated_graphs", + "tableTo": "targets", + "columnsFrom": [ + "target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_graphs_composed_schema_version_id_schema_versions_id_fk": { + "name": "federated_graphs_composed_schema_version_id_schema_versions_id_fk", + "tableFrom": "federated_graphs", + "tableTo": "schema_versions", + "columnsFrom": [ + "composed_schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.federated_graphs_to_feature_flag_schema_versions": { + "name": "federated_graphs_to_feature_flag_schema_versions", + "schema": "", + "columns": { + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "base_composition_schema_version_id": { + "name": "base_composition_schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "composed_schema_version_id": { + "name": "composed_schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "feature_flag_id": { + "name": "feature_flag_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "federated_graphs_to_feature_flag_schema_versions_federated_graph_id_federated_graphs_id_fk": { + "name": "federated_graphs_to_feature_flag_schema_versions_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "federated_graphs_to_feature_flag_schema_versions", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_graphs_to_feature_flag_schema_versions_base_composition_schema_version_id_schema_versions_id_fk": { + "name": "federated_graphs_to_feature_flag_schema_versions_base_composition_schema_version_id_schema_versions_id_fk", + "tableFrom": "federated_graphs_to_feature_flag_schema_versions", + "tableTo": "schema_versions", + "columnsFrom": [ + "base_composition_schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_graphs_to_feature_flag_schema_versions_composed_schema_version_id_schema_versions_id_fk": { + "name": "federated_graphs_to_feature_flag_schema_versions_composed_schema_version_id_schema_versions_id_fk", + "tableFrom": "federated_graphs_to_feature_flag_schema_versions", + "tableTo": "schema_versions", + "columnsFrom": [ + "composed_schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_graphs_to_feature_flag_schema_versions_feature_flag_id_feature_flags_id_fk": { + "name": "federated_graphs_to_feature_flag_schema_versions_feature_flag_id_feature_flags_id_fk", + "tableFrom": "federated_graphs_to_feature_flag_schema_versions", + "tableTo": "feature_flags", + "columnsFrom": [ + "feature_flag_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "federated_graphs_to_feature_flag_schema_versions_federated_graph_id_base_composition_schema_version_id_composed_schema_version_id_pk": { + "name": "federated_graphs_to_feature_flag_schema_versions_federated_graph_id_base_composition_schema_version_id_composed_schema_version_id_pk", + "columns": [ + "federated_graph_id", + "base_composition_schema_version_id", + "composed_schema_version_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.field_grace_period": { + "name": "field_grace_period", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "subgraph_id": { + "name": "subgraph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "namespace_id": { + "name": "namespace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "is_deprecated": { + "name": "is_deprecated", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "unique_field_grace_period_idx": { + "name": "unique_field_grace_period_idx", + "columns": [ + { + "expression": "subgraph_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "namespace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_deprecated", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "field_grace_period_subgraph_id_subgraphs_id_fk": { + "name": "field_grace_period_subgraph_id_subgraphs_id_fk", + "tableFrom": "field_grace_period", + "tableTo": "subgraphs", + "columnsFrom": [ + "subgraph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "field_grace_period_organization_id_organizations_id_fk": { + "name": "field_grace_period_organization_id_organizations_id_fk", + "tableFrom": "field_grace_period", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "field_grace_period_namespace_id_namespaces_id_fk": { + "name": "field_grace_period_namespace_id_namespaces_id_fk", + "tableFrom": "field_grace_period", + "tableTo": "namespaces", + "columnsFrom": [ + "namespace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.git_installations": { + "name": "git_installations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "git_installation_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "provider_account_id": { + "name": "provider_account_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "provider_installation_id": { + "name": "provider_installation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "provider_name": { + "name": "provider_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_token": { + "name": "oauth_token", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.graph_api_tokens": { + "name": "graph_api_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "graphApiToken_name_idx": { + "name": "graphApiToken_name_idx", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "federated_graph_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "graph_api_tokens_organization_id_organizations_id_fk": { + "name": "graph_api_tokens_organization_id_organizations_id_fk", + "tableFrom": "graph_api_tokens", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "graph_api_tokens_federated_graph_id_federated_graphs_id_fk": { + "name": "graph_api_tokens_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "graph_api_tokens", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "graph_api_tokens_created_by_users_id_fk": { + "name": "graph_api_tokens_created_by_users_id_fk", + "tableFrom": "graph_api_tokens", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "graph_api_tokens_token_unique": { + "name": "graph_api_tokens_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + } + }, + "public.graph_composition_subgraphs": { + "name": "graph_composition_subgraphs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "graph_composition_id": { + "name": "graph_composition_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "subgraph_id": { + "name": "subgraph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "subgraph_target_id": { + "name": "subgraph_target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "subgraph_name": { + "name": "subgraph_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "schema_version_id": { + "name": "schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "change_type": { + "name": "change_type", + "type": "graph_composition_subgraph_change_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'unchanged'" + }, + "is_feature_subgraph": { + "name": "is_feature_subgraph", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "graph_composition_subgraphs_graph_composition_id_graph_compositions_id_fk": { + "name": "graph_composition_subgraphs_graph_composition_id_graph_compositions_id_fk", + "tableFrom": "graph_composition_subgraphs", + "tableTo": "graph_compositions", + "columnsFrom": [ + "graph_composition_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "graph_composition_subgraphs_schema_version_id_schema_versions_id_fk": { + "name": "graph_composition_subgraphs_schema_version_id_schema_versions_id_fk", + "tableFrom": "graph_composition_subgraphs", + "tableTo": "schema_versions", + "columnsFrom": [ + "schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.graph_compositions": { + "name": "graph_compositions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schema_version_id": { + "name": "schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "is_composable": { + "name": "is_composable", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "composition_errors": { + "name": "composition_errors", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "router_config_signature": { + "name": "router_config_signature", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deployment_error": { + "name": "deployment_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "admission_error": { + "name": "admission_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by_id": { + "name": "created_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_by_email": { + "name": "created_by_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_feature_flag_composition": { + "name": "is_feature_flag_composition", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "graph_compositions_schema_version_id_schema_versions_id_fk": { + "name": "graph_compositions_schema_version_id_schema_versions_id_fk", + "tableFrom": "graph_compositions", + "tableTo": "schema_versions", + "columnsFrom": [ + "schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "graph_compositions_created_by_id_users_id_fk": { + "name": "graph_compositions_created_by_id_users_id_fk", + "tableFrom": "graph_compositions", + "tableTo": "users", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.graph_request_keys": { + "name": "graph_request_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "publicKey": { + "name": "publicKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "graph_request_keys_organization_id_organizations_id_fk": { + "name": "graph_request_keys_organization_id_organizations_id_fk", + "tableFrom": "graph_request_keys", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "graph_request_keys_federated_graph_id_federated_graphs_id_fk": { + "name": "graph_request_keys_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "graph_request_keys", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "graph_request_keys_federated_graph_id_unique": { + "name": "graph_request_keys_federated_graph_id_unique", + "nullsNotDistinct": false, + "columns": [ + "federated_graph_id" + ] + }, + "graph_request_keys_privateKey_unique": { + "name": "graph_request_keys_privateKey_unique", + "nullsNotDistinct": false, + "columns": [ + "privateKey" + ] + }, + "graph_request_keys_publicKey_unique": { + "name": "graph_request_keys_publicKey_unique", + "nullsNotDistinct": false, + "columns": [ + "publicKey" + ] + } + } + }, + "public.namespace_graph_pruning_check_config": { + "name": "namespace_graph_pruning_check_config", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "namespace_id": { + "name": "namespace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "graph_pruning_rule": { + "name": "graph_pruning_rule", + "type": "graph_pruning_rules", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "severity_level": { + "name": "severity_level", + "type": "lint_severity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "grace_period": { + "name": "grace_period", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "scheme_usage_check_period": { + "name": "scheme_usage_check_period", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "namespace_graph_pruning_check_config_namespace_id_namespaces_id_fk": { + "name": "namespace_graph_pruning_check_config_namespace_id_namespaces_id_fk", + "tableFrom": "namespace_graph_pruning_check_config", + "tableTo": "namespaces", + "columnsFrom": [ + "namespace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.namespace_lint_check_config": { + "name": "namespace_lint_check_config", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "namespace_id": { + "name": "namespace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "lint_rule": { + "name": "lint_rule", + "type": "lint_rules", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "severity_level": { + "name": "severity_level", + "type": "lint_severity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "namespace_lint_check_config_namespace_id_namespaces_id_fk": { + "name": "namespace_lint_check_config_namespace_id_namespaces_id_fk", + "tableFrom": "namespace_lint_check_config", + "tableTo": "namespaces", + "columnsFrom": [ + "namespace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.namespaces": { + "name": "namespaces", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "enable_linting": { + "name": "enable_linting", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "enable_graph_pruning": { + "name": "enable_graph_pruning", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "namespaces_organization_id_organizations_id_fk": { + "name": "namespaces_organization_id_organizations_id_fk", + "tableFrom": "namespaces", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "namespaces_created_by_users_id_fk": { + "name": "namespaces_created_by_users_id_fk", + "tableFrom": "namespaces", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_name": { + "name": "unique_name", + "nullsNotDistinct": false, + "columns": [ + "name", + "organization_id" + ] + } + } + }, + "public.oidc_providers": { + "name": "oidc_providers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "alias": { + "name": "alias", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "oidc_providers_organization_id_organizations_id_fk": { + "name": "oidc_providers_organization_id_organizations_id_fk", + "tableFrom": "oidc_providers", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "oidc_providers_alias_unique": { + "name": "oidc_providers_alias_unique", + "nullsNotDistinct": false, + "columns": [ + "alias" + ] + } + } + }, + "public.operation_change_overrides": { + "name": "operation_change_overrides", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "namespace_id": { + "name": "namespace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "change_type": { + "name": "change_type", + "type": "schema_change_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "hash_change_idx": { + "name": "hash_change_idx", + "columns": [ + { + "expression": "hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "namespace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "change_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "operation_change_overrides_created_by_users_id_fk": { + "name": "operation_change_overrides_created_by_users_id_fk", + "tableFrom": "operation_change_overrides", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.operation_ignore_all_overrides": { + "name": "operation_ignore_all_overrides", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "namespace_id": { + "name": "namespace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "hash_namespace_ignore_idx": { + "name": "hash_namespace_ignore_idx", + "columns": [ + { + "expression": "hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "namespace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "operation_ignore_all_overrides_created_by_users_id_fk": { + "name": "operation_ignore_all_overrides_created_by_users_id_fk", + "tableFrom": "operation_ignore_all_overrides", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.organization_billing": { + "name": "organization_billing", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "plan": { + "name": "plan", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stripe_customer_id": { + "name": "stripe_customer_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "organization_billing_idx": { + "name": "organization_billing_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organization_billing_stripe_idx": { + "name": "organization_billing_stripe_idx", + "columns": [ + { + "expression": "stripe_customer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_billing_organization_id_organizations_id_fk": { + "name": "organization_billing_organization_id_organizations_id_fk", + "tableFrom": "organization_billing", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.organization_features": { + "name": "organization_features", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "feature": { + "name": "feature", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "limit": { + "name": "limit", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "organization_feature_idx": { + "name": "organization_feature_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "feature", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_features_organization_id_organizations_id_fk": { + "name": "organization_features_organization_id_organizations_id_fk", + "tableFrom": "organization_features", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.organization_integrations": { + "name": "organization_integrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "events": { + "name": "events", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "integration_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "organization_integration_idx": { + "name": "organization_integration_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_integrations_organization_id_organizations_id_fk": { + "name": "organization_integrations_organization_id_organizations_id_fk", + "tableFrom": "organization_integrations", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.organization_invitations": { + "name": "organization_invitations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "invited_by": { + "name": "invited_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "accepted": { + "name": "accepted", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "organization_invitations_organization_id_organizations_id_fk": { + "name": "organization_invitations_organization_id_organizations_id_fk", + "tableFrom": "organization_invitations", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "organization_invitations_user_id_users_id_fk": { + "name": "organization_invitations_user_id_users_id_fk", + "tableFrom": "organization_invitations", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "organization_invitations_invited_by_users_id_fk": { + "name": "organization_invitations_invited_by_users_id_fk", + "tableFrom": "organization_invitations", + "tableTo": "users", + "columnsFrom": [ + "invited_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.organization_member_roles": { + "name": "organization_member_roles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_member_id": { + "name": "organization_member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "member_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "organization_member_role_idx": { + "name": "organization_member_role_idx", + "columns": [ + { + "expression": "organization_member_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "role", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_member_roles_organization_member_id_organization_members_id_fk": { + "name": "organization_member_roles_organization_member_id_organization_members_id_fk", + "tableFrom": "organization_member_roles", + "tableTo": "organization_members", + "columnsFrom": [ + "organization_member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.organization_webhook_configs": { + "name": "organization_webhook_configs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "events": { + "name": "events", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "organization_webhook_configs_organization_id_organizations_id_fk": { + "name": "organization_webhook_configs_organization_id_organizations_id_fk", + "tableFrom": "organization_webhook_configs", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.organizations": { + "name": "organizations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "invite_code": { + "name": "invite_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_deactivated": { + "name": "is_deactivated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "deactivation_reason": { + "name": "deactivation_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deactivated_at": { + "name": "deactivated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "organizations_user_id_users_id_fk": { + "name": "organizations_user_id_users_id_fk", + "tableFrom": "organizations", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organizations_slug_unique": { + "name": "organizations_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + } + }, + "public.organization_members": { + "name": "organization_members", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "organization_member_idx": { + "name": "organization_member_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "unique_organization_member_idx": { + "name": "unique_organization_member_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_members_user_id_users_id_fk": { + "name": "organization_members_user_id_users_id_fk", + "tableFrom": "organization_members", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "organization_members_organization_id_organizations_id_fk": { + "name": "organization_members_organization_id_organizations_id_fk", + "tableFrom": "organization_members", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_check_change_action": { + "name": "schema_check_change_action", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schema_check_id": { + "name": "schema_check_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "change_type": { + "name": "change_type", + "type": "schema_change_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "change_message": { + "name": "change_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_breaking": { + "name": "is_breaking", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "schema_check_change_action_schema_check_id_schema_checks_id_fk": { + "name": "schema_check_change_action_schema_check_id_schema_checks_id_fk", + "tableFrom": "schema_check_change_action", + "tableTo": "schema_checks", + "columnsFrom": [ + "schema_check_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_check_change_operation_usage": { + "name": "schema_check_change_operation_usage", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schema_check_change_action_id": { + "name": "schema_check_change_action_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "first_seen_at": { + "name": "first_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "is_safe_override": { + "name": "is_safe_override", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "schema_check_change_operation_usage_schema_check_change_action_id_schema_check_change_action_id_fk": { + "name": "schema_check_change_operation_usage_schema_check_change_action_id_schema_check_change_action_id_fk", + "tableFrom": "schema_check_change_operation_usage", + "tableTo": "schema_check_change_action", + "columnsFrom": [ + "schema_check_change_action_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schema_check_change_operation_usage_federated_graph_id_federated_graphs_id_fk": { + "name": "schema_check_change_operation_usage_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "schema_check_change_operation_usage", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_check_composition": { + "name": "schema_check_composition", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schema_check_id": { + "name": "schema_check_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "composition_errors": { + "name": "composition_errors", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "composed_schema_sdl": { + "name": "composed_schema_sdl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "client_schema": { + "name": "client_schema", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "schema_check_composition_schema_check_id_schema_checks_id_fk": { + "name": "schema_check_composition_schema_check_id_schema_checks_id_fk", + "tableFrom": "schema_check_composition", + "tableTo": "schema_checks", + "columnsFrom": [ + "schema_check_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schema_check_composition_target_id_targets_id_fk": { + "name": "schema_check_composition_target_id_targets_id_fk", + "tableFrom": "schema_check_composition", + "tableTo": "targets", + "columnsFrom": [ + "target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_check_federated_graphs": { + "name": "schema_check_federated_graphs", + "schema": "", + "columns": { + "check_id": { + "name": "check_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "traffic_check_days": { + "name": "traffic_check_days", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "schema_check_federated_graphs_check_id_schema_checks_id_fk": { + "name": "schema_check_federated_graphs_check_id_schema_checks_id_fk", + "tableFrom": "schema_check_federated_graphs", + "tableTo": "schema_checks", + "columnsFrom": [ + "check_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schema_check_federated_graphs_federated_graph_id_federated_graphs_id_fk": { + "name": "schema_check_federated_graphs_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "schema_check_federated_graphs", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_check_graph_pruning_action": { + "name": "schema_check_graph_pruning_action", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schema_check_id": { + "name": "schema_check_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "graph_pruning_rule": { + "name": "graph_pruning_rule", + "type": "graph_pruning_rules", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "field_path": { + "name": "field_path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_error": { + "name": "is_error", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "location": { + "name": "location", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "schema_check_graph_pruning_action_schema_check_id_schema_checks_id_fk": { + "name": "schema_check_graph_pruning_action_schema_check_id_schema_checks_id_fk", + "tableFrom": "schema_check_graph_pruning_action", + "tableTo": "schema_checks", + "columnsFrom": [ + "schema_check_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schema_check_graph_pruning_action_federated_graph_id_federated_graphs_id_fk": { + "name": "schema_check_graph_pruning_action_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "schema_check_graph_pruning_action", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_check_lint_action": { + "name": "schema_check_lint_action", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schema_check_id": { + "name": "schema_check_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "lint_rule_type": { + "name": "lint_rule_type", + "type": "lint_rules", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_error": { + "name": "is_error", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "location": { + "name": "location", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "schema_check_lint_action_schema_check_id_schema_checks_id_fk": { + "name": "schema_check_lint_action_schema_check_id_schema_checks_id_fk", + "tableFrom": "schema_check_lint_action", + "tableTo": "schema_checks", + "columnsFrom": [ + "schema_check_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_checks": { + "name": "schema_checks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "is_composable": { + "name": "is_composable", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_deleted": { + "name": "is_deleted", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "has_breaking_changes": { + "name": "has_breaking_changes", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "has_lint_errors": { + "name": "has_lint_errors", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "has_graph_pruning_errors": { + "name": "has_graph_pruning_errors", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "has_client_traffic": { + "name": "has_client_traffic", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "client_traffic_check_skipped": { + "name": "client_traffic_check_skipped", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lint_skipped": { + "name": "lint_skipped", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "graph_pruning_skipped": { + "name": "graph_pruning_skipped", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "proposed_subgraph_schema_sdl": { + "name": "proposed_subgraph_schema_sdl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "gh_details": { + "name": "gh_details", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "forced_success": { + "name": "forced_success", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "vcs_context": { + "name": "vcs_context", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "schema_checks_target_id_targets_id_fk": { + "name": "schema_checks_target_id_targets_id_fk", + "tableFrom": "schema_checks", + "tableTo": "targets", + "columnsFrom": [ + "target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_versions": { + "name": "schema_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "schema_sdl": { + "name": "schema_sdl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "client_schema": { + "name": "client_schema", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_v2_graph": { + "name": "is_v2_graph", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "schema_versions_organization_id_organizations_id_fk": { + "name": "schema_versions_organization_id_organizations_id_fk", + "tableFrom": "schema_versions", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schema_version_change_action": { + "name": "schema_version_change_action", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schema_version_id": { + "name": "schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "change_type": { + "name": "change_type", + "type": "schema_change_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "change_message": { + "name": "change_message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "schema_version_change_action_schema_version_id_schema_versions_id_fk": { + "name": "schema_version_change_action_schema_version_id_schema_versions_id_fk", + "tableFrom": "schema_version_change_action", + "tableTo": "schema_versions", + "columnsFrom": [ + "schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.sessions": { + "name": "sessions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "sessions_user_id_users_id_fk": { + "name": "sessions_user_id_users_id_fk", + "tableFrom": "sessions", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "sessions_user_id_unique": { + "name": "sessions_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "user_id" + ] + } + } + }, + "public.slack_installations": { + "name": "slack_installations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slack_organization_id": { + "name": "slack_organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slack_organization_name": { + "name": "slack_organization_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slack_channel_id": { + "name": "slack_channel_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slack_channel_name": { + "name": "slack_channel_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slack_user_id": { + "name": "slack_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "slack_installations_idx": { + "name": "slack_installations_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slack_organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slack_channel_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "slack_installations_organization_id_organizations_id_fk": { + "name": "slack_installations_organization_id_organizations_id_fk", + "tableFrom": "slack_installations", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.slack_integration_configs": { + "name": "slack_integration_configs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "integration_id": { + "name": "integration_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "slack_integration_configs_integration_id_organization_integrations_id_fk": { + "name": "slack_integration_configs_integration_id_organization_integrations_id_fk", + "tableFrom": "slack_integration_configs", + "tableTo": "organization_integrations", + "columnsFrom": [ + "integration_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.slack_schema_update_event_configs": { + "name": "slack_schema_update_event_configs", + "schema": "", + "columns": { + "slack_integration_config_id": { + "name": "slack_integration_config_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "slack_schema_update_event_configs_slack_integration_config_id_slack_integration_configs_id_fk": { + "name": "slack_schema_update_event_configs_slack_integration_config_id_slack_integration_configs_id_fk", + "tableFrom": "slack_schema_update_event_configs", + "tableTo": "slack_integration_configs", + "columnsFrom": [ + "slack_integration_config_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "slack_schema_update_event_configs_federated_graph_id_federated_graphs_id_fk": { + "name": "slack_schema_update_event_configs_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "slack_schema_update_event_configs", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "slack_schema_update_event_configs_slack_integration_config_id_federated_graph_id_pk": { + "name": "slack_schema_update_event_configs_slack_integration_config_id_federated_graph_id_pk", + "columns": [ + "slack_integration_config_id", + "federated_graph_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.subgraph_members": { + "name": "subgraph_members", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "subgraph_id": { + "name": "subgraph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "unique_subgraph_member_idx": { + "name": "unique_subgraph_member_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "subgraph_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "subgraph_members_user_id_users_id_fk": { + "name": "subgraph_members_user_id_users_id_fk", + "tableFrom": "subgraph_members", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "subgraph_members_subgraph_id_subgraphs_id_fk": { + "name": "subgraph_members_subgraph_id_subgraphs_id_fk", + "tableFrom": "subgraph_members", + "tableTo": "subgraphs", + "columnsFrom": [ + "subgraph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.subgraphs": { + "name": "subgraphs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "routing_url": { + "name": "routing_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subscription_url": { + "name": "subscription_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subscription_protocol": { + "name": "subscription_protocol", + "type": "subscription_protocol", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'ws'" + }, + "websocket_subprotocol": { + "name": "websocket_subprotocol", + "type": "websocket_subprotocol", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'auto'" + }, + "schema_version_id": { + "name": "schema_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "is_feature_subgraph": { + "name": "is_feature_subgraph", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_event_driven_graph": { + "name": "is_event_driven_graph", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "subgraphs_schema_version_id_schema_versions_id_fk": { + "name": "subgraphs_schema_version_id_schema_versions_id_fk", + "tableFrom": "subgraphs", + "tableTo": "schema_versions", + "columnsFrom": [ + "schema_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "subgraphs_target_id_targets_id_fk": { + "name": "subgraphs_target_id_targets_id_fk", + "tableFrom": "subgraphs", + "tableTo": "targets", + "columnsFrom": [ + "target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.federated_subgraphs": { + "name": "federated_subgraphs", + "schema": "", + "columns": { + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "subgraph_id": { + "name": "subgraph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "federated_subgraphs_federated_graph_id_federated_graphs_id_fk": { + "name": "federated_subgraphs_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "federated_subgraphs", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "federated_subgraphs_subgraph_id_subgraphs_id_fk": { + "name": "federated_subgraphs_subgraph_id_subgraphs_id_fk", + "tableFrom": "federated_subgraphs", + "tableTo": "subgraphs", + "columnsFrom": [ + "subgraph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "federated_subgraphs_federated_graph_id_subgraph_id_pk": { + "name": "federated_subgraphs_federated_graph_id_subgraph_id_pk", + "columns": [ + "federated_graph_id", + "subgraph_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.target_label_matchers": { + "name": "target_label_matchers", + "schema": "", + "columns": { + "target_id": { + "name": "target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "label_matcher": { + "name": "label_matcher", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "target_label_matchers_target_id_targets_id_fk": { + "name": "target_label_matchers_target_id_targets_id_fk", + "tableFrom": "target_label_matchers", + "tableTo": "targets", + "columnsFrom": [ + "target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.targets": { + "name": "targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "target_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "labels": { + "name": "labels", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "readme": { + "name": "readme", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "namespace_id": { + "name": "namespace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "organization_name_idx": { + "name": "organization_name_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "namespace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "targets_organization_id_organizations_id_fk": { + "name": "targets_organization_id_organizations_id_fk", + "tableFrom": "targets", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "targets_created_by_users_id_fk": { + "name": "targets_created_by_users_id_fk", + "tableFrom": "targets", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "targets_namespace_id_namespaces_id_fk": { + "name": "targets_namespace_id_namespaces_id_fk", + "tableFrom": "targets", + "tableTo": "namespaces", + "columnsFrom": [ + "namespace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_email_unique": { + "name": "users_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + } + }, + "public.webhook_deliveries": { + "name": "webhook_deliveries", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by_id": { + "name": "created_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "webhook_delivery_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "event_name": { + "name": "event_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "request_headers": { + "name": "request_headers", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "response_headers": { + "name": "response_headers", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "response_status_code": { + "name": "response_status_code", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "response_error_code": { + "name": "response_error_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "response_body": { + "name": "response_body", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "retry_count": { + "name": "retry_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "duration": { + "name": "duration", + "type": "real", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "original_delivery_id": { + "name": "original_delivery_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "webhook_deliveries_created_by_id_users_id_fk": { + "name": "webhook_deliveries_created_by_id_users_id_fk", + "tableFrom": "webhook_deliveries", + "tableTo": "users", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "webhook_deliveries_organization_id_organizations_id_fk": { + "name": "webhook_deliveries_organization_id_organizations_id_fk", + "tableFrom": "webhook_deliveries", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.webhook_graph_schema_update": { + "name": "webhook_graph_schema_update", + "schema": "", + "columns": { + "webhook_id": { + "name": "webhook_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "federated_graph_id": { + "name": "federated_graph_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "webhook_graph_schema_update_webhook_id_organization_webhook_configs_id_fk": { + "name": "webhook_graph_schema_update_webhook_id_organization_webhook_configs_id_fk", + "tableFrom": "webhook_graph_schema_update", + "tableTo": "organization_webhook_configs", + "columnsFrom": [ + "webhook_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "webhook_graph_schema_update_federated_graph_id_federated_graphs_id_fk": { + "name": "webhook_graph_schema_update_federated_graph_id_federated_graphs_id_fk", + "tableFrom": "webhook_graph_schema_update", + "tableTo": "federated_graphs", + "columnsFrom": [ + "federated_graph_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "webhook_graph_schema_update_webhook_id_federated_graph_id_pk": { + "name": "webhook_graph_schema_update_webhook_id_federated_graph_id_pk", + "columns": [ + "webhook_id", + "federated_graph_id" + ] + } + }, + "uniqueConstraints": {} + } + }, + "enums": { + "public.git_installation_type": { + "name": "git_installation_type", + "schema": "public", + "values": [ + "PERSONAL", + "ORGANIZATION" + ] + }, + "public.graph_composition_subgraph_change_type": { + "name": "graph_composition_subgraph_change_type", + "schema": "public", + "values": [ + "added", + "removed", + "updated", + "unchanged" + ] + }, + "public.graph_pruning_rules": { + "name": "graph_pruning_rules", + "schema": "public", + "values": [ + "UNUSED_FIELDS", + "DEPRECATED_FIELDS", + "REQUIRE_DEPRECATION_BEFORE_DELETION" + ] + }, + "public.integration_type": { + "name": "integration_type", + "schema": "public", + "values": [ + "slack" + ] + }, + "public.lint_rules": { + "name": "lint_rules", + "schema": "public", + "values": [ + "FIELD_NAMES_SHOULD_BE_CAMEL_CASE", + "TYPE_NAMES_SHOULD_BE_PASCAL_CASE", + "SHOULD_NOT_HAVE_TYPE_PREFIX", + "SHOULD_NOT_HAVE_TYPE_SUFFIX", + "SHOULD_NOT_HAVE_INPUT_PREFIX", + "SHOULD_HAVE_INPUT_SUFFIX", + "SHOULD_NOT_HAVE_ENUM_PREFIX", + "SHOULD_NOT_HAVE_ENUM_SUFFIX", + "SHOULD_NOT_HAVE_INTERFACE_PREFIX", + "SHOULD_NOT_HAVE_INTERFACE_SUFFIX", + "ENUM_VALUES_SHOULD_BE_UPPER_CASE", + "ORDER_FIELDS", + "ORDER_ENUM_VALUES", + "ORDER_DEFINITIONS", + "ALL_TYPES_REQUIRE_DESCRIPTION", + "DISALLOW_CASE_INSENSITIVE_ENUM_VALUES", + "NO_TYPENAME_PREFIX_IN_TYPE_FIELDS", + "REQUIRE_DEPRECATION_REASON" + ] + }, + "public.lint_severity": { + "name": "lint_severity", + "schema": "public", + "values": [ + "warn", + "error" + ] + }, + "public.member_role": { + "name": "member_role", + "schema": "public", + "values": [ + "admin", + "developer", + "viewer" + ] + }, + "public.schema_change_type": { + "name": "schema_change_type", + "schema": "public", + "values": [ + "FIELD_ARGUMENT_DESCRIPTION_CHANGED", + "FIELD_ARGUMENT_DEFAULT_CHANGED", + "FIELD_ARGUMENT_TYPE_CHANGED", + "DIRECTIVE_REMOVED", + "DIRECTIVE_ADDED", + "DIRECTIVE_DESCRIPTION_CHANGED", + "DIRECTIVE_LOCATION_ADDED", + "DIRECTIVE_LOCATION_REMOVED", + "DIRECTIVE_ARGUMENT_ADDED", + "DIRECTIVE_ARGUMENT_REMOVED", + "DIRECTIVE_ARGUMENT_DESCRIPTION_CHANGED", + "DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED", + "DIRECTIVE_ARGUMENT_TYPE_CHANGED", + "ENUM_VALUE_REMOVED", + "ENUM_VALUE_ADDED", + "ENUM_VALUE_DESCRIPTION_CHANGED", + "ENUM_VALUE_DEPRECATION_REASON_CHANGED", + "ENUM_VALUE_DEPRECATION_REASON_ADDED", + "ENUM_VALUE_DEPRECATION_REASON_REMOVED", + "FIELD_REMOVED", + "FIELD_ADDED", + "FIELD_DESCRIPTION_CHANGED", + "FIELD_DESCRIPTION_ADDED", + "FIELD_DESCRIPTION_REMOVED", + "FIELD_DEPRECATION_ADDED", + "FIELD_DEPRECATION_REMOVED", + "FIELD_DEPRECATION_REASON_CHANGED", + "FIELD_DEPRECATION_REASON_ADDED", + "FIELD_DEPRECATION_REASON_REMOVED", + "FIELD_TYPE_CHANGED", + "FIELD_ARGUMENT_ADDED", + "FIELD_ARGUMENT_REMOVED", + "INPUT_FIELD_REMOVED", + "INPUT_FIELD_ADDED", + "INPUT_FIELD_DESCRIPTION_ADDED", + "INPUT_FIELD_DESCRIPTION_REMOVED", + "INPUT_FIELD_DESCRIPTION_CHANGED", + "INPUT_FIELD_DEFAULT_VALUE_CHANGED", + "INPUT_FIELD_TYPE_CHANGED", + "OBJECT_TYPE_INTERFACE_ADDED", + "OBJECT_TYPE_INTERFACE_REMOVED", + "SCHEMA_QUERY_TYPE_CHANGED", + "SCHEMA_MUTATION_TYPE_CHANGED", + "SCHEMA_SUBSCRIPTION_TYPE_CHANGED", + "TYPE_REMOVED", + "TYPE_ADDED", + "TYPE_KIND_CHANGED", + "TYPE_DESCRIPTION_CHANGED", + "TYPE_DESCRIPTION_REMOVED", + "TYPE_DESCRIPTION_ADDED", + "UNION_MEMBER_REMOVED", + "UNION_MEMBER_ADDED" + ] + }, + "public.subscription_protocol": { + "name": "subscription_protocol", + "schema": "public", + "values": [ + "ws", + "sse", + "sse_post" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "incomplete", + "incomplete_expired", + "trialing", + "active", + "past_due", + "canceled", + "unpaid", + "paused" + ] + }, + "public.target_type": { + "name": "target_type", + "schema": "public", + "values": [ + "federated", + "subgraph" + ] + }, + "public.webhook_delivery_type": { + "name": "webhook_delivery_type", + "schema": "public", + "values": [ + "webhook", + "slack", + "admission" + ] + }, + "public.websocket_subprotocol": { + "name": "websocket_subprotocol", + "schema": "public", + "values": [ + "auto", + "graphql-ws", + "graphql-transport-ws" + ] + } + }, + "schemas": {}, + "sequences": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/controlplane/migrations/meta/_journal.json b/controlplane/migrations/meta/_journal.json index dca013d0b4..a1b72649d0 100644 --- a/controlplane/migrations/meta/_journal.json +++ b/controlplane/migrations/meta/_journal.json @@ -715,6 +715,13 @@ "when": 1728381511294, "tag": "0101_new_domino", "breakpoints": true + }, + { + "idx": 102, + "version": "7", + "when": 1729765148840, + "tag": "0102_common_tiger_shark", + "breakpoints": true } ] } \ No newline at end of file diff --git a/controlplane/src/db/schema.ts b/controlplane/src/db/schema.ts index feabbd6aa5..8050b80170 100644 --- a/controlplane/src/db/schema.ts +++ b/controlplane/src/db/schema.ts @@ -223,7 +223,7 @@ export const subgraphs = pgTable('subgraphs', { websocketSubprotocol: websocketSubprotocolEnum('websocket_subprotocol').notNull().default('auto'), // This is the latest valid schema of the subgraph. schemaVersionId: uuid('schema_version_id').references(() => schemaVersion.id, { - onDelete: 'no action', + onDelete: 'set null', }), targetId: uuid('target_id') .notNull()