@fidelios/db 0.0.1 → 0.0.3

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 (95) hide show
  1. package/dist/backup.js +1 -1
  2. package/dist/backup.js.map +1 -1
  3. package/dist/migration-runtime.js +8 -8
  4. package/dist/migration-runtime.js.map +1 -1
  5. package/dist/restore.js +3 -3
  6. package/dist/restore.js.map +1 -1
  7. package/dist/test-embedded-postgres.js +6 -6
  8. package/dist/test-embedded-postgres.js.map +1 -1
  9. package/package.json +1 -1
  10. package/dist/migrations/migrations/0000_mature_masked_marvel.sql +0 -208
  11. package/dist/migrations/migrations/0001_fast_northstar.sql +0 -87
  12. package/dist/migrations/migrations/0002_big_zaladane.sql +0 -1
  13. package/dist/migrations/migrations/0003_shallow_quentin_quire.sql +0 -5
  14. package/dist/migrations/migrations/0004_issue_identifiers.sql +0 -28
  15. package/dist/migrations/migrations/0005_chief_luke_cage.sql +0 -19
  16. package/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +0 -36
  17. package/dist/migrations/migrations/0007_new_quentin_quire.sql +0 -20
  18. package/dist/migrations/migrations/0008_amused_zzzax.sql +0 -1
  19. package/dist/migrations/migrations/0009_fast_jackal.sql +0 -36
  20. package/dist/migrations/migrations/0010_stale_justin_hammer.sql +0 -37
  21. package/dist/migrations/migrations/0011_windy_corsair.sql +0 -18
  22. package/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +0 -2
  23. package/dist/migrations/migrations/0013_dashing_wasp.sql +0 -4
  24. package/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +0 -135
  25. package/dist/migrations/migrations/0015_project_color_archived.sql +0 -2
  26. package/dist/migrations/migrations/0016_agent_icon.sql +0 -1
  27. package/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +0 -51
  28. package/dist/migrations/migrations/0018_flat_sleepwalker.sql +0 -26
  29. package/dist/migrations/migrations/0019_public_victor_mancha.sql +0 -18
  30. package/dist/migrations/migrations/0020_white_anita_blake.sql +0 -1
  31. package/dist/migrations/migrations/0021_chief_vindicator.sql +0 -1
  32. package/dist/migrations/migrations/0022_company_brand_color.sql +0 -1
  33. package/dist/migrations/migrations/0023_fair_lethal_legion.sql +0 -3
  34. package/dist/migrations/migrations/0024_far_beast.sql +0 -2
  35. package/dist/migrations/migrations/0025_nasty_salo.sql +0 -15
  36. package/dist/migrations/migrations/0026_lying_pete_wisdom.sql +0 -39
  37. package/dist/migrations/migrations/0027_tranquil_tenebrous.sql +0 -2
  38. package/dist/migrations/migrations/0028_harsh_goliath.sql +0 -54
  39. package/dist/migrations/migrations/0029_plugin_tables.sql +0 -177
  40. package/dist/migrations/migrations/0030_rich_magneto.sql +0 -12
  41. package/dist/migrations/migrations/0031_zippy_magma.sql +0 -51
  42. package/dist/migrations/migrations/0032_pretty_doctor_octopus.sql +0 -102
  43. package/dist/migrations/migrations/0033_shiny_black_tarantula.sql +0 -2
  44. package/dist/migrations/migrations/0034_fat_dormammu.sql +0 -2
  45. package/dist/migrations/migrations/0035_marvelous_satana.sql +0 -91
  46. package/dist/migrations/migrations/0036_cheerful_nitro.sql +0 -9
  47. package/dist/migrations/migrations/0037_friendly_eddie_brock.sql +0 -29
  48. package/dist/migrations/migrations/0038_careless_iron_monger.sql +0 -5
  49. package/dist/migrations/migrations/0039_fat_magneto.sql +0 -161
  50. package/dist/migrations/migrations/0040_eager_shotgun.sql +0 -5
  51. package/dist/migrations/migrations/0041_curly_maria_hill.sql +0 -1
  52. package/dist/migrations/migrations/0042_spotty_the_renegades.sql +0 -26
  53. package/dist/migrations/migrations/0043_reflective_captain_universe.sql +0 -6
  54. package/dist/migrations/migrations/0044_illegal_toad.sql +0 -56
  55. package/dist/migrations/migrations/0045_workable_shockwave.sql +0 -17
  56. package/dist/migrations/migrations/meta/0000_snapshot.json +0 -1743
  57. package/dist/migrations/migrations/meta/0001_snapshot.json +0 -2441
  58. package/dist/migrations/migrations/meta/0002_snapshot.json +0 -2454
  59. package/dist/migrations/migrations/meta/0003_snapshot.json +0 -2502
  60. package/dist/migrations/migrations/meta/0005_snapshot.json +0 -2719
  61. package/dist/migrations/migrations/meta/0006_snapshot.json +0 -3048
  62. package/dist/migrations/migrations/meta/0007_snapshot.json +0 -3258
  63. package/dist/migrations/migrations/meta/0008_snapshot.json +0 -3264
  64. package/dist/migrations/migrations/meta/0009_snapshot.json +0 -3587
  65. package/dist/migrations/migrations/meta/0010_snapshot.json +0 -3929
  66. package/dist/migrations/migrations/meta/0011_snapshot.json +0 -4068
  67. package/dist/migrations/migrations/meta/0012_snapshot.json +0 -4087
  68. package/dist/migrations/migrations/meta/0013_snapshot.json +0 -4118
  69. package/dist/migrations/migrations/meta/0014_snapshot.json +0 -5187
  70. package/dist/migrations/migrations/meta/0017_snapshot.json +0 -5215
  71. package/dist/migrations/migrations/meta/0018_snapshot.json +0 -5450
  72. package/dist/migrations/migrations/meta/0019_snapshot.json +0 -5603
  73. package/dist/migrations/migrations/meta/0020_snapshot.json +0 -5603
  74. package/dist/migrations/migrations/meta/0021_snapshot.json +0 -5609
  75. package/dist/migrations/migrations/meta/0023_snapshot.json +0 -5633
  76. package/dist/migrations/migrations/meta/0024_snapshot.json +0 -5693
  77. package/dist/migrations/migrations/meta/0025_snapshot.json +0 -5849
  78. package/dist/migrations/migrations/meta/0027_snapshot.json +0 -6205
  79. package/dist/migrations/migrations/meta/0028_snapshot.json +0 -6710
  80. package/dist/migrations/migrations/meta/0029_snapshot.json +0 -7899
  81. package/dist/migrations/migrations/meta/0030_snapshot.json +0 -8003
  82. package/dist/migrations/migrations/meta/0031_snapshot.json +0 -7242
  83. package/dist/migrations/migrations/meta/0032_snapshot.json +0 -7733
  84. package/dist/migrations/migrations/meta/0033_snapshot.json +0 -9038
  85. package/dist/migrations/migrations/meta/0034_snapshot.json +0 -9039
  86. package/dist/migrations/migrations/meta/0035_snapshot.json +0 -9959
  87. package/dist/migrations/migrations/meta/0036_snapshot.json +0 -10023
  88. package/dist/migrations/migrations/meta/0037_snapshot.json +0 -10263
  89. package/dist/migrations/migrations/meta/0038_snapshot.json +0 -11350
  90. package/dist/migrations/migrations/meta/0039_snapshot.json +0 -10308
  91. package/dist/migrations/migrations/meta/0040_snapshot.json +0 -10481
  92. package/dist/migrations/migrations/meta/0041_snapshot.json +0 -11393
  93. package/dist/migrations/migrations/meta/0044_snapshot.json +0 -11701
  94. package/dist/migrations/migrations/meta/0045_snapshot.json +0 -11857
  95. package/dist/migrations/migrations/meta/_journal.json +0 -328
