@growthub/cli 0.3.11 → 0.3.12

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 (78) hide show
  1. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/_journal.json +7 -0
  2. package/package.json +1 -1
  3. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0000_mature_masked_marvel.sql +0 -208
  4. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0001_fast_northstar.sql +0 -87
  5. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0002_big_zaladane.sql +0 -1
  6. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0003_shallow_quentin_quire.sql +0 -5
  7. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0004_issue_identifiers.sql +0 -28
  8. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0005_chief_luke_cage.sql +0 -19
  9. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +0 -36
  10. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0007_new_quentin_quire.sql +0 -20
  11. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0008_amused_zzzax.sql +0 -1
  12. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0009_fast_jackal.sql +0 -36
  13. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0010_stale_justin_hammer.sql +0 -37
  14. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0011_windy_corsair.sql +0 -18
  15. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +0 -2
  16. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0013_dashing_wasp.sql +0 -4
  17. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +0 -135
  18. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0015_project_color_archived.sql +0 -2
  19. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0016_agent_icon.sql +0 -1
  20. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +0 -51
  21. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0018_flat_sleepwalker.sql +0 -26
  22. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0019_public_victor_mancha.sql +0 -18
  23. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0020_white_anita_blake.sql +0 -1
  24. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0021_chief_vindicator.sql +0 -1
  25. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0022_company_brand_color.sql +0 -1
  26. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0023_fair_lethal_legion.sql +0 -3
  27. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0024_far_beast.sql +0 -2
  28. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0025_nasty_salo.sql +0 -15
  29. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0026_lying_pete_wisdom.sql +0 -39
  30. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0027_tranquil_tenebrous.sql +0 -2
  31. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0028_harsh_goliath.sql +0 -54
  32. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0029_plugin_tables.sql +0 -177
  33. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0030_rich_magneto.sql +0 -12
  34. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0031_zippy_magma.sql +0 -51
  35. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0032_pretty_doctor_octopus.sql +0 -102
  36. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0033_shiny_black_tarantula.sql +0 -2
  37. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0034_fat_dormammu.sql +0 -2
  38. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0035_marvelous_satana.sql +0 -91
  39. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0036_cheerful_nitro.sql +0 -9
  40. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0037_friendly_eddie_brock.sql +0 -29
  41. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0038_careless_iron_monger.sql +0 -5
  42. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/0039_tickets.sql +0 -25
  43. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0000_snapshot.json +0 -1743
  44. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0001_snapshot.json +0 -2441
  45. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0002_snapshot.json +0 -2454
  46. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0003_snapshot.json +0 -2502
  47. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0005_snapshot.json +0 -2719
  48. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0006_snapshot.json +0 -3048
  49. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0007_snapshot.json +0 -3258
  50. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0008_snapshot.json +0 -3264
  51. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0009_snapshot.json +0 -3587
  52. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0010_snapshot.json +0 -3929
  53. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0011_snapshot.json +0 -4068
  54. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0012_snapshot.json +0 -4087
  55. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0013_snapshot.json +0 -4118
  56. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0014_snapshot.json +0 -5187
  57. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0017_snapshot.json +0 -5215
  58. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0018_snapshot.json +0 -5450
  59. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0019_snapshot.json +0 -5603
  60. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0020_snapshot.json +0 -5603
  61. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0021_snapshot.json +0 -5609
  62. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0023_snapshot.json +0 -5633
  63. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0024_snapshot.json +0 -5693
  64. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0025_snapshot.json +0 -5849
  65. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0027_snapshot.json +0 -6205
  66. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0028_snapshot.json +0 -6710
  67. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0029_snapshot.json +0 -7899
  68. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0030_snapshot.json +0 -8003
  69. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0031_snapshot.json +0 -7242
  70. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0032_snapshot.json +0 -7733
  71. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0033_snapshot.json +0 -9038
  72. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0034_snapshot.json +0 -9039
  73. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0035_snapshot.json +0 -9959
  74. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0036_snapshot.json +0 -10023
  75. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0037_snapshot.json +0 -10263
  76. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/0038_snapshot.json +0 -10301
  77. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/migrations/meta/_journal.json +0 -293
  78. /package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/{migrations/0040_ticket_meta.sql → 0040_ticket_meta.sql} +0 -0
