1+ CREATE TABLE "accounts " (
2+ " id" text PRIMARY KEY NOT NULL ,
3+ " created_at" timestamp with time zone DEFAULT now() NOT NULL
4+ );
5+ -- > statement-breakpoint
6+ CREATE TABLE "memberships " (
7+ " account_id" text NOT NULL ,
8+ " organization_id" text NOT NULL ,
9+ " created_at" timestamp with time zone DEFAULT now() NOT NULL ,
10+ CONSTRAINT " memberships_account_id_organization_id_pk" PRIMARY KEY (" account_id" ," organization_id" )
11+ );
12+ -- > statement-breakpoint
13+ CREATE TABLE "organizations " (
14+ " id" text PRIMARY KEY NOT NULL ,
15+ " name" text NOT NULL ,
16+ " created_at" timestamp with time zone DEFAULT now() NOT NULL
17+ );
18+ -- > statement-breakpoint
19+ CREATE TABLE "blob " (
20+ " namespace" text NOT NULL ,
21+ " key" text NOT NULL ,
22+ " value" text NOT NULL ,
23+ CONSTRAINT " blob_namespace_key_pk" PRIMARY KEY (" namespace" ," key" )
24+ );
25+ -- > statement-breakpoint
26+ CREATE TABLE "definition " (
27+ " id" text NOT NULL ,
28+ " scope_id" text NOT NULL ,
29+ " source_id" text NOT NULL ,
30+ " plugin_id" text NOT NULL ,
31+ " name" text NOT NULL ,
32+ " schema" jsonb NOT NULL ,
33+ " created_at" timestamp NOT NULL ,
34+ CONSTRAINT " definition_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
35+ );
36+ -- > statement-breakpoint
37+ CREATE TABLE "graphql_operation " (
38+ " id" text NOT NULL ,
39+ " scope_id" text NOT NULL ,
40+ " source_id" text NOT NULL ,
41+ " binding" jsonb NOT NULL ,
42+ CONSTRAINT " graphql_operation_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
43+ );
44+ -- > statement-breakpoint
45+ CREATE TABLE "graphql_source " (
46+ " id" text NOT NULL ,
47+ " scope_id" text NOT NULL ,
48+ " name" text NOT NULL ,
49+ " endpoint" text NOT NULL ,
50+ " headers" jsonb,
51+ CONSTRAINT " graphql_source_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
52+ );
53+ -- > statement-breakpoint
54+ CREATE TABLE "mcp_binding " (
55+ " id" text NOT NULL ,
56+ " scope_id" text NOT NULL ,
57+ " source_id" text NOT NULL ,
58+ " binding" jsonb NOT NULL ,
59+ " created_at" timestamp NOT NULL ,
60+ CONSTRAINT " mcp_binding_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
61+ );
62+ -- > statement-breakpoint
63+ CREATE TABLE "mcp_oauth_session " (
64+ " id" text NOT NULL ,
65+ " scope_id" text NOT NULL ,
66+ " session" jsonb NOT NULL ,
67+ " expires_at" integer NOT NULL ,
68+ " created_at" timestamp NOT NULL ,
69+ CONSTRAINT " mcp_oauth_session_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
70+ );
71+ -- > statement-breakpoint
72+ CREATE TABLE "mcp_source " (
73+ " id" text NOT NULL ,
74+ " scope_id" text NOT NULL ,
75+ " name" text NOT NULL ,
76+ " config" jsonb NOT NULL ,
77+ " created_at" timestamp NOT NULL ,
78+ CONSTRAINT " mcp_source_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
79+ );
80+ -- > statement-breakpoint
81+ CREATE TABLE "openapi_oauth_session " (
82+ " id" text NOT NULL ,
83+ " scope_id" text NOT NULL ,
84+ " session" jsonb NOT NULL ,
85+ " created_at" timestamp NOT NULL ,
86+ CONSTRAINT " openapi_oauth_session_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
87+ );
88+ -- > statement-breakpoint
89+ CREATE TABLE "openapi_operation " (
90+ " id" text NOT NULL ,
91+ " scope_id" text NOT NULL ,
92+ " source_id" text NOT NULL ,
93+ " binding" jsonb NOT NULL ,
94+ CONSTRAINT " openapi_operation_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
95+ );
96+ -- > statement-breakpoint
97+ CREATE TABLE "openapi_source " (
98+ " id" text NOT NULL ,
99+ " scope_id" text NOT NULL ,
100+ " name" text NOT NULL ,
101+ " spec" text NOT NULL ,
102+ " base_url" text ,
103+ " headers" jsonb,
104+ " oauth2" jsonb,
105+ " invocation_config" jsonb NOT NULL ,
106+ CONSTRAINT " openapi_source_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
107+ );
108+ -- > statement-breakpoint
109+ CREATE TABLE "secret " (
110+ " id" text NOT NULL ,
111+ " scope_id" text NOT NULL ,
112+ " name" text NOT NULL ,
113+ " provider" text NOT NULL ,
114+ " created_at" timestamp NOT NULL ,
115+ CONSTRAINT " secret_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
116+ );
117+ -- > statement-breakpoint
118+ CREATE TABLE "source " (
119+ " id" text NOT NULL ,
120+ " scope_id" text NOT NULL ,
121+ " plugin_id" text NOT NULL ,
122+ " kind" text NOT NULL ,
123+ " name" text NOT NULL ,
124+ " url" text ,
125+ " can_remove" boolean DEFAULT true NOT NULL ,
126+ " can_refresh" boolean DEFAULT false NOT NULL ,
127+ " can_edit" boolean DEFAULT false NOT NULL ,
128+ " created_at" timestamp NOT NULL ,
129+ " updated_at" timestamp NOT NULL ,
130+ CONSTRAINT " source_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
131+ );
132+ -- > statement-breakpoint
133+ CREATE TABLE "tool " (
134+ " id" text NOT NULL ,
135+ " scope_id" text NOT NULL ,
136+ " source_id" text NOT NULL ,
137+ " plugin_id" text NOT NULL ,
138+ " name" text NOT NULL ,
139+ " description" text NOT NULL ,
140+ " input_schema" jsonb,
141+ " output_schema" jsonb,
142+ " created_at" timestamp NOT NULL ,
143+ " updated_at" timestamp NOT NULL ,
144+ CONSTRAINT " tool_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
145+ );
146+ -- > statement-breakpoint
147+ CREATE TABLE "workos_vault_metadata " (
148+ " id" text NOT NULL ,
149+ " scope_id" text NOT NULL ,
150+ " name" text NOT NULL ,
151+ " purpose" text ,
152+ " created_at" timestamp NOT NULL ,
153+ CONSTRAINT " workos_vault_metadata_scope_id_id_pk" PRIMARY KEY (" scope_id" ," id" )
154+ );
155+ -- > statement-breakpoint
156+ ALTER TABLE " memberships" ADD CONSTRAINT " memberships_account_id_accounts_id_fk" FOREIGN KEY (" account_id" ) REFERENCES " public" ." accounts" (" id" ) ON DELETE cascade ON UPDATE no action;-- > statement-breakpoint
157+ ALTER TABLE " memberships" ADD CONSTRAINT " memberships_organization_id_organizations_id_fk" FOREIGN KEY (" organization_id" ) REFERENCES " public" ." organizations" (" id" ) ON DELETE cascade ON UPDATE no action;-- > statement-breakpoint
158+ CREATE INDEX "definition_scope_id_idx " ON " definition" USING btree (" scope_id" );-- > statement-breakpoint
159+ CREATE INDEX "definition_source_id_idx " ON " definition" USING btree (" source_id" );-- > statement-breakpoint
160+ CREATE INDEX "definition_plugin_id_idx " ON " definition" USING btree (" plugin_id" );-- > statement-breakpoint
161+ CREATE INDEX "graphql_operation_scope_id_idx " ON " graphql_operation" USING btree (" scope_id" );-- > statement-breakpoint
162+ CREATE INDEX "graphql_operation_source_id_idx " ON " graphql_operation" USING btree (" source_id" );-- > statement-breakpoint
163+ CREATE INDEX "graphql_source_scope_id_idx " ON " graphql_source" USING btree (" scope_id" );-- > statement-breakpoint
164+ CREATE INDEX "mcp_binding_scope_id_idx " ON " mcp_binding" USING btree (" scope_id" );-- > statement-breakpoint
165+ CREATE INDEX "mcp_binding_source_id_idx " ON " mcp_binding" USING btree (" source_id" );-- > statement-breakpoint
166+ CREATE INDEX "mcp_oauth_session_scope_id_idx " ON " mcp_oauth_session" USING btree (" scope_id" );-- > statement-breakpoint
167+ CREATE INDEX "mcp_source_scope_id_idx " ON " mcp_source" USING btree (" scope_id" );-- > statement-breakpoint
168+ CREATE INDEX "openapi_oauth_session_scope_id_idx " ON " openapi_oauth_session" USING btree (" scope_id" );-- > statement-breakpoint
169+ CREATE INDEX "openapi_operation_scope_id_idx " ON " openapi_operation" USING btree (" scope_id" );-- > statement-breakpoint
170+ CREATE INDEX "openapi_operation_source_id_idx " ON " openapi_operation" USING btree (" source_id" );-- > statement-breakpoint
171+ CREATE INDEX "openapi_source_scope_id_idx " ON " openapi_source" USING btree (" scope_id" );-- > statement-breakpoint
172+ CREATE INDEX "secret_scope_id_idx " ON " secret" USING btree (" scope_id" );-- > statement-breakpoint
173+ CREATE INDEX "secret_provider_idx " ON " secret" USING btree (" provider" );-- > statement-breakpoint
174+ CREATE INDEX "source_scope_id_idx " ON " source" USING btree (" scope_id" );-- > statement-breakpoint
175+ CREATE INDEX "source_plugin_id_idx " ON " source" USING btree (" plugin_id" );-- > statement-breakpoint
176+ CREATE INDEX "tool_scope_id_idx " ON " tool" USING btree (" scope_id" );-- > statement-breakpoint
177+ CREATE INDEX "tool_source_id_idx " ON " tool" USING btree (" source_id" );-- > statement-breakpoint
178+ CREATE INDEX "tool_plugin_id_idx " ON " tool" USING btree (" plugin_id" );-- > statement-breakpoint
179+ CREATE INDEX "workos_vault_metadata_scope_id_idx " ON " workos_vault_metadata" USING btree (" scope_id" );
0 commit comments