@onequery/cli 0.1.56-win32-arm64 → 0.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/bin/onequery.js +266 -0
  2. package/bin/package-constants.d.ts +75 -0
  3. package/bin/package-constants.js +160 -0
  4. package/package.json +22 -15
  5. package/runtime-bundle.json +57 -0
  6. package/vendor/aarch64-pc-windows-msvc/onequery/onequery.exe +0 -0
  7. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/CompositeItem-5Ejg9goZ.js +0 -1
  8. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/CompositeList-YgaWmh3B.js +0 -1
  9. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/DialogTitle-ClXtDd9Q.js +0 -1
  10. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconArrowRight-DsOD7mDl.js +0 -1
  11. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconCheck-Gc24xPT2.js +0 -1
  12. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconChevronDown-B-39MA7-.js +0 -1
  13. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconChevronRight-DD16tNHZ.js +0 -1
  14. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconCoins-C7Nn0L6R.js +0 -1
  15. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconHistory-k3NVXypq.js +0 -1
  16. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconLoader2-CZSIppar.js +0 -1
  17. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconPlus-Ie-KpLOF.js +0 -1
  18. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/IconX-lzvnmVyG.js +0 -1
  19. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/Separator-DFErBP0R.js +0 -1
  20. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/_authenticated-BWDDapHH.js +0 -1
  21. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/_org_slug-CKOKPChi.js +0 -1
  22. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/alert-CS-uCjgY.js +0 -1
  23. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/api-base-url-DIb6qukm.js +0 -1
  24. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/api-client-DPCavVwb.js +0 -1
  25. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/api-paths-CFdXXr7u.js +0 -1
  26. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/app-routes-DZ9Y_rfa.js +0 -1
  27. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/audit-BN8ls_MY.js +0 -2
  28. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/auth-bootstrap-query-BqZQ8G7v.js +0 -1
  29. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/auth-client-CMZBteJH.js +0 -3
  30. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/avatar-Bhrck5AU.js +0 -1
  31. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/badge-CkOCUhr2.js +0 -1
  32. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/budget-BURonfUt.js +0 -1
  33. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/callback-CEccxk8i.js +0 -1
  34. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/card-CUmxccAE.js +0 -1
  35. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/checkbox-CAn5Cn-T.js +0 -1
  36. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/compiler-runtime-DCc3R3Xn.js +0 -1
  37. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/connect-database-Di_M3cmN.js +0 -1
  38. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/copy-button-BO1KBdf9.js +0 -1
  39. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/create-org-CVNvc6iH.js +0 -1
  40. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/createReactComponent-_L2mp4Ui.js +0 -1
  41. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/data-source-connection-form-yslLMNLp.js +0 -191
  42. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/device-B15ZHZWm.js +0 -1
  43. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/dist-ppXnK3vn.js +0 -3
  44. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/dropdown-menu-DtEDDjE6.js +0 -1
  45. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/empty-nwzd6339.js +0 -1
  46. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/format-date-z9OF1gmD.js +0 -1
  47. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/getDisabledMountTransitionStyles-D7JdES34.js +0 -1
  48. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/getPseudoElementBounds-DoV2AHJj.js +0 -12
  49. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/home-BemJ3A_4.js +0 -1
  50. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/index-CJ-rryYZ.js +0 -10
  51. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/index-Cw-u-nCb.css +0 -2
  52. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/input-1NcNY1Rk.js +0 -1
  53. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/integrations-DvSzU8x3.js +0 -1
  54. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  55. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  56. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  57. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  58. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  59. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  60. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  61. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/invite._invitationId-BeEkXqYN.js +0 -1
  62. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/jsx-runtime-DG_AJzB_.js +0 -1
  63. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/label-CUY3W2yp.js +0 -1
  64. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/link-Cgvqhh5w.js +0 -1
  65. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/matchContext-CDajBC0L.js +0 -1
  66. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/organization-permissions-BVvfS7YH.js +0 -1
  67. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/organization-query-keys-CU7jOI4S.js +0 -1
  68. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/query-DF3dbj_k.js +0 -1
  69. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/query-timing-DJ9GuO2c.js +0 -1
  70. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/queryOptions-uXYq4lsk.js +0 -1
  71. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/routes-uDrN548x.js +0 -1
  72. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/schemas-BXHHM7OC.js +0 -64
  73. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/select-sd9I7HEr.js +0 -1
  74. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/separator-BA_IZNjv.js +0 -1
  75. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/settings-BJE_QCvJ.js +0 -1
  76. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/signin-COc0Xlmx.js +0 -1
  77. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/src-BLN-I5in.js +0 -1
  78. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/team-DsvoMGTa.js +0 -1
  79. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/textarea-Bp7ncmeh.js +0 -1
  80. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/theme-toggle-Cpb5vfOF.js +0 -1
  81. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/use-optimistic-mutation-BclNvJ-z.js +0 -1
  82. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useBaseQuery-B6kSUltH.js +0 -1
  83. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useBaseUiId-DFyoDJ0E.js +0 -1
  84. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useCompositeItem-CeS9xqAj.js +0 -1
  85. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useControlled-DtSMvmU7.js +0 -1
  86. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useQuery-BUtAumWK.js +0 -1
  87. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useRender-DFBf8QFH.js +0 -1
  88. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useRouterState-DpT8luFk.js +0 -1
  89. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useSuspenseQuery-DYsbEeL7.js +0 -1
  90. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/useValueChanged-CH03vPJ5.js +0 -1
  91. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/utils-C8DGLIgm.js +0 -1
  92. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/xstate-react.esm-Dgyp86r-.js +0 -1
  93. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/assets/zod-DM_ziQch.js +0 -1
  94. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/favicon.ico +0 -0
  95. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/amplitude/step1_settings_sidebar.png +0 -0
  96. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/amplitude/step2_projects.png +0 -0
  97. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/amplitude/step3_project_keys.png +0 -0
  98. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/amplitude/step4_api_keys.png +0 -0
  99. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/bigquery/step1_service_accounts.png +0 -0
  100. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/bigquery/step2_bigquery_roles.png +0 -0
  101. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/bigquery/step3_add_key_menu.png +0 -0
  102. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/bigquery/step4_create_json_key.png +0 -0
  103. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/cloudflare-workers-observability/step2_enable_workers_logs.png +0 -0
  104. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/cloudflare-workers-observability/step3_user_api_tokens.png +0 -0
  105. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/cloudflare-workers-observability/step4_create_api_token.png +0 -0
  106. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/cloudflare-workers-observability/step5_workers_pages_account_id.png +0 -0
  107. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/cloudflare-workers-observability/step6_workers_observability_permission.png +0 -0
  108. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/ga4/step1_service_accounts.png +0 -0
  109. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/ga4/step2_create_json_key.png +0 -0
  110. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/ga4/step3_add_user_viewer.png +0 -0
  111. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/ga4/step4_property_details.png +0 -0
  112. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/github-token-guide/step1_signin.png +0 -0
  113. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/github-token-guide/step2_new_fine_grained_token_sanitized.png +0 -0
  114. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/github-token-guide/step3_permissions_configured_sanitized.png +0 -0
  115. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/github-token-guide/step4_token_created_sanitized.png +0 -0
  116. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/mixpanel/step1_service_accounts.png +0 -0
  117. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/mixpanel/step2_create_service_account.png +0 -0
  118. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/mixpanel/step3_credentials.png +0 -0
  119. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/mixpanel/step4_project_settings.png +0 -0
  120. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/postgresql/step1_create_user.png +0 -0
  121. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/postgresql/step2_connection.png +0 -0
  122. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/posthog/step1_project_settings.png +0 -0
  123. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/posthog/step2_personal_api_keys.png +0 -0
  124. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/posthog/step3_create_key_modal.png +0 -0
  125. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/rds/step1_connect.png +0 -0
  126. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/rds/step2_create_user.png +0 -0
  127. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/rds/step3_grant.png +0 -0
  128. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/rds/step4_info.png +0 -0
  129. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/sentry/step1_personal_tokens.png +0 -0
  130. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/sentry/step2_create_token_permissions.png +0 -0
  131. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/sentry/step3_organization_slug.png +0 -0
  132. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/images/sentry/step4_project_slug.png +0 -0
  133. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/index.html +0 -47
  134. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/linear.svg +0 -1
  135. package/vendor/aarch64-pc-windows-msvc/runtime/dashboard/onequery.svg +0 -44
  136. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260327065242_curious_nightmare.sql +0 -403
  137. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260403103652_slippery_hellfire_club.sql +0 -8
  138. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260403112219_gigantic_namora.sql +0 -1
  139. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260420071232_previous_justin_hammer.sql +0 -141
  140. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260420093157_spooky_cassandra_nova.sql +0 -29
  141. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260420101631_even_ogun.sql +0 -5
  142. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260425110519_smart_amazoness.sql +0 -8
  143. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260428033542_rename_source_query_interface_missing.sql +0 -36
  144. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260430114113_jittery_scorpion.sql +0 -28
  145. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260430135906_flippant_timeslip.sql +0 -4
  146. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260502000100_drop_old_workflow_audit_tables.sql +0 -15
  147. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260503011110_moaning_jack_flag.sql +0 -22
  148. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/20260514143216_reset_workflow_audit_history.sql +0 -20
  149. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260327065242_snapshot.json +0 -2817
  150. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260403103652_snapshot.json +0 -2864
  151. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260403112219_snapshot.json +0 -2870
  152. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260420071232_snapshot.json +0 -3879
  153. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260420093157_snapshot.json +0 -4088
  154. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260420101631_snapshot.json +0 -3250
  155. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260425110519_snapshot.json +0 -3250
  156. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260428033542_snapshot.json +0 -3250
  157. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260430114113_snapshot.json +0 -3507
  158. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260430135906_snapshot.json +0 -3531
  159. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/20260503011110_snapshot.json +0 -3089
  160. package/vendor/aarch64-pc-windows-msvc/runtime/migrations/meta/_journal.json +0 -97
  161. package/vendor/aarch64-pc-windows-msvc/runtime/pglite/initdb.wasm +0 -0
  162. package/vendor/aarch64-pc-windows-msvc/runtime/pglite/pglite.data +0 -0
  163. package/vendor/aarch64-pc-windows-msvc/runtime/pglite/pglite.wasm +0 -0
  164. package/vendor/aarch64-pc-windows-msvc/runtime/sql-parser/sql_parser_wasm_bg.wasm +0 -0
  165. package/vendor/aarch64-pc-windows-msvc/server/onequery-server.mjs +0 -272512
