Build the agent-native compute CRM platform
CI / verify (push) Successful in 3m6s

This commit is contained in:
2026-08-13 01:39:01 -07:00
parent bfd2f8d95a
commit 853bde2265
160 changed files with 61812 additions and 483 deletions
@@ -0,0 +1 @@
ALTER TYPE "public"."pig_security_tier" ADD VALUE 'government' BEFORE 'secure_cloud';
@@ -0,0 +1 @@
ALTER TYPE "public"."pig_fact_status" ADD VALUE 'approved' BEFORE 'proposed';
@@ -0,0 +1,16 @@
CREATE TABLE "platform_settings" (
"id" text PRIMARY KEY DEFAULT 'default' NOT NULL,
"piggy_model" text DEFAULT 'nvidia/nemotron-3-nano-30b-a3b' NOT NULL,
"piggy_inference_base" text DEFAULT 'https://api.pinference.ai/api/v1' NOT NULL,
"piggy_enabled" boolean DEFAULT false NOT NULL,
"prime_api_key_encrypted" text,
"prime_api_key_updated_at" timestamp with time zone,
"prime_sync_enabled" boolean DEFAULT false NOT NULL,
"prime_sync_interval_minutes" integer DEFAULT 30 NOT NULL,
"updated_by_user_id" uuid,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "platform_settings_singleton_check" CHECK ("platform_settings"."id" = 'default'),
CONSTRAINT "platform_settings_sync_interval_check" CHECK ("platform_settings"."prime_sync_interval_minutes" BETWEEN 1 AND 1440)
);
--> statement-breakpoint
ALTER TABLE "platform_settings" ADD CONSTRAINT "platform_settings_updated_by_user_id_users_id_fk" FOREIGN KEY ("updated_by_user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;
@@ -0,0 +1,33 @@
CREATE TABLE "notification_outbox" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"provider" text NOT NULL,
"kind" text NOT NULL,
"link_id" uuid,
"workspace_id" text,
"destination" text NOT NULL,
"payload" jsonb NOT NULL,
"idempotency_key" text NOT NULL,
"status" text DEFAULT 'pending' NOT NULL,
"attempts" integer DEFAULT 0 NOT NULL,
"max_attempts" integer DEFAULT 5 NOT NULL,
"due_at" timestamp with time zone DEFAULT now() NOT NULL,
"leased_until" timestamp with time zone,
"leased_by" text,
"delivered_at" timestamp with time zone,
"external_id" text,
"error" text,
"requested_by_user_id" uuid,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
DROP INDEX "channel_links_platform_channel_key";--> statement-breakpoint
ALTER TABLE "channel_links" ADD COLUMN "workspace_id" text DEFAULT '' NOT NULL;--> statement-breakpoint
ALTER TABLE "channel_links" ADD COLUMN "linked_by_user_id" uuid;--> statement-breakpoint
ALTER TABLE "channel_links" ADD COLUMN "updated_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
ALTER TABLE "notification_outbox" ADD CONSTRAINT "notification_outbox_link_id_channel_links_id_fk" FOREIGN KEY ("link_id") REFERENCES "public"."channel_links"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "notification_outbox" ADD CONSTRAINT "notification_outbox_requested_by_user_id_users_id_fk" FOREIGN KEY ("requested_by_user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "notification_outbox_idempotency_key" ON "notification_outbox" USING btree ("idempotency_key");--> statement-breakpoint
CREATE INDEX "notification_outbox_claimable_idx" ON "notification_outbox" USING btree ("provider","status","due_at");--> statement-breakpoint
CREATE INDEX "notification_outbox_link_idx" ON "notification_outbox" USING btree ("link_id");--> statement-breakpoint
ALTER TABLE "channel_links" ADD CONSTRAINT "channel_links_linked_by_user_id_users_id_fk" FOREIGN KEY ("linked_by_user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "channel_links_platform_workspace_channel_key" ON "channel_links" USING btree ("platform","workspace_id","channel_id");
@@ -0,0 +1,14 @@
CREATE TABLE "import_identities" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"entity" text NOT NULL,
"key_column" text NOT NULL,
"key_value" text NOT NULL,
"record_id" uuid NOT NULL,
"imported_by_user_id" uuid,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "import_identities" ADD CONSTRAINT "import_identities_imported_by_user_id_users_id_fk" FOREIGN KEY ("imported_by_user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "import_identities_source_key" ON "import_identities" USING btree ("entity","key_column","key_value");--> statement-breakpoint
CREATE INDEX "import_identities_record_idx" ON "import_identities" USING btree ("entity","record_id");
@@ -0,0 +1,25 @@
CREATE TABLE "notion_connections" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" uuid NOT NULL,
"workspace_id" text NOT NULL,
"workspace_name" text,
"workspace_icon" text,
"bot_id" text,
"credentials_encrypted" text NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "notion_oauth_states" (
"state_hash" text PRIMARY KEY NOT NULL,
"user_id" uuid NOT NULL,
"verifier_hash" text NOT NULL,
"expires_at" timestamp with time zone NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "notion_connections" ADD CONSTRAINT "notion_connections_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "notion_oauth_states" ADD CONSTRAINT "notion_oauth_states_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "notion_connections_user_workspace_key" ON "notion_connections" USING btree ("user_id","workspace_id");--> statement-breakpoint
CREATE INDEX "notion_connections_user_idx" ON "notion_connections" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX "notion_oauth_states_expiry_idx" ON "notion_oauth_states" USING btree ("expires_at");
@@ -0,0 +1,26 @@
CREATE TABLE "google_connections" (
"user_id" uuid PRIMARY KEY NOT NULL,
"refresh_token_encrypted" text NOT NULL,
"access_token_encrypted" text,
"access_token_expires_at" timestamp with time zone,
"scopes" jsonb DEFAULT '[]'::jsonb NOT NULL,
"connected_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "google_oauth_flows" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" uuid NOT NULL,
"state_hash" text NOT NULL,
"browser_binding_hash" text NOT NULL,
"pkce_verifier_encrypted" text NOT NULL,
"expires_at" timestamp with time zone NOT NULL,
"consumed_at" timestamp with time zone,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "google_connections" ADD CONSTRAINT "google_connections_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "google_oauth_flows" ADD CONSTRAINT "google_oauth_flows_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "google_oauth_flows_state_hash_key" ON "google_oauth_flows" USING btree ("state_hash");--> statement-breakpoint
CREATE INDEX "google_oauth_flows_expiry_idx" ON "google_oauth_flows" USING btree ("expires_at");--> statement-breakpoint
CREATE INDEX "google_oauth_flows_user_idx" ON "google_oauth_flows" USING btree ("user_id");
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+50 -1
View File
@@ -22,6 +22,55 @@
"when": 1786588874252,
"tag": "0002_invite_reuse",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1786600259806,
"tag": "0003_amazing_miss_america",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1786602049010,
"tag": "0004_fact_approval",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1786611600000,
"tag": "0005_platform_settings",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1786611700000,
"tag": "0006_dazzling_forge",
"breakpoints": true
},
{
"idx": 7,
"version": "7",
"when": 1786611800000,
"tag": "0007_nasty_vanisher",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1786611900000,
"tag": "0008_easy_scalphunter",
"breakpoints": true
},
{
"idx": 9,
"version": "7",
"when": 1786612000000,
"tag": "0009_warm_metal_master",
"breakpoints": true
}
]
}
}