SPB Git forge

spb/fetcha

Public
11commits 1branches 0releases
1.5 MBsize
maindefault branch
16 days agolast push
TypeScript 97.5% SQL 1.4% Python 0.8%
20.2 KB · 410 lines sql
Raw Blame History
1CREATE TABLE "abuse_events" (2	"id" text PRIMARY KEY NOT NULL,3	"organization_id" text,4	"project_id" text,5	"request_id" text,6	"kind" text NOT NULL,7	"severity" text DEFAULT 'low' NOT NULL,8	"detail" text,9	"resolved" boolean DEFAULT false NOT NULL,10	"created_at" timestamp with time zone DEFAULT now() NOT NULL11);12--> statement-breakpoint13CREATE TABLE "accounts" (14	"id" text PRIMARY KEY NOT NULL,15	"account_id" text NOT NULL,16	"provider_id" text NOT NULL,17	"user_id" text NOT NULL,18	"access_token" text,19	"refresh_token" text,20	"id_token" text,21	"access_token_expires_at" timestamp with time zone,22	"refresh_token_expires_at" timestamp with time zone,23	"scope" text,24	"password" text,25	"created_at" timestamp with time zone DEFAULT now() NOT NULL,26	"updated_at" timestamp with time zone DEFAULT now() NOT NULL27);28--> statement-breakpoint29CREATE TABLE "api_keys" (30	"id" text PRIMARY KEY NOT NULL,31	"organization_id" text NOT NULL,32	"project_id" text NOT NULL,33	"created_by_user_id" text,34	"name" text NOT NULL,35	"key_hash" text NOT NULL,36	"key_prefix" text NOT NULL,37	"last4" text NOT NULL,38	"mode" text DEFAULT 'live' NOT NULL,39	"scopes" jsonb DEFAULT '["fetch:execute","sessions:write","usage:read"]'::jsonb NOT NULL,40	"expires_at" timestamp with time zone,41	"last_used_at" timestamp with time zone,42	"revoked_at" timestamp with time zone,43	"rotated_from_id" text,44	"created_at" timestamp with time zone DEFAULT now() NOT NULL45);46--> statement-breakpoint47CREATE TABLE "audit_logs" (48	"id" text PRIMARY KEY NOT NULL,49	"organization_id" text,50	"user_id" text,51	"action" text NOT NULL,52	"target" text,53	"metadata" jsonb,54	"ip_address" text,55	"user_agent" text,56	"created_at" timestamp with time zone DEFAULT now() NOT NULL57);58--> statement-breakpoint59CREATE TABLE "billing_events" (60	"id" text PRIMARY KEY NOT NULL,61	"organization_id" text,62	"type" text NOT NULL,63	"stripe_event_id" text,64	"payload" jsonb,65	"created_at" timestamp with time zone DEFAULT now() NOT NULL66);67--> statement-breakpoint68CREATE TABLE "domain_profiles" (69	"domain" text PRIMARY KEY NOT NULL,70	"preferred_network" text,71	"preferred_provider" text,72	"requests" integer DEFAULT 0 NOT NULL,73	"successes" integer DEFAULT 0 NOT NULL,74	"blocks" integer DEFAULT 0 NOT NULL,75	"captchas" integer DEFAULT 0 NOT NULL,76	"browser_required" integer DEFAULT 0 NOT NULL,77	"avg_latency_ms" double precision DEFAULT 0 NOT NULL,78	"route_stats" jsonb DEFAULT '{}'::jsonb NOT NULL,79	"policy" jsonb,80	"last_seen_at" timestamp with time zone DEFAULT now() NOT NULL,81	"updated_at" timestamp with time zone DEFAULT now() NOT NULL82);83--> statement-breakpoint84CREATE TABLE "feature_flags" (85	"key" text PRIMARY KEY NOT NULL,86	"enabled" boolean DEFAULT false NOT NULL,87	"description" text,88	"plans" jsonb,89	"organization_ids" jsonb,90	"updated_at" timestamp with time zone DEFAULT now() NOT NULL91);92--> statement-breakpoint93CREATE TABLE "fetch_requests" (94	"id" text PRIMARY KEY NOT NULL,95	"organization_id" text NOT NULL,96	"project_id" text NOT NULL,97	"api_key_id" text,98	"source" text DEFAULT 'api' NOT NULL,99	"url" text NOT NULL,100	"final_url" text,101	"domain" text NOT NULL,102	"method" text DEFAULT 'GET' NOT NULL,103	"requested_network" text DEFAULT 'auto' NOT NULL,104	"network" text,105	"country" text,106	"region" text,107	"city" text,108	"session_id" text,109	"browser" boolean DEFAULT false NOT NULL,110	"format" text DEFAULT 'html' NOT NULL,111	"status" text DEFAULT 'pending' NOT NULL,112	"http_status" integer,113	"error_code" text,114	"error_message" text,115	"attempts" integer DEFAULT 0 NOT NULL,116	"latency_ms" integer,117	"bytes_in" bigint DEFAULT 0 NOT NULL,118	"bytes_out" bigint DEFAULT 0 NOT NULL,119	"cost_usd" double precision DEFAULT 0 NOT NULL,120	"price_usd" double precision DEFAULT 0 NOT NULL,121	"cached" boolean DEFAULT false NOT NULL,122	"request_headers" jsonb,123	"response_headers" jsonb,124	"timing" jsonb,125	"client_ip" text,126	"user_agent" text,127	"created_at" timestamp with time zone DEFAULT now() NOT NULL,128	"completed_at" timestamp with time zone129);130--> statement-breakpoint131CREATE TABLE "legal_acceptances" (132	"id" text PRIMARY KEY NOT NULL,133	"user_id" text NOT NULL,134	"document" text NOT NULL,135	"version" text NOT NULL,136	"ip_address" text,137	"accepted_at" timestamp with time zone DEFAULT now() NOT NULL138);139--> statement-breakpoint140CREATE TABLE "organization_members" (141	"organization_id" text NOT NULL,142	"user_id" text NOT NULL,143	"role" text DEFAULT 'owner' NOT NULL,144	"created_at" timestamp with time zone DEFAULT now() NOT NULL,145	CONSTRAINT "organization_members_organization_id_user_id_pk" PRIMARY KEY("organization_id","user_id")146);147--> statement-breakpoint148CREATE TABLE "organizations" (149	"id" text PRIMARY KEY NOT NULL,150	"name" text NOT NULL,151	"slug" text NOT NULL,152	"plan" text DEFAULT 'free' NOT NULL,153	"owner_user_id" text NOT NULL,154	"provider_visibility" boolean DEFAULT false NOT NULL,155	"soft_limit_usd" double precision,156	"hard_limit_usd" double precision,157	"stripe_customer_id" text,158	"suspended" boolean DEFAULT false NOT NULL,159	"created_at" timestamp with time zone DEFAULT now() NOT NULL,160	"updated_at" timestamp with time zone DEFAULT now() NOT NULL161);162--> statement-breakpoint163CREATE TABLE "projects" (164	"id" text PRIMARY KEY NOT NULL,165	"organization_id" text NOT NULL,166	"name" text NOT NULL,167	"slug" text NOT NULL,168	"description" text,169	"environment" text DEFAULT 'production' NOT NULL,170	"default_country" text,171	"default_network" text DEFAULT 'auto' NOT NULL,172	"log_level" text DEFAULT 'metadata' NOT NULL,173	"soft_limit_usd" double precision,174	"hard_limit_usd" double precision,175	"monthly_request_limit" integer,176	"archived_at" timestamp with time zone,177	"created_at" timestamp with time zone DEFAULT now() NOT NULL,178	"updated_at" timestamp with time zone DEFAULT now() NOT NULL179);180--> statement-breakpoint181CREATE TABLE "provider_configs" (182	"id" text PRIMARY KEY NOT NULL,183	"label" text NOT NULL,184	"enabled" boolean DEFAULT true NOT NULL,185	"networks" jsonb DEFAULT '["residential"]'::jsonb NOT NULL,186	"price_per_gb_usd" jsonb DEFAULT '{}'::jsonb NOT NULL,187	"weight" double precision DEFAULT 1 NOT NULL,188	"max_concurrency" integer DEFAULT 200 NOT NULL,189	"notes" text,190	"updated_at" timestamp with time zone DEFAULT now() NOT NULL191);192--> statement-breakpoint193CREATE TABLE "provider_health" (194	"id" text PRIMARY KEY NOT NULL,195	"provider" text NOT NULL,196	"network" text NOT NULL,197	"status" text NOT NULL,198	"latency_ms" integer,199	"success_rate" double precision,200	"detail" text,201	"checked_at" timestamp with time zone DEFAULT now() NOT NULL202);203--> statement-breakpoint204CREATE TABLE "proxy_sessions" (205	"id" text PRIMARY KEY NOT NULL,206	"organization_id" text NOT NULL,207	"project_id" text NOT NULL,208	"label" text,209	"provider" text NOT NULL,210	"network" text NOT NULL,211	"country" text,212	"region" text,213	"city" text,214	"sticky_key" text NOT NULL,215	"cookies" jsonb DEFAULT '[]'::jsonb NOT NULL,216	"status" text DEFAULT 'active' NOT NULL,217	"request_count" integer DEFAULT 0 NOT NULL,218	"last_used_at" timestamp with time zone,219	"expires_at" timestamp with time zone NOT NULL,220	"created_at" timestamp with time zone DEFAULT now() NOT NULL221);222--> statement-breakpoint223CREATE TABLE "request_attempts" (224	"id" text PRIMARY KEY NOT NULL,225	"request_id" text NOT NULL,226	"attempt_no" integer NOT NULL,227	"provider" text NOT NULL,228	"network" text NOT NULL,229	"country" text,230	"session_key" text,231	"outcome" text NOT NULL,232	"http_status" integer,233	"error_code" text,234	"error_detail" text,235	"block_reason" text,236	"duration_ms" integer DEFAULT 0 NOT NULL,237	"bytes_in" bigint DEFAULT 0 NOT NULL,238	"bytes_out" bigint DEFAULT 0 NOT NULL,239	"unit_price_per_gb" double precision DEFAULT 0 NOT NULL,240	"cost_usd" double precision DEFAULT 0 NOT NULL,241	"routing_score" double precision,242	"timing" jsonb,243	"created_at" timestamp with time zone DEFAULT now() NOT NULL244);245--> statement-breakpoint246CREATE TABLE "routing_metrics" (247	"id" text PRIMARY KEY NOT NULL,248	"bucket" timestamp with time zone NOT NULL,249	"provider" text NOT NULL,250	"network" text NOT NULL,251	"country" text,252	"requests" integer DEFAULT 0 NOT NULL,253	"successes" integer DEFAULT 0 NOT NULL,254	"blocked" integer DEFAULT 0 NOT NULL,255	"errors" integer DEFAULT 0 NOT NULL,256	"latency_sum_ms" bigint DEFAULT 0 NOT NULL,257	"bytes" bigint DEFAULT 0 NOT NULL,258	"cost_usd" double precision DEFAULT 0 NOT NULL259);260--> statement-breakpoint261CREATE TABLE "sessions" (262	"id" text PRIMARY KEY NOT NULL,263	"expires_at" timestamp with time zone NOT NULL,264	"token" text NOT NULL,265	"created_at" timestamp with time zone DEFAULT now() NOT NULL,266	"updated_at" timestamp with time zone DEFAULT now() NOT NULL,267	"ip_address" text,268	"user_agent" text,269	"user_id" text NOT NULL270);271--> statement-breakpoint272CREATE TABLE "status_incidents" (273	"id" text PRIMARY KEY NOT NULL,274	"component" text NOT NULL,275	"title" text NOT NULL,276	"body" text,277	"severity" text DEFAULT 'minor' NOT NULL,278	"started_at" timestamp with time zone DEFAULT now() NOT NULL,279	"resolved_at" timestamp with time zone280);281--> statement-breakpoint282CREATE TABLE "subscriptions" (283	"id" text PRIMARY KEY NOT NULL,284	"organization_id" text NOT NULL,285	"plan" text NOT NULL,286	"status" text DEFAULT 'active' NOT NULL,287	"stripe_subscription_id" text,288	"current_period_start" timestamp with time zone,289	"current_period_end" timestamp with time zone,290	"cancel_at_period_end" boolean DEFAULT false NOT NULL,291	"created_at" timestamp with time zone DEFAULT now() NOT NULL,292	"updated_at" timestamp with time zone DEFAULT now() NOT NULL293);294--> statement-breakpoint295CREATE TABLE "usage_events" (296	"id" text PRIMARY KEY NOT NULL,297	"organization_id" text NOT NULL,298	"project_id" text,299	"request_id" text,300	"metric" text NOT NULL,301	"quantity" double precision NOT NULL,302	"unit" text NOT NULL,303	"cost_usd" double precision DEFAULT 0 NOT NULL,304	"upstream_cost_usd" double precision DEFAULT 0 NOT NULL,305	"created_at" timestamp with time zone DEFAULT now() NOT NULL306);307--> statement-breakpoint308CREATE TABLE "users" (309	"id" text PRIMARY KEY NOT NULL,310	"name" text DEFAULT '' NOT NULL,311	"email" text NOT NULL,312	"email_verified" boolean DEFAULT false NOT NULL,313	"image" text,314	"role" text DEFAULT 'user' NOT NULL,315	"banned" boolean DEFAULT false NOT NULL,316	"ban_reason" text,317	"onboarding_completed_at" timestamp with time zone,318	"created_at" timestamp with time zone DEFAULT now() NOT NULL,319	"updated_at" timestamp with time zone DEFAULT now() NOT NULL320);321--> statement-breakpoint322CREATE TABLE "verifications" (323	"id" text PRIMARY KEY NOT NULL,324	"identifier" text NOT NULL,325	"value" text NOT NULL,326	"expires_at" timestamp with time zone NOT NULL,327	"created_at" timestamp with time zone DEFAULT now() NOT NULL,328	"updated_at" timestamp with time zone DEFAULT now() NOT NULL329);330--> statement-breakpoint331CREATE TABLE "webhook_deliveries" (332	"id" text PRIMARY KEY NOT NULL,333	"webhook_id" text NOT NULL,334	"event" text NOT NULL,335	"payload" jsonb NOT NULL,336	"status" text DEFAULT 'pending' NOT NULL,337	"response_status" integer,338	"attempts" integer DEFAULT 0 NOT NULL,339	"next_attempt_at" timestamp with time zone,340	"created_at" timestamp with time zone DEFAULT now() NOT NULL341);342--> statement-breakpoint343CREATE TABLE "webhooks" (344	"id" text PRIMARY KEY NOT NULL,345	"organization_id" text NOT NULL,346	"project_id" text,347	"url" text NOT NULL,348	"secret" text NOT NULL,349	"events" jsonb DEFAULT '[]'::jsonb NOT NULL,350	"enabled" boolean DEFAULT true NOT NULL,351	"created_at" timestamp with time zone DEFAULT now() NOT NULL352);353--> statement-breakpoint354ALTER TABLE "abuse_events" ADD CONSTRAINT "abuse_events_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint355ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint356ALTER TABLE "api_keys" ADD CONSTRAINT "api_keys_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint357ALTER TABLE "api_keys" ADD CONSTRAINT "api_keys_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint358ALTER TABLE "api_keys" ADD CONSTRAINT "api_keys_created_by_user_id_users_id_fk" FOREIGN KEY ("created_by_user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint359ALTER TABLE "audit_logs" ADD CONSTRAINT "audit_logs_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint360ALTER TABLE "audit_logs" ADD CONSTRAINT "audit_logs_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint361ALTER TABLE "billing_events" ADD CONSTRAINT "billing_events_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint362ALTER TABLE "fetch_requests" ADD CONSTRAINT "fetch_requests_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint363ALTER TABLE "fetch_requests" ADD CONSTRAINT "fetch_requests_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint364ALTER TABLE "fetch_requests" ADD CONSTRAINT "fetch_requests_api_key_id_api_keys_id_fk" FOREIGN KEY ("api_key_id") REFERENCES "public"."api_keys"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint365ALTER TABLE "legal_acceptances" ADD CONSTRAINT "legal_acceptances_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint366ALTER TABLE "organization_members" ADD CONSTRAINT "organization_members_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint367ALTER TABLE "organization_members" ADD CONSTRAINT "organization_members_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint368ALTER TABLE "organizations" ADD CONSTRAINT "organizations_owner_user_id_users_id_fk" FOREIGN KEY ("owner_user_id") REFERENCES "public"."users"("id") ON DELETE restrict ON UPDATE no action;--> statement-breakpoint369ALTER TABLE "projects" ADD CONSTRAINT "projects_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint370ALTER TABLE "proxy_sessions" ADD CONSTRAINT "proxy_sessions_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint371ALTER TABLE "proxy_sessions" ADD CONSTRAINT "proxy_sessions_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint372ALTER TABLE "request_attempts" ADD CONSTRAINT "request_attempts_request_id_fetch_requests_id_fk" FOREIGN KEY ("request_id") REFERENCES "public"."fetch_requests"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint373ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint374ALTER TABLE "subscriptions" ADD CONSTRAINT "subscriptions_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint375ALTER TABLE "usage_events" ADD CONSTRAINT "usage_events_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint376ALTER TABLE "usage_events" ADD CONSTRAINT "usage_events_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint377ALTER TABLE "webhook_deliveries" ADD CONSTRAINT "webhook_deliveries_webhook_id_webhooks_id_fk" FOREIGN KEY ("webhook_id") REFERENCES "public"."webhooks"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint378ALTER TABLE "webhooks" ADD CONSTRAINT "webhooks_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint379ALTER TABLE "webhooks" ADD CONSTRAINT "webhooks_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint380CREATE INDEX "abuse_events_org_idx" ON "abuse_events" USING btree ("organization_id");--> statement-breakpoint381CREATE INDEX "accounts_user_idx" ON "accounts" USING btree ("user_id");--> statement-breakpoint382CREATE UNIQUE INDEX "api_keys_hash_uq" ON "api_keys" USING btree ("key_hash");--> statement-breakpoint383CREATE INDEX "api_keys_project_idx" ON "api_keys" USING btree ("project_id");--> statement-breakpoint384CREATE INDEX "api_keys_org_idx" ON "api_keys" USING btree ("organization_id");--> statement-breakpoint385CREATE INDEX "audit_logs_org_created_idx" ON "audit_logs" USING btree ("organization_id","created_at");--> statement-breakpoint386CREATE INDEX "audit_logs_user_idx" ON "audit_logs" USING btree ("user_id");--> statement-breakpoint387CREATE INDEX "billing_events_org_idx" ON "billing_events" USING btree ("organization_id");--> statement-breakpoint388CREATE INDEX "fetch_requests_project_created_idx" ON "fetch_requests" USING btree ("project_id","created_at");--> statement-breakpoint389CREATE INDEX "fetch_requests_org_created_idx" ON "fetch_requests" USING btree ("organization_id","created_at");--> statement-breakpoint390CREATE INDEX "fetch_requests_domain_idx" ON "fetch_requests" USING btree ("domain");--> statement-breakpoint391CREATE INDEX "fetch_requests_created_idx" ON "fetch_requests" USING btree ("created_at");--> statement-breakpoint392CREATE INDEX "legal_acceptances_user_idx" ON "legal_acceptances" USING btree ("user_id");--> statement-breakpoint393CREATE INDEX "org_members_user_idx" ON "organization_members" USING btree ("user_id");--> statement-breakpoint394CREATE UNIQUE INDEX "organizations_slug_uq" ON "organizations" USING btree ("slug");--> statement-breakpoint395CREATE INDEX "organizations_owner_idx" ON "organizations" USING btree ("owner_user_id");--> statement-breakpoint396CREATE UNIQUE INDEX "projects_org_slug_uq" ON "projects" USING btree ("organization_id","slug");--> statement-breakpoint397CREATE INDEX "projects_org_idx" ON "projects" USING btree ("organization_id");--> statement-breakpoint398CREATE INDEX "provider_health_provider_checked_idx" ON "provider_health" USING btree ("provider","checked_at");--> statement-breakpoint399CREATE INDEX "proxy_sessions_project_idx" ON "proxy_sessions" USING btree ("project_id");--> statement-breakpoint400CREATE INDEX "proxy_sessions_expires_idx" ON "proxy_sessions" USING btree ("expires_at");--> statement-breakpoint401CREATE INDEX "request_attempts_request_idx" ON "request_attempts" USING btree ("request_id");--> statement-breakpoint402CREATE INDEX "request_attempts_provider_created_idx" ON "request_attempts" USING btree ("provider","created_at");--> statement-breakpoint403CREATE UNIQUE INDEX "routing_metrics_bucket_uq" ON "routing_metrics" USING btree ("bucket","provider","network","country");--> statement-breakpoint404CREATE UNIQUE INDEX "sessions_token_uq" ON "sessions" USING btree ("token");--> statement-breakpoint405CREATE INDEX "sessions_user_idx" ON "sessions" USING btree ("user_id");--> statement-breakpoint406CREATE INDEX "usage_events_org_created_idx" ON "usage_events" USING btree ("organization_id","created_at");--> statement-breakpoint407CREATE INDEX "usage_events_project_created_idx" ON "usage_events" USING btree ("project_id","created_at");--> statement-breakpoint408CREATE UNIQUE INDEX "users_email_uq" ON "users" USING btree ("email");--> statement-breakpoint409CREATE INDEX "verifications_identifier_idx" ON "verifications" USING btree ("identifier");--> statement-breakpoint410CREATE INDEX "webhook_deliveries_webhook_idx" ON "webhook_deliveries" USING btree ("webhook_id");