@@ -1,51 +0,0 @@
1
- CREATE TABLE "finance_events" (
2
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
- "company_id" uuid NOT NULL,
4
- "agent_id" uuid,
5
- "issue_id" uuid,
6
- "project_id" uuid,
7
- "goal_id" uuid,
8
- "heartbeat_run_id" uuid,
9
- "cost_event_id" uuid,
10
- "billing_code" text,
11
- "description" text,
12
- "event_kind" text NOT NULL,
13
- "direction" text DEFAULT 'debit' NOT NULL,
14
- "biller" text NOT NULL,
15
- "provider" text,
16
- "execution_adapter_type" text,
17
- "pricing_tier" text,
18
- "region" text,
19
- "model" text,
20
- "quantity" integer,
21
- "unit" text,
22
- "amount_cents" integer NOT NULL,
23
- "currency" text DEFAULT 'USD' NOT NULL,
24
- "estimated" boolean DEFAULT false NOT NULL,
25
- "external_invoice_id" text,
26
- "metadata_json" jsonb,
27
- "occurred_at" timestamp with time zone NOT NULL,
28
- "created_at" timestamp with time zone DEFAULT now() NOT NULL
29
- );
30
- --> statement-breakpoint
31
- ALTER TABLE "cost_events" ADD COLUMN "heartbeat_run_id" uuid;--> statement-breakpoint
32
- ALTER TABLE "cost_events" ADD COLUMN "biller" text DEFAULT 'unknown' NOT NULL;--> statement-breakpoint
33
- ALTER TABLE "cost_events" ADD COLUMN "billing_type" text DEFAULT 'unknown' NOT NULL;--> statement-breakpoint
34
- ALTER TABLE "cost_events" ADD COLUMN "cached_input_tokens" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
35
- ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
36
- ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_agent_id_agents_id_fk" FOREIGN KEY ("agent_id") REFERENCES "public"."agents"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
37
- ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_issue_id_issues_id_fk" FOREIGN KEY ("issue_id") REFERENCES "public"."issues"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
38
- ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
39
- ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_goal_id_goals_id_fk" FOREIGN KEY ("goal_id") REFERENCES "public"."goals"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
40
- ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_heartbeat_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("heartbeat_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
41
- ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_cost_event_id_cost_events_id_fk" FOREIGN KEY ("cost_event_id") REFERENCES "public"."cost_events"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
42
- CREATE INDEX "finance_events_company_occurred_idx" ON "finance_events" USING btree ("company_id","occurred_at");--> statement-breakpoint
43
- CREATE INDEX "finance_events_company_biller_occurred_idx" ON "finance_events" USING btree ("company_id","biller","occurred_at");--> statement-breakpoint
44
- CREATE INDEX "finance_events_company_kind_occurred_idx" ON "finance_events" USING btree ("company_id","event_kind","occurred_at");--> statement-breakpoint
45
- CREATE INDEX "finance_events_company_direction_occurred_idx" ON "finance_events" USING btree ("company_id","direction","occurred_at");--> statement-breakpoint
46
- CREATE INDEX "finance_events_company_heartbeat_run_idx" ON "finance_events" USING btree ("company_id","heartbeat_run_id");--> statement-breakpoint
47
- CREATE INDEX "finance_events_company_cost_event_idx" ON "finance_events" USING btree ("company_id","cost_event_id");--> statement-breakpoint
48
- ALTER TABLE "cost_events" ADD CONSTRAINT "cost_events_heartbeat_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("heartbeat_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
49
- CREATE INDEX "cost_events_company_provider_occurred_idx" ON "cost_events" USING btree ("company_id","provider","occurred_at");--> statement-breakpoint
50
- CREATE INDEX "cost_events_company_biller_occurred_idx" ON "cost_events" USING btree ("company_id","biller","occurred_at");--> statement-breakpoint
51
- CREATE INDEX "cost_events_company_heartbeat_run_idx" ON "cost_events" USING btree ("company_id","heartbeat_run_id");
@@ -1,102 +0,0 @@
1
- CREATE TABLE "budget_incidents" (
2
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
- "company_id" uuid NOT NULL,
4
- "policy_id" uuid NOT NULL,
5
- "scope_type" text NOT NULL,
6
- "scope_id" uuid NOT NULL,
7
- "metric" text NOT NULL,
8
- "window_kind" text NOT NULL,
9
- "window_start" timestamp with time zone NOT NULL,
10
- "window_end" timestamp with time zone NOT NULL,
11
- "threshold_type" text NOT NULL,
12
- "amount_limit" integer NOT NULL,
13
- "amount_observed" integer NOT NULL,
14
- "status" text DEFAULT 'open' NOT NULL,
15
- "approval_id" uuid,
16
- "resolved_at" timestamp with time zone,
17
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
18
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
19
- );
20
- --> statement-breakpoint
21
- CREATE TABLE "budget_policies" (
22
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
23
- "company_id" uuid NOT NULL,
24
- "scope_type" text NOT NULL,
25
- "scope_id" uuid NOT NULL,
26
- "metric" text DEFAULT 'billed_cents' NOT NULL,
27
- "window_kind" text NOT NULL,
28
- "amount" integer DEFAULT 0 NOT NULL,
29
- "warn_percent" integer DEFAULT 80 NOT NULL,
30
- "hard_stop_enabled" boolean DEFAULT true NOT NULL,
31
- "notify_enabled" boolean DEFAULT true NOT NULL,
32
- "is_active" boolean DEFAULT true NOT NULL,
33
- "created_by_user_id" text,
34
- "updated_by_user_id" text,
35
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
36
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
37
- );
38
- --> statement-breakpoint
39
- ALTER TABLE "agents" ADD COLUMN "pause_reason" text;--> statement-breakpoint
40
- ALTER TABLE "agents" ADD COLUMN "paused_at" timestamp with time zone;--> statement-breakpoint
41
- ALTER TABLE "projects" ADD COLUMN "pause_reason" text;--> statement-breakpoint
42
- ALTER TABLE "projects" ADD COLUMN "paused_at" timestamp with time zone;--> statement-breakpoint
43
- INSERT INTO "budget_policies" (
44
- "company_id",
45
- "scope_type",
46
- "scope_id",
47
- "metric",
48
- "window_kind",
49
- "amount",
50
- "warn_percent",
51
- "hard_stop_enabled",
52
- "notify_enabled",
53
- "is_active"
54
- )
55
- SELECT
56
- "id",
57
- 'company',
58
- "id",
59
- 'billed_cents',
60
- 'calendar_month_utc',
61
- "budget_monthly_cents",
62
- 80,
63
- true,
64
- true,
65
- true
66
- FROM "companies"
67
- WHERE "budget_monthly_cents" > 0;--> statement-breakpoint
68
- INSERT INTO "budget_policies" (
69
- "company_id",
70
- "scope_type",
71
- "scope_id",
72
- "metric",
73
- "window_kind",
74
- "amount",
75
- "warn_percent",
76
- "hard_stop_enabled",
77
- "notify_enabled",
78
- "is_active"
79
- )
80
- SELECT
81
- "company_id",
82
- 'agent',
83
- "id",
84
- 'billed_cents',
85
- 'calendar_month_utc',
86
- "budget_monthly_cents",
87
- 80,
88
- true,
89
- true,
90
- true
91
- FROM "agents"
92
- WHERE "budget_monthly_cents" > 0;--> statement-breakpoint
93
- ALTER TABLE "budget_incidents" ADD CONSTRAINT "budget_incidents_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
94
- ALTER TABLE "budget_incidents" ADD CONSTRAINT "budget_incidents_policy_id_budget_policies_id_fk" FOREIGN KEY ("policy_id") REFERENCES "public"."budget_policies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
95
- ALTER TABLE "budget_incidents" ADD CONSTRAINT "budget_incidents_approval_id_approvals_id_fk" FOREIGN KEY ("approval_id") REFERENCES "public"."approvals"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
96
- ALTER TABLE "budget_policies" ADD CONSTRAINT "budget_policies_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
97
- CREATE INDEX "budget_incidents_company_status_idx" ON "budget_incidents" USING btree ("company_id","status");--> statement-breakpoint
98
- CREATE INDEX "budget_incidents_company_scope_idx" ON "budget_incidents" USING btree ("company_id","scope_type","scope_id","status");--> statement-breakpoint
99
- CREATE UNIQUE INDEX "budget_incidents_policy_window_threshold_idx" ON "budget_incidents" USING btree ("policy_id","window_start","threshold_type");--> statement-breakpoint
100
- CREATE INDEX "budget_policies_company_scope_active_idx" ON "budget_policies" USING btree ("company_id","scope_type","scope_id","is_active");--> statement-breakpoint
101
- CREATE INDEX "budget_policies_company_window_idx" ON "budget_policies" USING btree ("company_id","window_kind","metric");--> statement-breakpoint
102
- CREATE UNIQUE INDEX "budget_policies_company_scope_metric_unique_idx" ON "budget_policies" USING btree ("company_id","scope_type","scope_id","metric","window_kind");
@@ -1,2 +0,0 @@
1
- ALTER TABLE "companies" ADD COLUMN "pause_reason" text;--> statement-breakpoint
2
- ALTER TABLE "companies" ADD COLUMN "paused_at" timestamp with time zone;
@@ -1,2 +0,0 @@
1
- DROP INDEX "budget_incidents_policy_window_threshold_idx";--> statement-breakpoint
2
- CREATE UNIQUE INDEX "budget_incidents_policy_window_threshold_idx" ON "budget_incidents" USING btree ("policy_id","window_start","threshold_type") WHERE "budget_incidents"."status" <> 'dismissed';
@@ -1,91 +0,0 @@
1
- CREATE TABLE "execution_workspaces" (
2
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
- "company_id" uuid NOT NULL,
4
- "project_id" uuid NOT NULL,
5
- "project_workspace_id" uuid,
6
- "source_issue_id" uuid,
7
- "mode" text NOT NULL,
8
- "strategy_type" text NOT NULL,
9
- "name" text NOT NULL,
10
- "status" text DEFAULT 'active' NOT NULL,
11
- "cwd" text,
12
- "repo_url" text,
13
- "base_ref" text,
14
- "branch_name" text,
15
- "provider_type" text DEFAULT 'local_fs' NOT NULL,
16
- "provider_ref" text,
17
- "derived_from_execution_workspace_id" uuid,
18
- "last_used_at" timestamp with time zone DEFAULT now() NOT NULL,
19
- "opened_at" timestamp with time zone DEFAULT now() NOT NULL,
20
- "closed_at" timestamp with time zone,
21
- "cleanup_eligible_at" timestamp with time zone,
22
- "cleanup_reason" text,
23
- "metadata" jsonb,
24
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
25
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
26
- );
27
- --> statement-breakpoint
28
- CREATE TABLE "issue_work_products" (
29
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
30
- "company_id" uuid NOT NULL,
31
- "project_id" uuid,
32
- "issue_id" uuid NOT NULL,
33
- "execution_workspace_id" uuid,
34
- "runtime_service_id" uuid,
35
- "type" text NOT NULL,
36
- "provider" text NOT NULL,
37
- "external_id" text,
38
- "title" text NOT NULL,
39
- "url" text,
40
- "status" text NOT NULL,
41
- "review_state" text DEFAULT 'none' NOT NULL,
42
- "is_primary" boolean DEFAULT false NOT NULL,
43
- "health_status" text DEFAULT 'unknown' NOT NULL,
44
- "summary" text,
45
- "metadata" jsonb,
46
- "created_by_run_id" uuid,
47
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
48
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
49
- );
50
- --> statement-breakpoint
51
- ALTER TABLE "issues" ADD COLUMN "project_workspace_id" uuid;--> statement-breakpoint
52
- ALTER TABLE "issues" ADD COLUMN "execution_workspace_id" uuid;--> statement-breakpoint
53
- ALTER TABLE "issues" ADD COLUMN "execution_workspace_preference" text;--> statement-breakpoint
54
- ALTER TABLE "project_workspaces" ADD COLUMN "source_type" text DEFAULT 'local_path' NOT NULL;--> statement-breakpoint
55
- ALTER TABLE "project_workspaces" ADD COLUMN "default_ref" text;--> statement-breakpoint
56
- ALTER TABLE "project_workspaces" ADD COLUMN "visibility" text DEFAULT 'default' NOT NULL;--> statement-breakpoint
57
- ALTER TABLE "project_workspaces" ADD COLUMN "setup_command" text;--> statement-breakpoint
58
- ALTER TABLE "project_workspaces" ADD COLUMN "cleanup_command" text;--> statement-breakpoint
59
- ALTER TABLE "project_workspaces" ADD COLUMN "remote_provider" text;--> statement-breakpoint
60
- ALTER TABLE "project_workspaces" ADD COLUMN "remote_workspace_ref" text;--> statement-breakpoint
61
- ALTER TABLE "project_workspaces" ADD COLUMN "shared_workspace_key" text;--> statement-breakpoint
62
- ALTER TABLE "workspace_runtime_services" ADD COLUMN "execution_workspace_id" uuid;--> statement-breakpoint
63
- ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
64
- ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
65
- ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_project_workspace_id_project_workspaces_id_fk" FOREIGN KEY ("project_workspace_id") REFERENCES "public"."project_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
66
- ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_source_issue_id_issues_id_fk" FOREIGN KEY ("source_issue_id") REFERENCES "public"."issues"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
67
- ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_derived_from_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("derived_from_execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
68
- ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
69
- ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
70
- ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_issue_id_issues_id_fk" FOREIGN KEY ("issue_id") REFERENCES "public"."issues"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
71
- ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
72
- ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_runtime_service_id_workspace_runtime_services_id_fk" FOREIGN KEY ("runtime_service_id") REFERENCES "public"."workspace_runtime_services"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
73
- ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_created_by_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("created_by_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
74
- CREATE INDEX "execution_workspaces_company_project_status_idx" ON "execution_workspaces" USING btree ("company_id","project_id","status");--> statement-breakpoint
75
- CREATE INDEX "execution_workspaces_company_project_workspace_status_idx" ON "execution_workspaces" USING btree ("company_id","project_workspace_id","status");--> statement-breakpoint
76
- CREATE INDEX "execution_workspaces_company_source_issue_idx" ON "execution_workspaces" USING btree ("company_id","source_issue_id");--> statement-breakpoint
77
- CREATE INDEX "execution_workspaces_company_last_used_idx" ON "execution_workspaces" USING btree ("company_id","last_used_at");--> statement-breakpoint
78
- CREATE INDEX "execution_workspaces_company_branch_idx" ON "execution_workspaces" USING btree ("company_id","branch_name");--> statement-breakpoint
79
- CREATE INDEX "issue_work_products_company_issue_type_idx" ON "issue_work_products" USING btree ("company_id","issue_id","type");--> statement-breakpoint
80
- CREATE INDEX "issue_work_products_company_execution_workspace_type_idx" ON "issue_work_products" USING btree ("company_id","execution_workspace_id","type");--> statement-breakpoint
81
- CREATE INDEX "issue_work_products_company_provider_external_id_idx" ON "issue_work_products" USING btree ("company_id","provider","external_id");--> statement-breakpoint
82
- CREATE INDEX "issue_work_products_company_updated_idx" ON "issue_work_products" USING btree ("company_id","updated_at");--> statement-breakpoint
83
- ALTER TABLE "issues" ADD CONSTRAINT "issues_project_workspace_id_project_workspaces_id_fk" FOREIGN KEY ("project_workspace_id") REFERENCES "public"."project_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
84
- ALTER TABLE "issues" ADD CONSTRAINT "issues_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
85
- ALTER TABLE "workspace_runtime_services" ADD CONSTRAINT "workspace_runtime_services_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
86
- CREATE INDEX "issues_company_project_workspace_idx" ON "issues" USING btree ("company_id","project_workspace_id");--> statement-breakpoint
87
- CREATE INDEX "issues_company_execution_workspace_idx" ON "issues" USING btree ("company_id","execution_workspace_id");--> statement-breakpoint
88
- CREATE INDEX "project_workspaces_project_source_type_idx" ON "project_workspaces" USING btree ("project_id","source_type");--> statement-breakpoint
89
- CREATE INDEX "project_workspaces_company_shared_key_idx" ON "project_workspaces" USING btree ("company_id","shared_workspace_key");--> statement-breakpoint
90
- CREATE UNIQUE INDEX "project_workspaces_project_remote_ref_idx" ON "project_workspaces" USING btree ("project_id","remote_provider","remote_workspace_ref");--> statement-breakpoint
91
- CREATE INDEX "workspace_runtime_services_company_execution_workspace_status_idx" ON "workspace_runtime_services" USING btree ("company_id","execution_workspace_id","status");
@@ -1,9 +0,0 @@
1
- CREATE TABLE "instance_settings" (
2
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
- "singleton_key" text DEFAULT 'default' NOT NULL,
4
- "experimental" jsonb DEFAULT '{}'::jsonb NOT NULL,
5
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
6
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
7
- );
8
- --> statement-breakpoint
9
- CREATE UNIQUE INDEX "instance_settings_singleton_key_idx" ON "instance_settings" USING btree ("singleton_key");
@@ -1,29 +0,0 @@
1
- CREATE TABLE "workspace_operations" (
2
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
- "company_id" uuid NOT NULL,
4
- "execution_workspace_id" uuid,
5
- "heartbeat_run_id" uuid,
6
- "phase" text NOT NULL,
7
- "command" text,
8
- "cwd" text,
9
- "status" text DEFAULT 'running' NOT NULL,
10
- "exit_code" integer,
11
- "log_store" text,
12
- "log_ref" text,
13
- "log_bytes" bigint,
14
- "log_sha256" text,
15
- "log_compressed" boolean DEFAULT false NOT NULL,
16
- "stdout_excerpt" text,
17
- "stderr_excerpt" text,
18
- "metadata" jsonb,
19
- "started_at" timestamp with time zone DEFAULT now() NOT NULL,
20
- "finished_at" timestamp with time zone,
21
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
22
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
23
- );
24
- --> statement-breakpoint
25
- ALTER TABLE "workspace_operations" ADD CONSTRAINT "workspace_operations_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
26
- ALTER TABLE "workspace_operations" ADD CONSTRAINT "workspace_operations_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
27
- ALTER TABLE "workspace_operations" ADD CONSTRAINT "workspace_operations_heartbeat_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("heartbeat_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
28
- CREATE INDEX "workspace_operations_company_run_started_idx" ON "workspace_operations" USING btree ("company_id","heartbeat_run_id","started_at");--> statement-breakpoint
29
- CREATE INDEX "workspace_operations_company_workspace_started_idx" ON "workspace_operations" USING btree ("company_id","execution_workspace_id","started_at");
@@ -1,5 +0,0 @@
1
- ALTER TABLE "heartbeat_runs" ADD COLUMN "process_pid" integer;--> statement-breakpoint
2
- ALTER TABLE "heartbeat_runs" ADD COLUMN "process_started_at" timestamp with time zone;--> statement-breakpoint
3
- ALTER TABLE "heartbeat_runs" ADD COLUMN "retry_of_run_id" uuid;--> statement-breakpoint
4
- ALTER TABLE "heartbeat_runs" ADD COLUMN "process_loss_retry_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
5
- ALTER TABLE "heartbeat_runs" ADD CONSTRAINT "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("retry_of_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE set null ON UPDATE no action;
@@ -1,25 +0,0 @@
1
- CREATE TABLE IF NOT EXISTS "tickets" (
2
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
- "company_id" uuid NOT NULL REFERENCES "companies"("id"),
4
- "title" text NOT NULL,
5
- "description" text,
6
- "identifier" text,
7
- "status" text DEFAULT 'active' NOT NULL,
8
- "current_stage" text DEFAULT 'planning' NOT NULL,
9
- "stage_order" jsonb DEFAULT '["planning","execution","review","qa","human"]' NOT NULL,
10
- "created_by_user_id" text,
11
- "created_by_agent_id" uuid,
12
- "completed_at" timestamp with time zone,
13
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
14
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
15
- );
16
- --> statement-breakpoint
17
- CREATE INDEX IF NOT EXISTS "tickets_company_idx" ON "tickets" ("company_id");
18
- --> statement-breakpoint
19
- CREATE INDEX IF NOT EXISTS "tickets_company_status_idx" ON "tickets" ("company_id", "status");
20
- --> statement-breakpoint
21
- ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "ticket_id" uuid REFERENCES "tickets"("id") ON DELETE SET NULL;
22
- --> statement-breakpoint
23
- ALTER TABLE "issues" ADD COLUMN IF NOT EXISTS "ticket_stage" text;
24
- --> statement-breakpoint
25
- CREATE INDEX IF NOT EXISTS "issues_company_ticket_idx" ON "issues" ("company_id", "ticket_id");