@@ -1,403 +0,0 @@
1
- CREATE TABLE "account" (
2
- "access_token" text,
3
- "access_token_expires_at" timestamp,
4
- "account_id" text NOT NULL,
5
- "created_at" timestamp DEFAULT now() NOT NULL,
6
- "id" text PRIMARY KEY NOT NULL,
7
- "id_token" text,
8
- "password" text,
9
- "provider_id" text NOT NULL,
10
- "refresh_token" text,
11
- "refresh_token_expires_at" timestamp,
12
- "scope" text,
13
- "updated_at" timestamp DEFAULT now() NOT NULL,
14
- "user_id" text NOT NULL
15
- );
16
- --> statement-breakpoint
17
- ALTER TABLE "account" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
18
- CREATE TABLE "device_code" (
19
- "client_id" text,
20
- "device_code" text NOT NULL,
21
- "expires_at" timestamp NOT NULL,
22
- "id" text PRIMARY KEY NOT NULL,
23
- "last_polled_at" timestamp,
24
- "polling_interval" integer,
25
- "scope" text,
26
- "status" text NOT NULL,
27
- "user_code" text NOT NULL,
28
- "user_id" text
29
- );
30
- --> statement-breakpoint
31
- ALTER TABLE "device_code" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
32
- CREATE TABLE "invitation" (
33
- "created_at" timestamp DEFAULT now() NOT NULL,
34
- "email" text NOT NULL,
35
- "expires_at" timestamp NOT NULL,
36
- "id" text PRIMARY KEY NOT NULL,
37
- "inviter_id" text NOT NULL,
38
- "organization_id" text NOT NULL,
39
- "role" text,
40
- "status" text NOT NULL
41
- );
42
- --> statement-breakpoint
43
- ALTER TABLE "invitation" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
44
- CREATE TABLE "member" (
45
- "created_at" timestamp DEFAULT now() NOT NULL,
46
- "id" text PRIMARY KEY NOT NULL,
47
- "organization_id" text NOT NULL,
48
- "role" text NOT NULL,
49
- "user_id" text NOT NULL
50
- );
51
- --> statement-breakpoint
52
- ALTER TABLE "member" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
53
- CREATE TABLE "organization" (
54
- "created_at" timestamp DEFAULT now() NOT NULL,
55
- "id" text PRIMARY KEY NOT NULL,
56
- "logo" text,
57
- "metadata" text,
58
- "name" text NOT NULL,
59
- "slug" text,
60
- CONSTRAINT "organization_slug_unique" UNIQUE("slug")
61
- );
62
- --> statement-breakpoint
63
- ALTER TABLE "organization" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
64
- CREATE TABLE "session" (
65
- "active_organization_id" text,
66
- "created_at" timestamp DEFAULT now() NOT NULL,
67
- "expires_at" timestamp NOT NULL,
68
- "id" text PRIMARY KEY NOT NULL,
69
- "ip_address" text,
70
- "token" text NOT NULL,
71
- "updated_at" timestamp DEFAULT now() NOT NULL,
72
- "user_agent" text,
73
- "user_id" text NOT NULL,
74
- CONSTRAINT "session_token_unique" UNIQUE("token")
75
- );
76
- --> statement-breakpoint
77
- ALTER TABLE "session" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
78
- CREATE TABLE "user" (
79
- "created_at" timestamp DEFAULT now() NOT NULL,
80
- "email" text NOT NULL,
81
- "email_verified" boolean DEFAULT false NOT NULL,
82
- "id" text PRIMARY KEY NOT NULL,
83
- "image" text,
84
- "name" text NOT NULL,
85
- "updated_at" timestamp DEFAULT now() NOT NULL,
86
- CONSTRAINT "user_email_unique" UNIQUE("email")
87
- );
88
- --> statement-breakpoint
89
- ALTER TABLE "user" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
90
- CREATE TABLE "verification" (
91
- "created_at" timestamp DEFAULT now() NOT NULL,
92
- "expires_at" timestamp NOT NULL,
93
- "id" text PRIMARY KEY NOT NULL,
94
- "identifier" text NOT NULL,
95
- "updated_at" timestamp DEFAULT now() NOT NULL,
96
- "value" text NOT NULL
97
- );
98
- --> statement-breakpoint
99
- ALTER TABLE "verification" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
100
- CREATE TABLE "bigquery_query_costs" (
101
- "actual_bytes_billed" bigint,
102
- "actual_bytes_processed" bigint,
103
- "actual_cost_usd" double precision,
104
- "cache_hit" boolean,
105
- "connection_name" text NOT NULL,
106
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
107
- "currency" text DEFAULT 'USD' NOT NULL,
108
- "estimated_bytes_processed" bigint,
109
- "estimated_cost_usd" double precision,
110
- "executed_at" timestamp with time zone NOT NULL,
111
- "id" text PRIMARY KEY NOT NULL,
112
- "job_id" text,
113
- "location" text,
114
- "organization_id" text NOT NULL,
115
- "pricing_model" text DEFAULT 'unknown' NOT NULL,
116
- "query_id" text NOT NULL,
117
- "tool_call_id" text NOT NULL
118
- );
119
- --> statement-breakpoint
120
- ALTER TABLE "bigquery_query_costs" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
121
- CREATE TABLE "cli_query_actions" (
122
- "id" text PRIMARY KEY NOT NULL,
123
- "organization_id" text NOT NULL,
124
- "actor_user_id" text NOT NULL,
125
- "actor_email" text NOT NULL,
126
- "actor_auth_mode" text NOT NULL,
127
- "actor_membership_roles" jsonb NOT NULL,
128
- "request_id" text NOT NULL,
129
- "action_type" text NOT NULL,
130
- "stage" text DEFAULT 'received' NOT NULL,
131
- "status" text DEFAULT 'pending' NOT NULL,
132
- "usage_persistence_status" text DEFAULT 'not_started' NOT NULL,
133
- "source_key" text NOT NULL,
134
- "source_id" text,
135
- "provider" text,
136
- "source_status" text,
137
- "sql" text NOT NULL,
138
- "normalized_sql" text,
139
- "max_rows" integer,
140
- "max_bytes" integer,
141
- "cell_max_chars" integer,
142
- "timeout_ms" integer,
143
- "normalized_sql_changed" boolean DEFAULT false NOT NULL,
144
- "row_count" integer,
145
- "elapsed_ms" integer,
146
- "error_detail" text,
147
- "error_hint" text,
148
- "retryable" boolean,
149
- "last_event_id" text,
150
- "last_event_at" timestamp with time zone DEFAULT now() NOT NULL,
151
- "completed_at" timestamp with time zone,
152
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
153
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
154
- "version" integer DEFAULT 1 NOT NULL,
155
- CONSTRAINT "cli_query_actions_identity_unique" UNIQUE("id","organization_id","request_id","action_type","source_key"),
156
- CONSTRAINT "cli_query_actions_action_type_check" CHECK ("cli_query_actions"."action_type" in ('validate', 'execute')),
157
- CONSTRAINT "cli_query_actions_actor_auth_mode_check" CHECK ("cli_query_actions"."actor_auth_mode" in ('browser_session', 'bearer_token')),
158
- CONSTRAINT "cli_query_actions_stage_check" CHECK ("cli_query_actions"."stage" in ('received', 'load_source', 'validate_query', 'load_credentials', 'execute_query', 'persist_usage', 'completed')),
159
- CONSTRAINT "cli_query_actions_status_check" CHECK ("cli_query_actions"."status" in ('pending', 'succeeded', 'source_not_found', 'source_not_queryable', 'query_rejected', 'query_preparation_failed', 'query_unavailable', 'query_timed_out', 'query_execution_failed')),
160
- CONSTRAINT "cli_query_actions_usage_persistence_status_check" CHECK ("cli_query_actions"."usage_persistence_status" in ('not_started', 'succeeded', 'failed')),
161
- CONSTRAINT "cli_query_actions_completed_stage_check" CHECK (( (stage = 'completed' and completed_at is not null) or (stage <> 'completed' and completed_at is null) )),
162
- CONSTRAINT "cli_query_actions_stage_status_alignment_check" CHECK (( (stage = 'completed' and status <> 'pending') or (stage <> 'completed' and status = 'pending') )),
163
- CONSTRAINT "cli_query_actions_pre_completion_usage_check" CHECK (( stage = 'completed' or usage_persistence_status = 'not_started' ))
164
- );
165
- --> statement-breakpoint
166
- ALTER TABLE "cli_query_actions" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
167
- CREATE TABLE "cli_query_action_events" (
168
- "id" text PRIMARY KEY NOT NULL,
169
- "query_action_id" text NOT NULL,
170
- "organization_id" text NOT NULL,
171
- "actor_user_id" text NOT NULL,
172
- "actor_email" text NOT NULL,
173
- "actor_auth_mode" text NOT NULL,
174
- "actor_membership_roles" jsonb NOT NULL,
175
- "request_id" text NOT NULL,
176
- "action_type" text NOT NULL,
177
- "event_type" text NOT NULL,
178
- "stage" text NOT NULL,
179
- "status" text NOT NULL,
180
- "usage_persistence_status" text NOT NULL,
181
- "source_key" text NOT NULL,
182
- "source_id" text,
183
- "provider" text,
184
- "source_status" text,
185
- "sql" text,
186
- "normalized_sql" text,
187
- "max_rows" integer,
188
- "max_bytes" integer,
189
- "cell_max_chars" integer,
190
- "timeout_ms" integer,
191
- "normalized_sql_changed" boolean DEFAULT false NOT NULL,
192
- "row_count" integer,
193
- "elapsed_ms" integer,
194
- "error_detail" text,
195
- "error_hint" text,
196
- "retryable" boolean,
197
- "occurred_at" timestamp with time zone NOT NULL,
198
- "causation_event_id" text,
199
- "org_slug" text,
200
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
201
- CONSTRAINT "cli_query_action_events_action_id_unique" UNIQUE("query_action_id","id"),
202
- CONSTRAINT "cli_query_action_events_sql_payload_check" CHECK (( (event_type = 'action_received' and sql is not null) or (event_type <> 'action_received' and sql is null) )),
203
- CONSTRAINT "cli_query_action_events_causation_chain_check" CHECK (( (event_type = 'action_received' and causation_event_id is null) or (event_type <> 'action_received' and causation_event_id is not null) )),
204
- CONSTRAINT "cli_query_action_events_validated_normalized_sql_check" CHECK ((event_type <> 'query_validated' or normalized_sql is not null)),
205
- CONSTRAINT "cli_query_action_events_lifecycle_check" CHECK (( (event_type = 'action_received' and stage = 'received' and status = 'pending' and usage_persistence_status = 'not_started') or (event_type = 'source_loaded' and stage = 'validate_query' and status = 'pending' and usage_persistence_status = 'not_started') or (event_type = 'source_not_found' and stage = 'completed' and status = 'source_not_found' and usage_persistence_status = 'not_started') or (event_type = 'source_not_queryable' and stage = 'completed' and status = 'source_not_queryable' and usage_persistence_status = 'not_started') or ( event_type = 'query_validated' and ( (action_type = 'validate' and stage = 'completed' and status = 'succeeded' and usage_persistence_status = 'not_started') or (action_type = 'execute' and stage = 'load_credentials' and status = 'pending' and usage_persistence_status = 'not_started') ) ) or (event_type = 'query_rejected' and stage = 'completed' and status = 'query_rejected' and usage_persistence_status = 'not_started') or (event_type = 'credentials_loaded' and stage = 'execute_query' and status = 'pending' and usage_persistence_status = 'not_started') or (event_type = 'query_preparation_failed' and stage = 'completed' and status = 'query_preparation_failed' and usage_persistence_status = 'not_started') or (event_type = 'query_executed' and stage = 'persist_usage' and status = 'pending' and usage_persistence_status = 'not_started') or (event_type = 'query_unavailable' and stage = 'completed' and status = 'query_unavailable' and usage_persistence_status = 'not_started') or (event_type = 'query_timed_out' and stage = 'completed' and status = 'query_timed_out' and usage_persistence_status = 'not_started') or (event_type = 'query_execution_failed' and stage = 'completed' and status = 'query_execution_failed' and usage_persistence_status = 'not_started') or (event_type = 'usage_persisted' and stage = 'completed' and status = 'succeeded' and usage_persistence_status = 'succeeded') or (event_type = 'usage_persist_failed' and stage = 'completed' and status = 'succeeded' and usage_persistence_status = 'failed') )),
206
- CONSTRAINT "cli_query_action_events_action_type_check" CHECK ("cli_query_action_events"."action_type" in ('validate', 'execute')),
207
- CONSTRAINT "cli_query_action_events_actor_auth_mode_check" CHECK ("cli_query_action_events"."actor_auth_mode" in ('browser_session', 'bearer_token')),
208
- CONSTRAINT "cli_query_action_events_event_type_check" CHECK ("cli_query_action_events"."event_type" in ('action_received', 'source_loaded', 'source_not_found', 'source_not_queryable', 'query_validated', 'query_rejected', 'credentials_loaded', 'query_preparation_failed', 'query_executed', 'query_unavailable', 'query_timed_out', 'query_execution_failed', 'usage_persisted', 'usage_persist_failed')),
209
- CONSTRAINT "cli_query_action_events_stage_check" CHECK ("cli_query_action_events"."stage" in ('received', 'load_source', 'validate_query', 'load_credentials', 'execute_query', 'persist_usage', 'completed')),
210
- CONSTRAINT "cli_query_action_events_status_check" CHECK ("cli_query_action_events"."status" in ('pending', 'succeeded', 'source_not_found', 'source_not_queryable', 'query_rejected', 'query_preparation_failed', 'query_unavailable', 'query_timed_out', 'query_execution_failed')),
211
- CONSTRAINT "cli_query_action_events_usage_persistence_status_check" CHECK ("cli_query_action_events"."usage_persistence_status" in ('not_started', 'succeeded', 'failed')),
212
- CONSTRAINT "cli_query_action_events_causation_not_self_check" CHECK ("cli_query_action_events"."causation_event_id" is null or "cli_query_action_events"."causation_event_id" <> "cli_query_action_events"."id")
213
- );
214
- --> statement-breakpoint
215
- ALTER TABLE "cli_query_action_events" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
216
- CREATE TABLE "connector_jobs" (
217
- "completed_at" timestamp with time zone,
218
- "connector_id" text NOT NULL,
219
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
220
- "database" text NOT NULL,
221
- "job_id" text PRIMARY KEY NOT NULL,
222
- "leased_at" timestamp with time zone,
223
- "max_rows" integer,
224
- "outcome" jsonb,
225
- "sql" text NOT NULL,
226
- "status" text NOT NULL,
227
- "timeout_ms" integer,
228
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
229
- "workgroup" text
230
- );
231
- --> statement-breakpoint
232
- ALTER TABLE "connector_jobs" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
233
- CREATE TABLE "connectors" (
234
- "auth_token_hash" text NOT NULL,
235
- "connector_id" text PRIMARY KEY NOT NULL,
236
- "connector_name" text NOT NULL,
237
- "health_status" text,
238
- "last_heartbeat_at" timestamp with time zone,
239
- "last_seen_at" timestamp with time zone,
240
- "metadata" jsonb,
241
- "organization_id" text NOT NULL,
242
- "registered_at" timestamp with time zone DEFAULT now() NOT NULL,
243
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
244
- );
245
- --> statement-breakpoint
246
- ALTER TABLE "connectors" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
247
- CREATE TABLE "data_source_query_costs" (
248
- "actual_cost_usd" double precision,
249
- "actual_processed_bytes" bigint,
250
- "billable_bytes" bigint,
251
- "cache_hit" boolean,
252
- "connection_name" text NOT NULL,
253
- "connector_id" text,
254
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
255
- "currency" text DEFAULT 'USD' NOT NULL,
256
- "database" text,
257
- "estimated_cost_usd" double precision,
258
- "estimated_processed_bytes" bigint,
259
- "executed_at" timestamp with time zone NOT NULL,
260
- "execution_time_ms" integer,
261
- "id" text PRIMARY KEY NOT NULL,
262
- "job_id" text,
263
- "location" text,
264
- "organization_id" text NOT NULL,
265
- "pricing_model" text DEFAULT 'unknown' NOT NULL,
266
- "provider" text NOT NULL,
267
- "query_execution_id" text,
268
- "query_id" text NOT NULL,
269
- "row_count" integer,
270
- "tool_call_id" text NOT NULL,
271
- "workgroup" text
272
- );
273
- --> statement-breakpoint
274
- ALTER TABLE "data_source_query_costs" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
275
- CREATE TABLE "data_sources" (
276
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
277
- "credentials_encrypted" text NOT NULL,
278
- "credentials_iv" text NOT NULL,
279
- "error_message" text,
280
- "id" text PRIMARY KEY NOT NULL,
281
- "last_used_at" timestamp with time zone,
282
- "name" text NOT NULL,
283
- "organization_id" text NOT NULL,
284
- "provider" text NOT NULL,
285
- "provider_account_id" text,
286
- "scope" text,
287
- "status" text DEFAULT 'active' NOT NULL,
288
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
289
- "use_as_data_source" boolean DEFAULT true NOT NULL,
290
- CONSTRAINT "data_sources_organization_name_unique" UNIQUE("organization_id","name")
291
- );
292
- --> statement-breakpoint
293
- ALTER TABLE "data_sources" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
294
- CREATE TABLE "data_source_table_usage" (
295
- "column_memos" jsonb DEFAULT '{}'::jsonb NOT NULL,
296
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
297
- "data_source_id" text NOT NULL,
298
- "formatted" text NOT NULL,
299
- "generated_at" timestamp with time zone NOT NULL,
300
- "id" text PRIMARY KEY NOT NULL,
301
- "memo_updated_at" timestamp with time zone,
302
- "memo_updated_by" text,
303
- "organization_id" text NOT NULL,
304
- "provider" text NOT NULL,
305
- "schema_hash" text,
306
- "table_lineage" jsonb DEFAULT '{}'::jsonb NOT NULL,
307
- "table_memos" jsonb DEFAULT '{}'::jsonb NOT NULL,
308
- "tables" jsonb NOT NULL,
309
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
310
- );
311
- --> statement-breakpoint
312
- ALTER TABLE "data_source_table_usage" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
313
- CREATE TABLE "organization_profiles" (
314
- "id" text PRIMARY KEY NOT NULL,
315
- "organization_id" text NOT NULL,
316
- "north_star_metric" text,
317
- "kpis" jsonb DEFAULT '[]'::jsonb NOT NULL,
318
- "website_url" text,
319
- "monthly_budget_usd" double precision,
320
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
321
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
322
- );
323
- --> statement-breakpoint
324
- ALTER TABLE "organization_profiles" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
325
- CREATE TABLE "user_profiles" (
326
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
327
- "id" text PRIMARY KEY NOT NULL,
328
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
329
- "user_id" text NOT NULL
330
- );
331
- --> statement-breakpoint
332
- ALTER TABLE "user_profiles" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
333
- ALTER TABLE "account" ADD CONSTRAINT "account_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
334
- ALTER TABLE "device_code" ADD CONSTRAINT "device_code_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
335
- ALTER TABLE "invitation" ADD CONSTRAINT "invitation_inviter_id_user_id_fk" FOREIGN KEY ("inviter_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
336
- ALTER TABLE "invitation" ADD CONSTRAINT "invitation_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
337
- ALTER TABLE "member" ADD CONSTRAINT "member_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
338
- ALTER TABLE "member" ADD CONSTRAINT "member_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
339
- ALTER TABLE "session" ADD CONSTRAINT "session_active_organization_id_organization_id_fk" FOREIGN KEY ("active_organization_id") REFERENCES "public"."organization"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
340
- ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
341
- ALTER TABLE "bigquery_query_costs" ADD CONSTRAINT "bigquery_query_costs_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
342
- ALTER TABLE "cli_query_actions" ADD CONSTRAINT "cli_query_actions_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
343
- ALTER TABLE "cli_query_actions" ADD CONSTRAINT "cli_query_actions_source_id_data_sources_id_fk" FOREIGN KEY ("source_id") REFERENCES "public"."data_sources"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
344
- ALTER TABLE "cli_query_actions" ADD CONSTRAINT "cli_query_actions_same_action_last_event_fk" FOREIGN KEY ("id","last_event_id") REFERENCES "public"."cli_query_action_events"("query_action_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
345
- ALTER TABLE "cli_query_action_events" ADD CONSTRAINT "cli_query_action_events_query_action_id_cli_query_actions_id_fk" FOREIGN KEY ("query_action_id") REFERENCES "public"."cli_query_actions"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
346
- ALTER TABLE "cli_query_action_events" ADD CONSTRAINT "cli_query_action_events_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
347
- ALTER TABLE "cli_query_action_events" ADD CONSTRAINT "cli_query_action_events_source_id_data_sources_id_fk" FOREIGN KEY ("source_id") REFERENCES "public"."data_sources"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
348
- ALTER TABLE "cli_query_action_events" ADD CONSTRAINT "cli_query_action_events_action_identity_fk" FOREIGN KEY ("query_action_id","organization_id","request_id","action_type","source_key") REFERENCES "public"."cli_query_actions"("id","organization_id","request_id","action_type","source_key") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
349
- ALTER TABLE "cli_query_action_events" ADD CONSTRAINT "cli_query_action_events_same_action_causation_fk" FOREIGN KEY ("query_action_id","causation_event_id") REFERENCES "public"."cli_query_action_events"("query_action_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
350
- ALTER TABLE "cli_query_action_events" ADD CONSTRAINT "cli_query_action_events_causation_event_id_cli_query_action_events_id_fk" FOREIGN KEY ("causation_event_id") REFERENCES "public"."cli_query_action_events"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
351
- ALTER TABLE "connector_jobs" ADD CONSTRAINT "connector_jobs_connector_id_connectors_connector_id_fk" FOREIGN KEY ("connector_id") REFERENCES "public"."connectors"("connector_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
352
- ALTER TABLE "connectors" ADD CONSTRAINT "connectors_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
353
- ALTER TABLE "data_source_query_costs" ADD CONSTRAINT "data_source_query_costs_connector_id_connectors_connector_id_fk" FOREIGN KEY ("connector_id") REFERENCES "public"."connectors"("connector_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
354
- ALTER TABLE "data_source_query_costs" ADD CONSTRAINT "data_source_query_costs_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
355
- ALTER TABLE "data_sources" ADD CONSTRAINT "data_sources_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
356
- ALTER TABLE "data_source_table_usage" ADD CONSTRAINT "data_source_table_usage_data_source_id_data_sources_id_fk" FOREIGN KEY ("data_source_id") REFERENCES "public"."data_sources"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
357
- ALTER TABLE "data_source_table_usage" ADD CONSTRAINT "data_source_table_usage_memo_updated_by_user_id_fk" FOREIGN KEY ("memo_updated_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
358
- ALTER TABLE "data_source_table_usage" ADD CONSTRAINT "data_source_table_usage_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
359
- ALTER TABLE "organization_profiles" ADD CONSTRAINT "organization_profiles_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
360
- ALTER TABLE "user_profiles" ADD CONSTRAINT "user_profiles_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
361
- CREATE INDEX "account_userId_idx" ON "account" USING btree ("user_id");--> statement-breakpoint
362
- CREATE UNIQUE INDEX "device_code_device_code_key" ON "device_code" USING btree ("device_code");--> statement-breakpoint
363
- CREATE UNIQUE INDEX "device_code_user_code_key" ON "device_code" USING btree ("user_code");--> statement-breakpoint
364
- CREATE INDEX "device_code_user_id_idx" ON "device_code" USING btree ("user_id");--> statement-breakpoint
365
- CREATE INDEX "device_code_expires_at_idx" ON "device_code" USING btree ("expires_at");--> statement-breakpoint
366
- CREATE INDEX "invitation_organizationId_idx" ON "invitation" USING btree ("organization_id");--> statement-breakpoint
367
- CREATE INDEX "invitation_email_idx" ON "invitation" USING btree ("email");--> statement-breakpoint
368
- CREATE INDEX "member_organizationId_idx" ON "member" USING btree ("organization_id");--> statement-breakpoint
369
- CREATE INDEX "member_userId_idx" ON "member" USING btree ("user_id");--> statement-breakpoint
370
- CREATE INDEX "session_userId_idx" ON "session" USING btree ("user_id");--> statement-breakpoint
371
- CREATE INDEX "verification_identifier_idx" ON "verification" USING btree ("identifier");--> statement-breakpoint
372
- CREATE INDEX "idx_bigquery_query_costs_org" ON "bigquery_query_costs" USING btree ("organization_id");--> statement-breakpoint
373
- CREATE INDEX "idx_bigquery_query_costs_executed_at" ON "bigquery_query_costs" USING btree ("executed_at");--> statement-breakpoint
374
- CREATE INDEX "idx_cli_query_actions_org_created" ON "cli_query_actions" USING btree ("organization_id","created_at");--> statement-breakpoint
375
- CREATE INDEX "idx_cli_query_actions_actor_user_id" ON "cli_query_actions" USING btree ("actor_user_id");--> statement-breakpoint
376
- CREATE INDEX "idx_cli_query_actions_request_id" ON "cli_query_actions" USING btree ("request_id");--> statement-breakpoint
377
- CREATE INDEX "idx_cli_query_actions_source_id" ON "cli_query_actions" USING btree ("source_id");--> statement-breakpoint
378
- CREATE INDEX "idx_cli_query_actions_status" ON "cli_query_actions" USING btree ("status");--> statement-breakpoint
379
- CREATE INDEX "idx_cli_query_action_events_action_occurred" ON "cli_query_action_events" USING btree ("query_action_id","occurred_at","id");--> statement-breakpoint
380
- CREATE INDEX "idx_cli_query_action_events_org_occurred" ON "cli_query_action_events" USING btree ("organization_id","occurred_at");--> statement-breakpoint
381
- CREATE INDEX "idx_cli_query_action_events_actor_user_id" ON "cli_query_action_events" USING btree ("actor_user_id");--> statement-breakpoint
382
- CREATE INDEX "idx_cli_query_action_events_request_id" ON "cli_query_action_events" USING btree ("request_id");--> statement-breakpoint
383
- CREATE INDEX "idx_cli_query_action_events_causation" ON "cli_query_action_events" USING btree ("causation_event_id");--> statement-breakpoint
384
- CREATE UNIQUE INDEX "idx_cli_query_action_events_action_event_type_unique" ON "cli_query_action_events" USING btree ("query_action_id","event_type");--> statement-breakpoint
385
- CREATE INDEX "idx_connector_jobs_connector_created" ON "connector_jobs" USING btree ("connector_id","created_at");--> statement-breakpoint
386
- CREATE INDEX "idx_connector_jobs_status_created" ON "connector_jobs" USING btree ("status","created_at");--> statement-breakpoint
387
- CREATE INDEX "idx_connectors_organization" ON "connectors" USING btree ("organization_id");--> statement-breakpoint
388
- CREATE INDEX "idx_connectors_last_seen" ON "connectors" USING btree ("last_seen_at");--> statement-breakpoint
389
- CREATE UNIQUE INDEX "idx_connectors_auth_token_hash_unique" ON "connectors" USING btree ("auth_token_hash");--> statement-breakpoint
390
- CREATE INDEX "idx_data_source_query_costs_org" ON "data_source_query_costs" USING btree ("organization_id");--> statement-breakpoint
391
- CREATE INDEX "idx_data_source_query_costs_provider" ON "data_source_query_costs" USING btree ("provider");--> statement-breakpoint
392
- CREATE INDEX "idx_data_source_query_costs_executed_at" ON "data_source_query_costs" USING btree ("executed_at");--> statement-breakpoint
393
- CREATE INDEX "idx_data_sources_organization" ON "data_sources" USING btree ("organization_id");--> statement-breakpoint
394
- CREATE INDEX "idx_data_sources_provider" ON "data_sources" USING btree ("provider");--> statement-breakpoint
395
- CREATE INDEX "idx_data_sources_provider_account" ON "data_sources" USING btree ("provider","provider_account_id");--> statement-breakpoint
396
- CREATE INDEX "idx_data_sources_status" ON "data_sources" USING btree ("status");--> statement-breakpoint
397
- CREATE UNIQUE INDEX "idx_data_source_table_usage_source" ON "data_source_table_usage" USING btree ("data_source_id");--> statement-breakpoint
398
- CREATE INDEX "idx_data_source_table_usage_org" ON "data_source_table_usage" USING btree ("organization_id");--> statement-breakpoint
399
- CREATE INDEX "idx_data_source_table_usage_provider" ON "data_source_table_usage" USING btree ("provider");--> statement-breakpoint
400
- CREATE INDEX "idx_data_source_table_usage_generated_at" ON "data_source_table_usage" USING btree ("generated_at");--> statement-breakpoint
401
- CREATE UNIQUE INDEX "idx_org_profiles_org" ON "organization_profiles" USING btree ("organization_id");--> statement-breakpoint
402
- CREATE INDEX "idx_org_profiles_created" ON "organization_profiles" USING btree ("created_at");--> statement-breakpoint
403
- CREATE UNIQUE INDEX "idx_user_profiles_user" ON "user_profiles" USING btree ("user_id");
@@ -1,8 +0,0 @@
1
- CREATE TABLE "rate_limit" (
2
- "count" integer NOT NULL,
3
- "key" text NOT NULL,
4
- "last_request" bigint NOT NULL
5
- );
6
- --> statement-breakpoint
7
- ALTER TABLE "rate_limit" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
8
- CREATE UNIQUE INDEX "rate_limit_key_key" ON "rate_limit" USING btree ("key");
@@ -1 +0,0 @@
1
- ALTER TABLE "rate_limit" ADD COLUMN "id" text PRIMARY KEY NOT NULL;
@@ -1,141 +0,0 @@
1
- CREATE TABLE "audit_projection_checkpoints" (
2
- "family" text NOT NULL,
3
- "last_commit_position" bigint DEFAULT 0 NOT NULL,
4
- "projection_name" text NOT NULL,
5
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
6
- );
7
- --> statement-breakpoint
8
- ALTER TABLE "audit_projection_checkpoints" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
9
- CREATE TABLE "query_actions" (
10
- "completed_at" timestamp with time zone,
11
- "failure_code" text,
12
- "id" text PRIMARY KEY NOT NULL,
13
- "last_event_id" text NOT NULL,
14
- "last_event_sequence" integer NOT NULL,
15
- "organization_id" text NOT NULL,
16
- "outcome" text NOT NULL,
17
- "phase" text NOT NULL,
18
- "query_mode" text NOT NULL,
19
- "query_text" text NOT NULL,
20
- "source_descriptor_json" jsonb,
21
- "started_at" timestamp with time zone NOT NULL,
22
- "usage_recording_status" text NOT NULL,
23
- "validated_query" text,
24
- CONSTRAINT "query_actions_completed_at_outcome_check" CHECK ((("query_actions"."outcome" = 'pending' and "query_actions"."completed_at" is null) or ("query_actions"."outcome" <> 'pending' and "query_actions"."completed_at" is not null))),
25
- CONSTRAINT "query_actions_completed_phase_outcome_check" CHECK ((("query_actions"."outcome" = 'pending' and "query_actions"."phase" <> 'completed') or ("query_actions"."outcome" <> 'pending' and "query_actions"."phase" = 'completed'))),
26
- CONSTRAINT "query_actions_failure_code_outcome_check" CHECK ((("query_actions"."outcome" = 'failed' and "query_actions"."failure_code" is not null) or ("query_actions"."outcome" <> 'failed' and "query_actions"."failure_code" is null))),
27
- CONSTRAINT "query_actions_last_event_sequence_positive_check" CHECK ("query_actions"."last_event_sequence" > 0)
28
- );
29
- --> statement-breakpoint
30
- ALTER TABLE "query_actions" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
31
- CREATE TABLE "query_action_events" (
32
- "action_id" text NOT NULL,
33
- "command_id" text NOT NULL,
34
- "commit_position" bigserial NOT NULL,
35
- "event_type" text NOT NULL,
36
- "id" text PRIMARY KEY NOT NULL,
37
- "occurred_at" timestamp with time zone NOT NULL,
38
- "payload_json" jsonb NOT NULL,
39
- "sequence" integer NOT NULL
40
- );
41
- --> statement-breakpoint
42
- ALTER TABLE "query_action_events" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
43
- CREATE TABLE "source_api_actions" (
44
- "attempt_number" integer,
45
- "completed_at" timestamp with time zone,
46
- "failure_code" text,
47
- "id" text PRIMARY KEY NOT NULL,
48
- "invoke_mode" text,
49
- "last_event_id" text NOT NULL,
50
- "last_event_sequence" integer NOT NULL,
51
- "organization_id" text NOT NULL,
52
- "outcome" text NOT NULL,
53
- "page_progress_json" jsonb,
54
- "phase" text NOT NULL,
55
- "prepared_request_fingerprint" text,
56
- "request_descriptor_json" jsonb,
57
- "request_kind" text NOT NULL,
58
- "source_descriptor_json" jsonb,
59
- "started_at" timestamp with time zone NOT NULL,
60
- CONSTRAINT "source_api_actions_completed_at_outcome_check" CHECK ((("source_api_actions"."outcome" = 'pending' and "source_api_actions"."completed_at" is null) or ("source_api_actions"."outcome" <> 'pending' and "source_api_actions"."completed_at" is not null))),
61
- CONSTRAINT "source_api_actions_completed_phase_outcome_check" CHECK ((("source_api_actions"."outcome" = 'pending' and "source_api_actions"."phase" <> 'completed') or ("source_api_actions"."outcome" <> 'pending' and "source_api_actions"."phase" = 'completed'))),
62
- CONSTRAINT "source_api_actions_failure_code_outcome_check" CHECK ((("source_api_actions"."outcome" = 'failed' and "source_api_actions"."failure_code" is not null) or ("source_api_actions"."outcome" <> 'failed' and "source_api_actions"."failure_code" is null))),
63
- CONSTRAINT "source_api_actions_last_event_sequence_positive_check" CHECK ("source_api_actions"."last_event_sequence" > 0)
64
- );
65
- --> statement-breakpoint
66
- ALTER TABLE "source_api_actions" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
67
- CREATE TABLE "source_api_action_events" (
68
- "action_id" text NOT NULL,
69
- "command_id" text NOT NULL,
70
- "commit_position" bigserial NOT NULL,
71
- "event_type" text NOT NULL,
72
- "id" text PRIMARY KEY NOT NULL,
73
- "occurred_at" timestamp with time zone NOT NULL,
74
- "payload_json" jsonb NOT NULL,
75
- "sequence" integer NOT NULL
76
- );
77
- --> statement-breakpoint
78
- ALTER TABLE "source_api_action_events" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
79
- CREATE TABLE "workflow_commands" (
80
- "action_id" text,
81
- "actor_snapshot_json" jsonb NOT NULL,
82
- "caused_by_event_id" text,
83
- "command_invocation_id" text NOT NULL,
84
- "command_payload_json" jsonb NOT NULL,
85
- "command_type" text NOT NULL,
86
- "created_at" timestamp with time zone NOT NULL,
87
- "decision_kind" text NOT NULL,
88
- "family" text NOT NULL,
89
- "id" text PRIMARY KEY NOT NULL,
90
- "organization_id" text NOT NULL,
91
- "reject_code" text,
92
- "reject_detail" text,
93
- "request_id" text NOT NULL,
94
- "surface" text NOT NULL,
95
- CONSTRAINT "workflow_commands_decision_reject_alignment_check" CHECK ((("workflow_commands"."decision_kind" = 'rejected' and "workflow_commands"."reject_code" is not null) or ("workflow_commands"."decision_kind" = 'accepted' and "workflow_commands"."reject_code" is null))),
96
- CONSTRAINT "workflow_commands_accepted_action_id_check" CHECK (("workflow_commands"."decision_kind" = 'rejected' or "workflow_commands"."action_id" is not null))
97
- );
98
- --> statement-breakpoint
99
- ALTER TABLE "workflow_commands" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
100
- CREATE TABLE "workflow_effect_dispatches" (
101
- "action_id" text NOT NULL,
102
- "attempt_count" integer DEFAULT 0 NOT NULL,
103
- "available_at" timestamp with time zone DEFAULT now() NOT NULL,
104
- "completed_at" timestamp with time zone,
105
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
106
- "effect_key" text NOT NULL,
107
- "effect_type" text NOT NULL,
108
- "family" text NOT NULL,
109
- "id" text PRIMARY KEY NOT NULL,
110
- "last_error_code" text,
111
- "last_error_detail" text,
112
- "leased_until" timestamp with time zone,
113
- "origin_event_id" text NOT NULL,
114
- "payload_json" jsonb NOT NULL,
115
- "status" text DEFAULT 'pending' NOT NULL,
116
- CONSTRAINT "workflow_effect_dispatches_completion_status_check" CHECK ((("workflow_effect_dispatches"."status" = 'completed' and "workflow_effect_dispatches"."completed_at" is not null) or ("workflow_effect_dispatches"."status" <> 'completed' and "workflow_effect_dispatches"."completed_at" is null)))
117
- );
118
- --> statement-breakpoint
119
- ALTER TABLE "workflow_effect_dispatches" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
120
- ALTER TABLE "query_actions" ADD CONSTRAINT "query_actions_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
121
- ALTER TABLE "query_action_events" ADD CONSTRAINT "query_action_events_action_id_query_actions_id_fk" FOREIGN KEY ("action_id") REFERENCES "public"."query_actions"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
122
- ALTER TABLE "query_action_events" ADD CONSTRAINT "query_action_events_command_id_workflow_commands_id_fk" FOREIGN KEY ("command_id") REFERENCES "public"."workflow_commands"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
123
- ALTER TABLE "source_api_actions" ADD CONSTRAINT "source_api_actions_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
124
- ALTER TABLE "source_api_action_events" ADD CONSTRAINT "source_api_action_events_action_id_source_api_actions_id_fk" FOREIGN KEY ("action_id") REFERENCES "public"."source_api_actions"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
125
- ALTER TABLE "source_api_action_events" ADD CONSTRAINT "source_api_action_events_command_id_workflow_commands_id_fk" FOREIGN KEY ("command_id") REFERENCES "public"."workflow_commands"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
126
- ALTER TABLE "workflow_commands" ADD CONSTRAINT "workflow_commands_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
127
- CREATE UNIQUE INDEX "idx_audit_projection_checkpoints_projection_family_unique" ON "audit_projection_checkpoints" USING btree ("projection_name","family");--> statement-breakpoint
128
- CREATE INDEX "idx_query_actions_org_started" ON "query_actions" USING btree ("organization_id","started_at");--> statement-breakpoint
129
- CREATE UNIQUE INDEX "idx_query_action_events_action_sequence_unique" ON "query_action_events" USING btree ("action_id","sequence");--> statement-breakpoint
130
- CREATE UNIQUE INDEX "idx_query_action_events_commit_position_unique" ON "query_action_events" USING btree ("commit_position");--> statement-breakpoint
131
- CREATE INDEX "idx_query_action_events_command_sequence" ON "query_action_events" USING btree ("command_id","sequence");--> statement-breakpoint
132
- CREATE INDEX "idx_source_api_actions_org_started" ON "source_api_actions" USING btree ("organization_id","started_at");--> statement-breakpoint
133
- CREATE UNIQUE INDEX "idx_source_api_action_events_action_sequence_unique" ON "source_api_action_events" USING btree ("action_id","sequence");--> statement-breakpoint
134
- CREATE UNIQUE INDEX "idx_source_api_action_events_commit_position_unique" ON "source_api_action_events" USING btree ("commit_position");--> statement-breakpoint
135
- CREATE INDEX "idx_source_api_action_events_command_sequence" ON "source_api_action_events" USING btree ("command_id","sequence");--> statement-breakpoint
136
- CREATE UNIQUE INDEX "idx_workflow_commands_family_invocation_unique" ON "workflow_commands" USING btree ("family","command_invocation_id");--> statement-breakpoint
137
- CREATE INDEX "idx_workflow_commands_action_created" ON "workflow_commands" USING btree ("family","action_id","created_at");--> statement-breakpoint
138
- CREATE INDEX "idx_workflow_commands_org_created" ON "workflow_commands" USING btree ("organization_id","created_at");--> statement-breakpoint
139
- CREATE UNIQUE INDEX "idx_workflow_effect_dispatches_effect_key_unique" ON "workflow_effect_dispatches" USING btree ("effect_key");--> statement-breakpoint
140
- CREATE INDEX "idx_workflow_effect_dispatches_status_available" ON "workflow_effect_dispatches" USING btree ("status","available_at");--> statement-breakpoint
141
- CREATE INDEX "idx_workflow_effect_dispatches_family_action_created" ON "workflow_effect_dispatches" USING btree ("family","action_id","created_at");
@@ -1,29 +0,0 @@
1
- CREATE TABLE "audit_feed_entries" (
2
- "action_name" text NOT NULL,
3
- "completed_at" timestamp with time zone,
4
- "failure_code" text,
5
- "family" text NOT NULL,
6
- "family_action_id" text NOT NULL,
7
- "family_preview_json" jsonb,
8
- "last_event_at" timestamp with time zone NOT NULL,
9
- "last_projected_sequence" integer NOT NULL,
10
- "last_event_type" text NOT NULL,
11
- "metrics_json" jsonb,
12
- "organization_id" text NOT NULL,
13
- "origin_actor_json" jsonb NOT NULL,
14
- "origin_surface" text NOT NULL,
15
- "outcome" text NOT NULL,
16
- "phase" text NOT NULL,
17
- "search_document" text NOT NULL,
18
- "started_at" timestamp with time zone NOT NULL,
19
- "subtitle" text NOT NULL,
20
- "target_json" jsonb NOT NULL,
21
- "title" text NOT NULL,
22
- CONSTRAINT "audit_feed_entries_family_action_pk" PRIMARY KEY("family","family_action_id")
23
- );
24
- --> statement-breakpoint
25
- ALTER TABLE "audit_feed_entries" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
26
- ALTER TABLE "audit_projection_checkpoints" ALTER COLUMN "last_commit_position" SET DEFAULT 0;--> statement-breakpoint
27
- ALTER TABLE "audit_feed_entries" ADD CONSTRAINT "audit_feed_entries_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
28
- CREATE INDEX "idx_audit_feed_entries_org_started_identity" ON "audit_feed_entries" USING btree ("organization_id","started_at","family","family_action_id");--> statement-breakpoint
29
- CREATE INDEX "idx_audit_feed_entries_org_family_started" ON "audit_feed_entries" USING btree ("organization_id","family","started_at");
@@ -1,5 +0,0 @@
1
- DROP TABLE "cli_query_actions" CASCADE;--> statement-breakpoint
2
- DROP TABLE "cli_query_action_events" CASCADE;--> statement-breakpoint
3
- ALTER TABLE "query_action_events" DROP CONSTRAINT "query_action_events_action_id_query_actions_id_fk";
4
- --> statement-breakpoint
5
- ALTER TABLE "source_api_action_events" DROP CONSTRAINT "source_api_action_events_action_id_source_api_actions_id_fk";
@@ -1,8 +0,0 @@
1
- ALTER TABLE "query_action_events" ADD COLUMN "payload_bytes" "bytea" NOT NULL;--> statement-breakpoint
2
- ALTER TABLE "source_api_action_events" ADD COLUMN "payload_bytes" "bytea" NOT NULL;--> statement-breakpoint
3
- ALTER TABLE "workflow_commands" ADD COLUMN "command_payload_bytes" "bytea" NOT NULL;--> statement-breakpoint
4
- ALTER TABLE "workflow_effect_dispatches" ADD COLUMN "payload_bytes" "bytea" NOT NULL;--> statement-breakpoint
5
- ALTER TABLE "query_action_events" DROP COLUMN "payload_json";--> statement-breakpoint
6
- ALTER TABLE "source_api_action_events" DROP COLUMN "payload_json";--> statement-breakpoint
7
- ALTER TABLE "workflow_commands" DROP COLUMN "command_payload_json";--> statement-breakpoint
8
- ALTER TABLE "workflow_effect_dispatches" DROP COLUMN "payload_json";