@@ -1,177 +0,0 @@
1
- -- Rollback:
2
- -- DROP INDEX IF EXISTS "plugin_logs_level_idx";
3
- -- DROP INDEX IF EXISTS "plugin_logs_plugin_time_idx";
4
- -- DROP INDEX IF EXISTS "plugin_company_settings_company_plugin_uq";
5
- -- DROP INDEX IF EXISTS "plugin_company_settings_plugin_idx";
6
- -- DROP INDEX IF EXISTS "plugin_company_settings_company_idx";
7
- -- DROP INDEX IF EXISTS "plugin_webhook_deliveries_key_idx";
8
- -- DROP INDEX IF EXISTS "plugin_webhook_deliveries_status_idx";
9
- -- DROP INDEX IF EXISTS "plugin_webhook_deliveries_plugin_idx";
10
- -- DROP INDEX IF EXISTS "plugin_job_runs_status_idx";
11
- -- DROP INDEX IF EXISTS "plugin_job_runs_plugin_idx";
12
- -- DROP INDEX IF EXISTS "plugin_job_runs_job_idx";
13
- -- DROP INDEX IF EXISTS "plugin_jobs_unique_idx";
14
- -- DROP INDEX IF EXISTS "plugin_jobs_next_run_idx";
15
- -- DROP INDEX IF EXISTS "plugin_jobs_plugin_idx";
16
- -- DROP INDEX IF EXISTS "plugin_entities_external_idx";
17
- -- DROP INDEX IF EXISTS "plugin_entities_scope_idx";
18
- -- DROP INDEX IF EXISTS "plugin_entities_type_idx";
19
- -- DROP INDEX IF EXISTS "plugin_entities_plugin_idx";
20
- -- DROP INDEX IF EXISTS "plugin_state_plugin_scope_idx";
21
- -- DROP INDEX IF EXISTS "plugin_config_plugin_id_idx";
22
- -- DROP INDEX IF EXISTS "plugins_status_idx";
23
- -- DROP INDEX IF EXISTS "plugins_plugin_key_idx";
24
- -- DROP TABLE IF EXISTS "plugin_logs";
25
- -- DROP TABLE IF EXISTS "plugin_company_settings";
26
- -- DROP TABLE IF EXISTS "plugin_webhook_deliveries";
27
- -- DROP TABLE IF EXISTS "plugin_job_runs";
28
- -- DROP TABLE IF EXISTS "plugin_jobs";
29
- -- DROP TABLE IF EXISTS "plugin_entities";
30
- -- DROP TABLE IF EXISTS "plugin_state";
31
- -- DROP TABLE IF EXISTS "plugin_config";
32
- -- DROP TABLE IF EXISTS "plugins";
33
-
34
- CREATE TABLE "plugins" (
35
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
36
- "plugin_key" text NOT NULL,
37
- "package_name" text NOT NULL,
38
- "package_path" text,
39
- "version" text NOT NULL,
40
- "api_version" integer DEFAULT 1 NOT NULL,
41
- "categories" jsonb DEFAULT '[]'::jsonb NOT NULL,
42
- "manifest_json" jsonb NOT NULL,
43
- "status" text DEFAULT 'installed' NOT NULL,
44
- "install_order" integer,
45
- "last_error" text,
46
- "installed_at" timestamp with time zone DEFAULT now() NOT NULL,
47
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
48
- );
49
- --> statement-breakpoint
50
- CREATE TABLE "plugin_config" (
51
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
52
- "plugin_id" uuid NOT NULL,
53
- "config_json" jsonb DEFAULT '{}'::jsonb NOT NULL,
54
- "last_error" text,
55
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
56
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
57
- );
58
- --> statement-breakpoint
59
- CREATE TABLE "plugin_state" (
60
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
61
- "plugin_id" uuid NOT NULL,
62
- "scope_kind" text NOT NULL,
63
- "scope_id" text,
64
- "namespace" text DEFAULT 'default' NOT NULL,
65
- "state_key" text NOT NULL,
66
- "value_json" jsonb NOT NULL,
67
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
68
- CONSTRAINT "plugin_state_unique_entry_idx" UNIQUE NULLS NOT DISTINCT("plugin_id","scope_kind","scope_id","namespace","state_key")
69
- );
70
- --> statement-breakpoint
71
- CREATE TABLE "plugin_entities" (
72
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
73
- "plugin_id" uuid NOT NULL,
74
- "entity_type" text NOT NULL,
75
- "scope_kind" text NOT NULL,
76
- "scope_id" text,
77
- "external_id" text,
78
- "title" text,
79
- "status" text,
80
- "data" jsonb DEFAULT '{}'::jsonb NOT NULL,
81
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
82
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
83
- );
84
- --> statement-breakpoint
85
- CREATE TABLE "plugin_jobs" (
86
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
87
- "plugin_id" uuid NOT NULL,
88
- "job_key" text NOT NULL,
89
- "schedule" text NOT NULL,
90
- "status" text DEFAULT 'active' NOT NULL,
91
- "last_run_at" timestamp with time zone,
92
- "next_run_at" timestamp with time zone,
93
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
94
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL
95
- );
96
- --> statement-breakpoint
97
- CREATE TABLE "plugin_job_runs" (
98
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
99
- "job_id" uuid NOT NULL,
100
- "plugin_id" uuid NOT NULL,
101
- "trigger" text NOT NULL,
102
- "status" text DEFAULT 'pending' NOT NULL,
103
- "duration_ms" integer,
104
- "error" text,
105
- "logs" jsonb DEFAULT '[]'::jsonb NOT NULL,
106
- "started_at" timestamp with time zone,
107
- "finished_at" timestamp with time zone,
108
- "created_at" timestamp with time zone DEFAULT now() NOT NULL
109
- );
110
- --> statement-breakpoint
111
- CREATE TABLE "plugin_webhook_deliveries" (
112
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
113
- "plugin_id" uuid NOT NULL,
114
- "webhook_key" text NOT NULL,
115
- "external_id" text,
116
- "status" text DEFAULT 'pending' NOT NULL,
117
- "duration_ms" integer,
118
- "error" text,
119
- "payload" jsonb NOT NULL,
120
- "headers" jsonb DEFAULT '{}'::jsonb NOT NULL,
121
- "started_at" timestamp with time zone,
122
- "finished_at" timestamp with time zone,
123
- "created_at" timestamp with time zone DEFAULT now() NOT NULL
124
- );
125
- --> statement-breakpoint
126
- CREATE TABLE "plugin_company_settings" (
127
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
128
- "company_id" uuid NOT NULL,
129
- "plugin_id" uuid NOT NULL,
130
- "settings_json" jsonb DEFAULT '{}'::jsonb NOT NULL,
131
- "last_error" text,
132
- "created_at" timestamp with time zone DEFAULT now() NOT NULL,
133
- "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
134
- "enabled" boolean DEFAULT true NOT NULL
135
- );
136
- --> statement-breakpoint
137
- CREATE TABLE "plugin_logs" (
138
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
139
- "plugin_id" uuid NOT NULL,
140
- "level" text NOT NULL DEFAULT 'info',
141
- "message" text NOT NULL,
142
- "meta" jsonb,
143
- "created_at" timestamp with time zone NOT NULL DEFAULT now()
144
- );
145
- --> statement-breakpoint
146
- ALTER TABLE "plugin_config" ADD CONSTRAINT "plugin_config_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
147
- ALTER TABLE "plugin_state" ADD CONSTRAINT "plugin_state_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
148
- ALTER TABLE "plugin_entities" ADD CONSTRAINT "plugin_entities_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
149
- ALTER TABLE "plugin_jobs" ADD CONSTRAINT "plugin_jobs_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
150
- ALTER TABLE "plugin_job_runs" ADD CONSTRAINT "plugin_job_runs_job_id_plugin_jobs_id_fk" FOREIGN KEY ("job_id") REFERENCES "public"."plugin_jobs"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
151
- ALTER TABLE "plugin_job_runs" ADD CONSTRAINT "plugin_job_runs_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
152
- ALTER TABLE "plugin_webhook_deliveries" ADD CONSTRAINT "plugin_webhook_deliveries_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
153
- ALTER TABLE "plugin_company_settings" ADD CONSTRAINT "plugin_company_settings_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
154
- ALTER TABLE "plugin_company_settings" ADD CONSTRAINT "plugin_company_settings_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
155
- ALTER TABLE "plugin_logs" ADD CONSTRAINT "plugin_logs_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
156
- CREATE UNIQUE INDEX "plugins_plugin_key_idx" ON "plugins" USING btree ("plugin_key");--> statement-breakpoint
157
- CREATE INDEX "plugins_status_idx" ON "plugins" USING btree ("status");--> statement-breakpoint
158
- CREATE UNIQUE INDEX "plugin_config_plugin_id_idx" ON "plugin_config" USING btree ("plugin_id");--> statement-breakpoint
159
- CREATE INDEX "plugin_state_plugin_scope_idx" ON "plugin_state" USING btree ("plugin_id","scope_kind");--> statement-breakpoint
160
- CREATE INDEX "plugin_entities_plugin_idx" ON "plugin_entities" USING btree ("plugin_id");--> statement-breakpoint
161
- CREATE INDEX "plugin_entities_type_idx" ON "plugin_entities" USING btree ("entity_type");--> statement-breakpoint
162
- CREATE INDEX "plugin_entities_scope_idx" ON "plugin_entities" USING btree ("scope_kind","scope_id");--> statement-breakpoint
163
- CREATE UNIQUE INDEX "plugin_entities_external_idx" ON "plugin_entities" USING btree ("plugin_id","entity_type","external_id");--> statement-breakpoint
164
- CREATE INDEX "plugin_jobs_plugin_idx" ON "plugin_jobs" USING btree ("plugin_id");--> statement-breakpoint
165
- CREATE INDEX "plugin_jobs_next_run_idx" ON "plugin_jobs" USING btree ("next_run_at");--> statement-breakpoint
166
- CREATE UNIQUE INDEX "plugin_jobs_unique_idx" ON "plugin_jobs" USING btree ("plugin_id","job_key");--> statement-breakpoint
167
- CREATE INDEX "plugin_job_runs_job_idx" ON "plugin_job_runs" USING btree ("job_id");--> statement-breakpoint
168
- CREATE INDEX "plugin_job_runs_plugin_idx" ON "plugin_job_runs" USING btree ("plugin_id");--> statement-breakpoint
169
- CREATE INDEX "plugin_job_runs_status_idx" ON "plugin_job_runs" USING btree ("status");--> statement-breakpoint
170
- CREATE INDEX "plugin_webhook_deliveries_plugin_idx" ON "plugin_webhook_deliveries" USING btree ("plugin_id");--> statement-breakpoint
171
- CREATE INDEX "plugin_webhook_deliveries_status_idx" ON "plugin_webhook_deliveries" USING btree ("status");--> statement-breakpoint
172
- CREATE INDEX "plugin_webhook_deliveries_key_idx" ON "plugin_webhook_deliveries" USING btree ("webhook_key");--> statement-breakpoint
173
- CREATE INDEX "plugin_company_settings_company_idx" ON "plugin_company_settings" USING btree ("company_id");--> statement-breakpoint
174
- CREATE INDEX "plugin_company_settings_plugin_idx" ON "plugin_company_settings" USING btree ("plugin_id");--> statement-breakpoint
175
- CREATE UNIQUE INDEX "plugin_company_settings_company_plugin_uq" ON "plugin_company_settings" USING btree ("company_id","plugin_id");--> statement-breakpoint
176
- CREATE INDEX "plugin_logs_plugin_time_idx" ON "plugin_logs" USING btree ("plugin_id","created_at");--> statement-breakpoint
177
- CREATE INDEX "plugin_logs_level_idx" ON "plugin_logs" USING btree ("level");
@@ -1,12 +0,0 @@
1
- CREATE TABLE "company_logos" (
2
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
- "company_id" uuid NOT NULL,
4
- "asset_id" uuid 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
- ALTER TABLE "company_logos" ADD CONSTRAINT "company_logos_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
10
- ALTER TABLE "company_logos" ADD CONSTRAINT "company_logos_asset_id_assets_id_fk" FOREIGN KEY ("asset_id") REFERENCES "public"."assets"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
11
- CREATE UNIQUE INDEX "company_logos_company_uq" ON "company_logos" USING btree ("company_id");--> statement-breakpoint
12
- CREATE UNIQUE INDEX "company_logos_asset_uq" ON "company_logos" USING btree ("asset_id");
@@ -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;