@kernhq/module-tracker 0.11.5 → 0.11.7
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.
package/migrations/0000_init.sql
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
CREATE SCHEMA IF NOT EXISTS "mod_tracker";
|
|
2
2
|
--> statement-breakpoint
|
|
3
|
-
CREATE TABLE "mod_tracker"."attachments" (
|
|
3
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."attachments" (
|
|
4
4
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
5
5
|
"workspace_id" uuid NOT NULL,
|
|
6
6
|
"issue_id" uuid NOT NULL,
|
|
@@ -12,7 +12,7 @@ CREATE TABLE "mod_tracker"."attachments" (
|
|
|
12
12
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
13
13
|
);
|
|
14
14
|
--> statement-breakpoint
|
|
15
|
-
CREATE TABLE "mod_tracker"."comment_reactions" (
|
|
15
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."comment_reactions" (
|
|
16
16
|
"comment_id" uuid NOT NULL,
|
|
17
17
|
"workspace_id" uuid NOT NULL,
|
|
18
18
|
"user_id" uuid NOT NULL,
|
|
@@ -21,7 +21,7 @@ CREATE TABLE "mod_tracker"."comment_reactions" (
|
|
|
21
21
|
CONSTRAINT "comment_reactions_comment_id_user_id_emoji_pk" PRIMARY KEY("comment_id","user_id","emoji")
|
|
22
22
|
);
|
|
23
23
|
--> statement-breakpoint
|
|
24
|
-
CREATE TABLE "mod_tracker"."comments" (
|
|
24
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."comments" (
|
|
25
25
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
26
26
|
"workspace_id" uuid NOT NULL,
|
|
27
27
|
"issue_id" uuid NOT NULL,
|
|
@@ -40,7 +40,7 @@ CREATE TABLE "mod_tracker"."comments" (
|
|
|
40
40
|
"search" "tsvector" GENERATED ALWAYS AS (to_tsvector('simple', coalesce(body_text, ''))) STORED
|
|
41
41
|
);
|
|
42
42
|
--> statement-breakpoint
|
|
43
|
-
CREATE TABLE "mod_tracker"."components" (
|
|
43
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."components" (
|
|
44
44
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
45
45
|
"workspace_id" uuid NOT NULL,
|
|
46
46
|
"project_id" uuid NOT NULL,
|
|
@@ -52,7 +52,7 @@ CREATE TABLE "mod_tracker"."components" (
|
|
|
52
52
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
53
53
|
);
|
|
54
54
|
--> statement-breakpoint
|
|
55
|
-
CREATE TABLE "mod_tracker"."cycles" (
|
|
55
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."cycles" (
|
|
56
56
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
57
57
|
"workspace_id" uuid NOT NULL,
|
|
58
58
|
"project_id" uuid NOT NULL,
|
|
@@ -70,7 +70,7 @@ CREATE TABLE "mod_tracker"."cycles" (
|
|
|
70
70
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
71
71
|
);
|
|
72
72
|
--> statement-breakpoint
|
|
73
|
-
CREATE TABLE "mod_tracker"."field_defs" (
|
|
73
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."field_defs" (
|
|
74
74
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
75
75
|
"workspace_id" uuid NOT NULL,
|
|
76
76
|
"project_id" uuid,
|
|
@@ -90,7 +90,7 @@ CREATE TABLE "mod_tracker"."field_defs" (
|
|
|
90
90
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
91
91
|
);
|
|
92
92
|
--> statement-breakpoint
|
|
93
|
-
CREATE TABLE "mod_tracker"."field_schemes" (
|
|
93
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."field_schemes" (
|
|
94
94
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
95
95
|
"workspace_id" uuid NOT NULL,
|
|
96
96
|
"name" text NOT NULL,
|
|
@@ -98,13 +98,13 @@ CREATE TABLE "mod_tracker"."field_schemes" (
|
|
|
98
98
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
99
99
|
);
|
|
100
100
|
--> statement-breakpoint
|
|
101
|
-
CREATE TABLE "mod_tracker"."hierarchy_rules" (
|
|
101
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."hierarchy_rules" (
|
|
102
102
|
"workspace_id" uuid PRIMARY KEY NOT NULL,
|
|
103
103
|
"rules" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
104
104
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
105
105
|
);
|
|
106
106
|
--> statement-breakpoint
|
|
107
|
-
CREATE TABLE "mod_tracker"."import_jobs" (
|
|
107
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."import_jobs" (
|
|
108
108
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
109
109
|
"workspace_id" uuid NOT NULL,
|
|
110
110
|
"project_id" uuid NOT NULL,
|
|
@@ -120,14 +120,14 @@ CREATE TABLE "mod_tracker"."import_jobs" (
|
|
|
120
120
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
121
121
|
);
|
|
122
122
|
--> statement-breakpoint
|
|
123
|
-
CREATE TABLE "mod_tracker"."intake_tokens" (
|
|
123
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."intake_tokens" (
|
|
124
124
|
"token" text PRIMARY KEY NOT NULL,
|
|
125
125
|
"workspace_id" uuid NOT NULL,
|
|
126
126
|
"project_id" uuid NOT NULL,
|
|
127
127
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
128
128
|
);
|
|
129
129
|
--> statement-breakpoint
|
|
130
|
-
CREATE TABLE "mod_tracker"."issue_approvals" (
|
|
130
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."issue_approvals" (
|
|
131
131
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
132
132
|
"workspace_id" uuid NOT NULL,
|
|
133
133
|
"issue_id" uuid NOT NULL,
|
|
@@ -137,14 +137,14 @@ CREATE TABLE "mod_tracker"."issue_approvals" (
|
|
|
137
137
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
138
138
|
);
|
|
139
139
|
--> statement-breakpoint
|
|
140
|
-
CREATE TABLE "mod_tracker"."issue_counters" (
|
|
140
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."issue_counters" (
|
|
141
141
|
"project_id" uuid PRIMARY KEY NOT NULL,
|
|
142
142
|
"workspace_id" uuid NOT NULL,
|
|
143
143
|
"last_issue_number" integer DEFAULT 0 NOT NULL,
|
|
144
144
|
"last_cycle_number" integer DEFAULT 0 NOT NULL
|
|
145
145
|
);
|
|
146
146
|
--> statement-breakpoint
|
|
147
|
-
CREATE TABLE "mod_tracker"."issue_history" (
|
|
147
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."issue_history" (
|
|
148
148
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
149
149
|
"workspace_id" uuid NOT NULL,
|
|
150
150
|
"issue_id" uuid NOT NULL,
|
|
@@ -155,7 +155,7 @@ CREATE TABLE "mod_tracker"."issue_history" (
|
|
|
155
155
|
"occurred_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
156
156
|
);
|
|
157
157
|
--> statement-breakpoint
|
|
158
|
-
CREATE TABLE "mod_tracker"."issue_status_history" (
|
|
158
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."issue_status_history" (
|
|
159
159
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
160
160
|
"workspace_id" uuid NOT NULL,
|
|
161
161
|
"issue_id" uuid NOT NULL,
|
|
@@ -170,7 +170,7 @@ CREATE TABLE "mod_tracker"."issue_status_history" (
|
|
|
170
170
|
"occurred_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
171
171
|
);
|
|
172
172
|
--> statement-breakpoint
|
|
173
|
-
CREATE TABLE "mod_tracker"."issue_templates" (
|
|
173
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."issue_templates" (
|
|
174
174
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
175
175
|
"workspace_id" uuid NOT NULL,
|
|
176
176
|
"project_id" uuid,
|
|
@@ -184,7 +184,7 @@ CREATE TABLE "mod_tracker"."issue_templates" (
|
|
|
184
184
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
185
185
|
);
|
|
186
186
|
--> statement-breakpoint
|
|
187
|
-
CREATE TABLE "mod_tracker"."issues" (
|
|
187
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."issues" (
|
|
188
188
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
189
189
|
"workspace_id" uuid NOT NULL,
|
|
190
190
|
"project_id" uuid NOT NULL,
|
|
@@ -235,7 +235,7 @@ CREATE TABLE "mod_tracker"."issues" (
|
|
|
235
235
|
"search" "tsvector" GENERATED ALWAYS AS (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(description_text, ''))) STORED
|
|
236
236
|
);
|
|
237
237
|
--> statement-breakpoint
|
|
238
|
-
CREATE TABLE "mod_tracker"."labels" (
|
|
238
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."labels" (
|
|
239
239
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
240
240
|
"workspace_id" uuid NOT NULL,
|
|
241
241
|
"project_id" uuid,
|
|
@@ -247,7 +247,7 @@ CREATE TABLE "mod_tracker"."labels" (
|
|
|
247
247
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
248
248
|
);
|
|
249
249
|
--> statement-breakpoint
|
|
250
|
-
CREATE TABLE "mod_tracker"."links" (
|
|
250
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."links" (
|
|
251
251
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
252
252
|
"workspace_id" uuid NOT NULL,
|
|
253
253
|
"issue_id" uuid NOT NULL,
|
|
@@ -258,7 +258,7 @@ CREATE TABLE "mod_tracker"."links" (
|
|
|
258
258
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
259
259
|
);
|
|
260
260
|
--> statement-breakpoint
|
|
261
|
-
CREATE TABLE "mod_tracker"."milestones" (
|
|
261
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."milestones" (
|
|
262
262
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
263
263
|
"workspace_id" uuid NOT NULL,
|
|
264
264
|
"project_id" uuid NOT NULL,
|
|
@@ -271,7 +271,7 @@ CREATE TABLE "mod_tracker"."milestones" (
|
|
|
271
271
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
272
272
|
);
|
|
273
273
|
--> statement-breakpoint
|
|
274
|
-
CREATE TABLE "mod_tracker"."project_members" (
|
|
274
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."project_members" (
|
|
275
275
|
"project_id" uuid NOT NULL,
|
|
276
276
|
"workspace_id" uuid NOT NULL,
|
|
277
277
|
"user_id" uuid NOT NULL,
|
|
@@ -281,7 +281,7 @@ CREATE TABLE "mod_tracker"."project_members" (
|
|
|
281
281
|
CONSTRAINT "project_members_project_id_user_id_pk" PRIMARY KEY("project_id","user_id")
|
|
282
282
|
);
|
|
283
283
|
--> statement-breakpoint
|
|
284
|
-
CREATE TABLE "mod_tracker"."project_templates" (
|
|
284
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."project_templates" (
|
|
285
285
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
286
286
|
"workspace_id" uuid NOT NULL,
|
|
287
287
|
"key" text NOT NULL,
|
|
@@ -293,7 +293,7 @@ CREATE TABLE "mod_tracker"."project_templates" (
|
|
|
293
293
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
294
294
|
);
|
|
295
295
|
--> statement-breakpoint
|
|
296
|
-
CREATE TABLE "mod_tracker"."projects" (
|
|
296
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."projects" (
|
|
297
297
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
298
298
|
"workspace_id" uuid NOT NULL,
|
|
299
299
|
"key" text NOT NULL,
|
|
@@ -316,7 +316,7 @@ CREATE TABLE "mod_tracker"."projects" (
|
|
|
316
316
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
317
317
|
);
|
|
318
318
|
--> statement-breakpoint
|
|
319
|
-
CREATE TABLE "mod_tracker"."recurring_issues" (
|
|
319
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."recurring_issues" (
|
|
320
320
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
321
321
|
"workspace_id" uuid NOT NULL,
|
|
322
322
|
"project_id" uuid NOT NULL,
|
|
@@ -333,7 +333,7 @@ CREATE TABLE "mod_tracker"."recurring_issues" (
|
|
|
333
333
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
334
334
|
);
|
|
335
335
|
--> statement-breakpoint
|
|
336
|
-
CREATE TABLE "mod_tracker"."relations" (
|
|
336
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."relations" (
|
|
337
337
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
338
338
|
"workspace_id" uuid NOT NULL,
|
|
339
339
|
"type" text NOT NULL,
|
|
@@ -343,7 +343,7 @@ CREATE TABLE "mod_tracker"."relations" (
|
|
|
343
343
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
344
344
|
);
|
|
345
345
|
--> statement-breakpoint
|
|
346
|
-
CREATE TABLE "mod_tracker"."timers" (
|
|
346
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."timers" (
|
|
347
347
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
348
348
|
"workspace_id" uuid NOT NULL,
|
|
349
349
|
"issue_id" uuid NOT NULL,
|
|
@@ -352,7 +352,7 @@ CREATE TABLE "mod_tracker"."timers" (
|
|
|
352
352
|
"note" text
|
|
353
353
|
);
|
|
354
354
|
--> statement-breakpoint
|
|
355
|
-
CREATE TABLE "mod_tracker"."type_schemes" (
|
|
355
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."type_schemes" (
|
|
356
356
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
357
357
|
"workspace_id" uuid NOT NULL,
|
|
358
358
|
"name" text NOT NULL,
|
|
@@ -361,7 +361,7 @@ CREATE TABLE "mod_tracker"."type_schemes" (
|
|
|
361
361
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
362
362
|
);
|
|
363
363
|
--> statement-breakpoint
|
|
364
|
-
CREATE TABLE "mod_tracker"."versions" (
|
|
364
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."versions" (
|
|
365
365
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
366
366
|
"workspace_id" uuid NOT NULL,
|
|
367
367
|
"project_id" uuid NOT NULL,
|
|
@@ -376,7 +376,7 @@ CREATE TABLE "mod_tracker"."versions" (
|
|
|
376
376
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
377
377
|
);
|
|
378
378
|
--> statement-breakpoint
|
|
379
|
-
CREATE TABLE "mod_tracker"."view_pins" (
|
|
379
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."view_pins" (
|
|
380
380
|
"view_id" uuid NOT NULL,
|
|
381
381
|
"workspace_id" uuid NOT NULL,
|
|
382
382
|
"user_id" uuid NOT NULL,
|
|
@@ -384,7 +384,7 @@ CREATE TABLE "mod_tracker"."view_pins" (
|
|
|
384
384
|
CONSTRAINT "view_pins_view_id_user_id_pk" PRIMARY KEY("view_id","user_id")
|
|
385
385
|
);
|
|
386
386
|
--> statement-breakpoint
|
|
387
|
-
CREATE TABLE "mod_tracker"."views" (
|
|
387
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."views" (
|
|
388
388
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
389
389
|
"workspace_id" uuid NOT NULL,
|
|
390
390
|
"project_id" uuid,
|
|
@@ -403,7 +403,7 @@ CREATE TABLE "mod_tracker"."views" (
|
|
|
403
403
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
404
404
|
);
|
|
405
405
|
--> statement-breakpoint
|
|
406
|
-
CREATE TABLE "mod_tracker"."work_item_types" (
|
|
406
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."work_item_types" (
|
|
407
407
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
408
408
|
"workspace_id" uuid NOT NULL,
|
|
409
409
|
"project_id" uuid,
|
|
@@ -423,7 +423,7 @@ CREATE TABLE "mod_tracker"."work_item_types" (
|
|
|
423
423
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
424
424
|
);
|
|
425
425
|
--> statement-breakpoint
|
|
426
|
-
CREATE TABLE "mod_tracker"."workflow_schemes" (
|
|
426
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."workflow_schemes" (
|
|
427
427
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
428
428
|
"workspace_id" uuid NOT NULL,
|
|
429
429
|
"name" text NOT NULL,
|
|
@@ -433,7 +433,7 @@ CREATE TABLE "mod_tracker"."workflow_schemes" (
|
|
|
433
433
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
434
434
|
);
|
|
435
435
|
--> statement-breakpoint
|
|
436
|
-
CREATE TABLE "mod_tracker"."workflows" (
|
|
436
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."workflows" (
|
|
437
437
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
438
438
|
"workspace_id" uuid NOT NULL,
|
|
439
439
|
"project_id" uuid,
|
|
@@ -446,7 +446,7 @@ CREATE TABLE "mod_tracker"."workflows" (
|
|
|
446
446
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
447
447
|
);
|
|
448
448
|
--> statement-breakpoint
|
|
449
|
-
CREATE TABLE "mod_tracker"."worklogs" (
|
|
449
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."worklogs" (
|
|
450
450
|
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
451
451
|
"workspace_id" uuid NOT NULL,
|
|
452
452
|
"project_id" uuid NOT NULL,
|
|
@@ -460,70 +460,70 @@ CREATE TABLE "mod_tracker"."worklogs" (
|
|
|
460
460
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
461
461
|
);
|
|
462
462
|
--> statement-breakpoint
|
|
463
|
-
CREATE TABLE "mod_tracker"."workspaces" (
|
|
463
|
+
CREATE TABLE IF NOT EXISTS "mod_tracker"."workspaces" (
|
|
464
464
|
"workspace_id" uuid PRIMARY KEY NOT NULL,
|
|
465
465
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
466
466
|
);
|
|
467
467
|
--> statement-breakpoint
|
|
468
|
-
CREATE UNIQUE INDEX "attachments_issue_file_uq" ON "mod_tracker"."attachments" USING btree ("issue_id","file_id");--> statement-breakpoint
|
|
469
|
-
CREATE INDEX "attachments_issue_idx" ON "mod_tracker"."attachments" USING btree ("issue_id","created_at");--> statement-breakpoint
|
|
470
|
-
CREATE INDEX "comments_issue_idx" ON "mod_tracker"."comments" USING btree ("issue_id","created_at");--> statement-breakpoint
|
|
471
|
-
CREATE INDEX "comments_thread_idx" ON "mod_tracker"."comments" USING btree ("parent_id","created_at") WHERE parent_id is not null;--> statement-breakpoint
|
|
472
|
-
CREATE INDEX "comments_search_idx" ON "mod_tracker"."comments" USING gin ("search");--> statement-breakpoint
|
|
473
|
-
CREATE UNIQUE INDEX "components_project_name_uq" ON "mod_tracker"."components" USING btree ("project_id","name");--> statement-breakpoint
|
|
474
|
-
CREATE UNIQUE INDEX "cycles_project_number_uq" ON "mod_tracker"."cycles" USING btree ("project_id","number");--> statement-breakpoint
|
|
475
|
-
CREATE INDEX "cycles_project_status_idx" ON "mod_tracker"."cycles" USING btree ("project_id","status","start_at");--> statement-breakpoint
|
|
476
|
-
CREATE UNIQUE INDEX "field_defs_ws_project_key_uq" ON "mod_tracker"."field_defs" USING btree ("workspace_id","project_id","key") WHERE project_id is not null;--> statement-breakpoint
|
|
477
|
-
CREATE UNIQUE INDEX "field_defs_ws_key_uq" ON "mod_tracker"."field_defs" USING btree ("workspace_id","key") WHERE project_id is null;--> statement-breakpoint
|
|
478
|
-
CREATE INDEX "field_defs_ws_idx" ON "mod_tracker"."field_defs" USING btree ("workspace_id","project_id","order");--> statement-breakpoint
|
|
479
|
-
CREATE INDEX "field_schemes_ws_idx" ON "mod_tracker"."field_schemes" USING btree ("workspace_id","created_at");--> statement-breakpoint
|
|
480
|
-
CREATE INDEX "import_jobs_project_idx" ON "mod_tracker"."import_jobs" USING btree ("project_id","created_at");--> statement-breakpoint
|
|
481
|
-
CREATE UNIQUE INDEX "issue_approvals_issue_transition_uq" ON "mod_tracker"."issue_approvals" USING btree ("issue_id","transition_id");--> statement-breakpoint
|
|
482
|
-
CREATE INDEX "issue_history_issue_idx" ON "mod_tracker"."issue_history" USING btree ("issue_id","occurred_at");--> statement-breakpoint
|
|
483
|
-
CREATE INDEX "issue_status_history_issue_idx" ON "mod_tracker"."issue_status_history" USING btree ("issue_id","occurred_at");--> statement-breakpoint
|
|
484
|
-
CREATE INDEX "issue_status_history_project_idx" ON "mod_tracker"."issue_status_history" USING btree ("project_id","occurred_at");--> statement-breakpoint
|
|
485
|
-
CREATE INDEX "issue_templates_ws_idx" ON "mod_tracker"."issue_templates" USING btree ("workspace_id","project_id");--> statement-breakpoint
|
|
486
|
-
CREATE UNIQUE INDEX "issues_ws_key_uq" ON "mod_tracker"."issues" USING btree ("workspace_id","key");--> statement-breakpoint
|
|
487
|
-
CREATE UNIQUE INDEX "issues_project_number_uq" ON "mod_tracker"."issues" USING btree ("project_id","number");--> statement-breakpoint
|
|
488
|
-
CREATE INDEX "issues_ws_project_rank_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","project_id","rank");--> statement-breakpoint
|
|
489
|
-
CREATE INDEX "issues_ws_project_status_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","project_id","status_id");--> statement-breakpoint
|
|
490
|
-
CREATE INDEX "issues_ws_updated_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","updated_at");--> statement-breakpoint
|
|
491
|
-
CREATE INDEX "issues_ws_cycle_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","cycle_id") WHERE cycle_id is not null;--> statement-breakpoint
|
|
492
|
-
CREATE INDEX "issues_ws_parent_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","parent_id") WHERE parent_id is not null;--> statement-breakpoint
|
|
493
|
-
CREATE INDEX "issues_ws_due_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","due_date") WHERE due_date is not null;--> statement-breakpoint
|
|
494
|
-
CREATE INDEX "issues_ws_triage_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","project_id") WHERE triage;--> statement-breakpoint
|
|
495
|
-
CREATE INDEX "issues_external_ref_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","external_ref") WHERE external_ref is not null;--> statement-breakpoint
|
|
496
|
-
CREATE INDEX "issues_assignees_idx" ON "mod_tracker"."issues" USING gin ("assignee_ids");--> statement-breakpoint
|
|
497
|
-
CREATE INDEX "issues_labels_idx" ON "mod_tracker"."issues" USING gin ("label_ids");--> statement-breakpoint
|
|
498
|
-
CREATE INDEX "issues_components_idx" ON "mod_tracker"."issues" USING gin ("component_ids");--> statement-breakpoint
|
|
499
|
-
CREATE INDEX "issues_versions_idx" ON "mod_tracker"."issues" USING gin ("version_ids");--> statement-breakpoint
|
|
500
|
-
CREATE INDEX "issues_watchers_idx" ON "mod_tracker"."issues" USING gin ("watcher_ids");--> statement-breakpoint
|
|
501
|
-
CREATE INDEX "issues_custom_idx" ON "mod_tracker"."issues" USING gin ("custom");--> statement-breakpoint
|
|
502
|
-
CREATE INDEX "issues_search_idx" ON "mod_tracker"."issues" USING gin ("search");--> statement-breakpoint
|
|
503
|
-
CREATE UNIQUE INDEX "labels_project_name_uq" ON "mod_tracker"."labels" USING btree ("project_id","name") WHERE project_id is not null;--> statement-breakpoint
|
|
504
|
-
CREATE UNIQUE INDEX "labels_ws_name_uq" ON "mod_tracker"."labels" USING btree ("workspace_id","name") WHERE project_id is null;--> statement-breakpoint
|
|
505
|
-
CREATE INDEX "labels_ws_idx" ON "mod_tracker"."labels" USING btree ("workspace_id","project_id");--> statement-breakpoint
|
|
506
|
-
CREATE INDEX "links_issue_idx" ON "mod_tracker"."links" USING btree ("issue_id","created_at");--> statement-breakpoint
|
|
507
|
-
CREATE INDEX "milestones_project_idx" ON "mod_tracker"."milestones" USING btree ("project_id","target_date");--> statement-breakpoint
|
|
508
|
-
CREATE INDEX "project_members_ws_user_idx" ON "mod_tracker"."project_members" USING btree ("workspace_id","user_id");--> statement-breakpoint
|
|
509
|
-
CREATE UNIQUE INDEX "project_templates_ws_key_uq" ON "mod_tracker"."project_templates" USING btree ("workspace_id","key");--> statement-breakpoint
|
|
510
|
-
CREATE UNIQUE INDEX "projects_ws_key_uq" ON "mod_tracker"."projects" USING btree ("workspace_id","key");--> statement-breakpoint
|
|
511
|
-
CREATE UNIQUE INDEX "projects_intake_token_uq" ON "mod_tracker"."projects" USING btree ("intake_token") WHERE intake_token is not null;--> statement-breakpoint
|
|
512
|
-
CREATE INDEX "projects_ws_idx" ON "mod_tracker"."projects" USING btree ("workspace_id","archived_at");--> statement-breakpoint
|
|
513
|
-
CREATE INDEX "recurring_issues_project_idx" ON "mod_tracker"."recurring_issues" USING btree ("project_id");--> statement-breakpoint
|
|
514
|
-
CREATE INDEX "recurring_issues_due_idx" ON "mod_tracker"."recurring_issues" USING btree ("next_run_at") WHERE enabled;--> statement-breakpoint
|
|
515
|
-
CREATE UNIQUE INDEX "relations_edge_uq" ON "mod_tracker"."relations" USING btree ("from_issue_id","to_issue_id","type");--> statement-breakpoint
|
|
516
|
-
CREATE INDEX "relations_to_idx" ON "mod_tracker"."relations" USING btree ("to_issue_id");--> statement-breakpoint
|
|
517
|
-
CREATE UNIQUE INDEX "timers_ws_user_uq" ON "mod_tracker"."timers" USING btree ("workspace_id","user_id");--> statement-breakpoint
|
|
518
|
-
CREATE INDEX "type_schemes_ws_idx" ON "mod_tracker"."type_schemes" USING btree ("workspace_id","created_at");--> statement-breakpoint
|
|
519
|
-
CREATE INDEX "versions_project_idx" ON "mod_tracker"."versions" USING btree ("project_id","order");--> statement-breakpoint
|
|
520
|
-
CREATE INDEX "view_pins_ws_user_idx" ON "mod_tracker"."view_pins" USING btree ("workspace_id","user_id");--> statement-breakpoint
|
|
521
|
-
CREATE INDEX "views_ws_idx" ON "mod_tracker"."views" USING btree ("workspace_id","project_id","order");--> statement-breakpoint
|
|
522
|
-
CREATE UNIQUE INDEX "work_item_types_ws_project_key_uq" ON "mod_tracker"."work_item_types" USING btree ("workspace_id","project_id","key") WHERE project_id is not null;--> statement-breakpoint
|
|
523
|
-
CREATE UNIQUE INDEX "work_item_types_ws_key_uq" ON "mod_tracker"."work_item_types" USING btree ("workspace_id","key") WHERE project_id is null;--> statement-breakpoint
|
|
524
|
-
CREATE INDEX "work_item_types_ws_idx" ON "mod_tracker"."work_item_types" USING btree ("workspace_id","project_id","order");--> statement-breakpoint
|
|
525
|
-
CREATE INDEX "workflow_schemes_ws_idx" ON "mod_tracker"."workflow_schemes" USING btree ("workspace_id","created_at");--> statement-breakpoint
|
|
526
|
-
CREATE INDEX "workflows_ws_idx" ON "mod_tracker"."workflows" USING btree ("workspace_id","project_id","archived_at");--> statement-breakpoint
|
|
527
|
-
CREATE INDEX "worklogs_issue_idx" ON "mod_tracker"."worklogs" USING btree ("issue_id","started_at");--> statement-breakpoint
|
|
528
|
-
CREATE INDEX "worklogs_ws_user_started_idx" ON "mod_tracker"."worklogs" USING btree ("workspace_id","user_id","started_at");--> statement-breakpoint
|
|
529
|
-
CREATE INDEX "worklogs_project_started_idx" ON "mod_tracker"."worklogs" USING btree ("project_id","started_at");
|
|
468
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "attachments_issue_file_uq" ON "mod_tracker"."attachments" USING btree ("issue_id","file_id");--> statement-breakpoint
|
|
469
|
+
CREATE INDEX IF NOT EXISTS "attachments_issue_idx" ON "mod_tracker"."attachments" USING btree ("issue_id","created_at");--> statement-breakpoint
|
|
470
|
+
CREATE INDEX IF NOT EXISTS "comments_issue_idx" ON "mod_tracker"."comments" USING btree ("issue_id","created_at");--> statement-breakpoint
|
|
471
|
+
CREATE INDEX IF NOT EXISTS "comments_thread_idx" ON "mod_tracker"."comments" USING btree ("parent_id","created_at") WHERE parent_id is not null;--> statement-breakpoint
|
|
472
|
+
CREATE INDEX IF NOT EXISTS "comments_search_idx" ON "mod_tracker"."comments" USING gin ("search");--> statement-breakpoint
|
|
473
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "components_project_name_uq" ON "mod_tracker"."components" USING btree ("project_id","name");--> statement-breakpoint
|
|
474
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "cycles_project_number_uq" ON "mod_tracker"."cycles" USING btree ("project_id","number");--> statement-breakpoint
|
|
475
|
+
CREATE INDEX IF NOT EXISTS "cycles_project_status_idx" ON "mod_tracker"."cycles" USING btree ("project_id","status","start_at");--> statement-breakpoint
|
|
476
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "field_defs_ws_project_key_uq" ON "mod_tracker"."field_defs" USING btree ("workspace_id","project_id","key") WHERE project_id is not null;--> statement-breakpoint
|
|
477
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "field_defs_ws_key_uq" ON "mod_tracker"."field_defs" USING btree ("workspace_id","key") WHERE project_id is null;--> statement-breakpoint
|
|
478
|
+
CREATE INDEX IF NOT EXISTS "field_defs_ws_idx" ON "mod_tracker"."field_defs" USING btree ("workspace_id","project_id","order");--> statement-breakpoint
|
|
479
|
+
CREATE INDEX IF NOT EXISTS "field_schemes_ws_idx" ON "mod_tracker"."field_schemes" USING btree ("workspace_id","created_at");--> statement-breakpoint
|
|
480
|
+
CREATE INDEX IF NOT EXISTS "import_jobs_project_idx" ON "mod_tracker"."import_jobs" USING btree ("project_id","created_at");--> statement-breakpoint
|
|
481
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "issue_approvals_issue_transition_uq" ON "mod_tracker"."issue_approvals" USING btree ("issue_id","transition_id");--> statement-breakpoint
|
|
482
|
+
CREATE INDEX IF NOT EXISTS "issue_history_issue_idx" ON "mod_tracker"."issue_history" USING btree ("issue_id","occurred_at");--> statement-breakpoint
|
|
483
|
+
CREATE INDEX IF NOT EXISTS "issue_status_history_issue_idx" ON "mod_tracker"."issue_status_history" USING btree ("issue_id","occurred_at");--> statement-breakpoint
|
|
484
|
+
CREATE INDEX IF NOT EXISTS "issue_status_history_project_idx" ON "mod_tracker"."issue_status_history" USING btree ("project_id","occurred_at");--> statement-breakpoint
|
|
485
|
+
CREATE INDEX IF NOT EXISTS "issue_templates_ws_idx" ON "mod_tracker"."issue_templates" USING btree ("workspace_id","project_id");--> statement-breakpoint
|
|
486
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "issues_ws_key_uq" ON "mod_tracker"."issues" USING btree ("workspace_id","key");--> statement-breakpoint
|
|
487
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "issues_project_number_uq" ON "mod_tracker"."issues" USING btree ("project_id","number");--> statement-breakpoint
|
|
488
|
+
CREATE INDEX IF NOT EXISTS "issues_ws_project_rank_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","project_id","rank");--> statement-breakpoint
|
|
489
|
+
CREATE INDEX IF NOT EXISTS "issues_ws_project_status_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","project_id","status_id");--> statement-breakpoint
|
|
490
|
+
CREATE INDEX IF NOT EXISTS "issues_ws_updated_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","updated_at");--> statement-breakpoint
|
|
491
|
+
CREATE INDEX IF NOT EXISTS "issues_ws_cycle_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","cycle_id") WHERE cycle_id is not null;--> statement-breakpoint
|
|
492
|
+
CREATE INDEX IF NOT EXISTS "issues_ws_parent_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","parent_id") WHERE parent_id is not null;--> statement-breakpoint
|
|
493
|
+
CREATE INDEX IF NOT EXISTS "issues_ws_due_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","due_date") WHERE due_date is not null;--> statement-breakpoint
|
|
494
|
+
CREATE INDEX IF NOT EXISTS "issues_ws_triage_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","project_id") WHERE triage;--> statement-breakpoint
|
|
495
|
+
CREATE INDEX IF NOT EXISTS "issues_external_ref_idx" ON "mod_tracker"."issues" USING btree ("workspace_id","external_ref") WHERE external_ref is not null;--> statement-breakpoint
|
|
496
|
+
CREATE INDEX IF NOT EXISTS "issues_assignees_idx" ON "mod_tracker"."issues" USING gin ("assignee_ids");--> statement-breakpoint
|
|
497
|
+
CREATE INDEX IF NOT EXISTS "issues_labels_idx" ON "mod_tracker"."issues" USING gin ("label_ids");--> statement-breakpoint
|
|
498
|
+
CREATE INDEX IF NOT EXISTS "issues_components_idx" ON "mod_tracker"."issues" USING gin ("component_ids");--> statement-breakpoint
|
|
499
|
+
CREATE INDEX IF NOT EXISTS "issues_versions_idx" ON "mod_tracker"."issues" USING gin ("version_ids");--> statement-breakpoint
|
|
500
|
+
CREATE INDEX IF NOT EXISTS "issues_watchers_idx" ON "mod_tracker"."issues" USING gin ("watcher_ids");--> statement-breakpoint
|
|
501
|
+
CREATE INDEX IF NOT EXISTS "issues_custom_idx" ON "mod_tracker"."issues" USING gin ("custom");--> statement-breakpoint
|
|
502
|
+
CREATE INDEX IF NOT EXISTS "issues_search_idx" ON "mod_tracker"."issues" USING gin ("search");--> statement-breakpoint
|
|
503
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "labels_project_name_uq" ON "mod_tracker"."labels" USING btree ("project_id","name") WHERE project_id is not null;--> statement-breakpoint
|
|
504
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "labels_ws_name_uq" ON "mod_tracker"."labels" USING btree ("workspace_id","name") WHERE project_id is null;--> statement-breakpoint
|
|
505
|
+
CREATE INDEX IF NOT EXISTS "labels_ws_idx" ON "mod_tracker"."labels" USING btree ("workspace_id","project_id");--> statement-breakpoint
|
|
506
|
+
CREATE INDEX IF NOT EXISTS "links_issue_idx" ON "mod_tracker"."links" USING btree ("issue_id","created_at");--> statement-breakpoint
|
|
507
|
+
CREATE INDEX IF NOT EXISTS "milestones_project_idx" ON "mod_tracker"."milestones" USING btree ("project_id","target_date");--> statement-breakpoint
|
|
508
|
+
CREATE INDEX IF NOT EXISTS "project_members_ws_user_idx" ON "mod_tracker"."project_members" USING btree ("workspace_id","user_id");--> statement-breakpoint
|
|
509
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "project_templates_ws_key_uq" ON "mod_tracker"."project_templates" USING btree ("workspace_id","key");--> statement-breakpoint
|
|
510
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "projects_ws_key_uq" ON "mod_tracker"."projects" USING btree ("workspace_id","key");--> statement-breakpoint
|
|
511
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "projects_intake_token_uq" ON "mod_tracker"."projects" USING btree ("intake_token") WHERE intake_token is not null;--> statement-breakpoint
|
|
512
|
+
CREATE INDEX IF NOT EXISTS "projects_ws_idx" ON "mod_tracker"."projects" USING btree ("workspace_id","archived_at");--> statement-breakpoint
|
|
513
|
+
CREATE INDEX IF NOT EXISTS "recurring_issues_project_idx" ON "mod_tracker"."recurring_issues" USING btree ("project_id");--> statement-breakpoint
|
|
514
|
+
CREATE INDEX IF NOT EXISTS "recurring_issues_due_idx" ON "mod_tracker"."recurring_issues" USING btree ("next_run_at") WHERE enabled;--> statement-breakpoint
|
|
515
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "relations_edge_uq" ON "mod_tracker"."relations" USING btree ("from_issue_id","to_issue_id","type");--> statement-breakpoint
|
|
516
|
+
CREATE INDEX IF NOT EXISTS "relations_to_idx" ON "mod_tracker"."relations" USING btree ("to_issue_id");--> statement-breakpoint
|
|
517
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "timers_ws_user_uq" ON "mod_tracker"."timers" USING btree ("workspace_id","user_id");--> statement-breakpoint
|
|
518
|
+
CREATE INDEX IF NOT EXISTS "type_schemes_ws_idx" ON "mod_tracker"."type_schemes" USING btree ("workspace_id","created_at");--> statement-breakpoint
|
|
519
|
+
CREATE INDEX IF NOT EXISTS "versions_project_idx" ON "mod_tracker"."versions" USING btree ("project_id","order");--> statement-breakpoint
|
|
520
|
+
CREATE INDEX IF NOT EXISTS "view_pins_ws_user_idx" ON "mod_tracker"."view_pins" USING btree ("workspace_id","user_id");--> statement-breakpoint
|
|
521
|
+
CREATE INDEX IF NOT EXISTS "views_ws_idx" ON "mod_tracker"."views" USING btree ("workspace_id","project_id","order");--> statement-breakpoint
|
|
522
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "work_item_types_ws_project_key_uq" ON "mod_tracker"."work_item_types" USING btree ("workspace_id","project_id","key") WHERE project_id is not null;--> statement-breakpoint
|
|
523
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "work_item_types_ws_key_uq" ON "mod_tracker"."work_item_types" USING btree ("workspace_id","key") WHERE project_id is null;--> statement-breakpoint
|
|
524
|
+
CREATE INDEX IF NOT EXISTS "work_item_types_ws_idx" ON "mod_tracker"."work_item_types" USING btree ("workspace_id","project_id","order");--> statement-breakpoint
|
|
525
|
+
CREATE INDEX IF NOT EXISTS "workflow_schemes_ws_idx" ON "mod_tracker"."workflow_schemes" USING btree ("workspace_id","created_at");--> statement-breakpoint
|
|
526
|
+
CREATE INDEX IF NOT EXISTS "workflows_ws_idx" ON "mod_tracker"."workflows" USING btree ("workspace_id","project_id","archived_at");--> statement-breakpoint
|
|
527
|
+
CREATE INDEX IF NOT EXISTS "worklogs_issue_idx" ON "mod_tracker"."worklogs" USING btree ("issue_id","started_at");--> statement-breakpoint
|
|
528
|
+
CREATE INDEX IF NOT EXISTS "worklogs_ws_user_started_idx" ON "mod_tracker"."worklogs" USING btree ("workspace_id","user_id","started_at");--> statement-breakpoint
|
|
529
|
+
CREATE INDEX IF NOT EXISTS "worklogs_project_started_idx" ON "mod_tracker"."worklogs" USING btree ("project_id","started_at");
|
package/migrations/0001_rls.sql
CHANGED
|
@@ -6,6 +6,8 @@ alter table "mod_tracker"."projects" enable row level security;
|
|
|
6
6
|
--> statement-breakpoint
|
|
7
7
|
alter table "mod_tracker"."projects" force row level security;
|
|
8
8
|
--> statement-breakpoint
|
|
9
|
+
drop policy if exists "projects_ws_isolation" on "mod_tracker"."projects";
|
|
10
|
+
--> statement-breakpoint
|
|
9
11
|
create policy "projects_ws_isolation" on "mod_tracker"."projects"
|
|
10
12
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
11
13
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -14,6 +16,8 @@ alter table "mod_tracker"."issue_counters" enable row level security;
|
|
|
14
16
|
--> statement-breakpoint
|
|
15
17
|
alter table "mod_tracker"."issue_counters" force row level security;
|
|
16
18
|
--> statement-breakpoint
|
|
19
|
+
drop policy if exists "issue_counters_ws_isolation" on "mod_tracker"."issue_counters";
|
|
20
|
+
--> statement-breakpoint
|
|
17
21
|
create policy "issue_counters_ws_isolation" on "mod_tracker"."issue_counters"
|
|
18
22
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
19
23
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -22,6 +26,8 @@ alter table "mod_tracker"."project_members" enable row level security;
|
|
|
22
26
|
--> statement-breakpoint
|
|
23
27
|
alter table "mod_tracker"."project_members" force row level security;
|
|
24
28
|
--> statement-breakpoint
|
|
29
|
+
drop policy if exists "project_members_ws_isolation" on "mod_tracker"."project_members";
|
|
30
|
+
--> statement-breakpoint
|
|
25
31
|
create policy "project_members_ws_isolation" on "mod_tracker"."project_members"
|
|
26
32
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
27
33
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -30,6 +36,8 @@ alter table "mod_tracker"."project_templates" enable row level security;
|
|
|
30
36
|
--> statement-breakpoint
|
|
31
37
|
alter table "mod_tracker"."project_templates" force row level security;
|
|
32
38
|
--> statement-breakpoint
|
|
39
|
+
drop policy if exists "project_templates_ws_isolation" on "mod_tracker"."project_templates";
|
|
40
|
+
--> statement-breakpoint
|
|
33
41
|
create policy "project_templates_ws_isolation" on "mod_tracker"."project_templates"
|
|
34
42
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
35
43
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -38,6 +46,8 @@ alter table "mod_tracker"."work_item_types" enable row level security;
|
|
|
38
46
|
--> statement-breakpoint
|
|
39
47
|
alter table "mod_tracker"."work_item_types" force row level security;
|
|
40
48
|
--> statement-breakpoint
|
|
49
|
+
drop policy if exists "work_item_types_ws_isolation" on "mod_tracker"."work_item_types";
|
|
50
|
+
--> statement-breakpoint
|
|
41
51
|
create policy "work_item_types_ws_isolation" on "mod_tracker"."work_item_types"
|
|
42
52
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
43
53
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -46,6 +56,8 @@ alter table "mod_tracker"."type_schemes" enable row level security;
|
|
|
46
56
|
--> statement-breakpoint
|
|
47
57
|
alter table "mod_tracker"."type_schemes" force row level security;
|
|
48
58
|
--> statement-breakpoint
|
|
59
|
+
drop policy if exists "type_schemes_ws_isolation" on "mod_tracker"."type_schemes";
|
|
60
|
+
--> statement-breakpoint
|
|
49
61
|
create policy "type_schemes_ws_isolation" on "mod_tracker"."type_schemes"
|
|
50
62
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
51
63
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -54,6 +66,8 @@ alter table "mod_tracker"."hierarchy_rules" enable row level security;
|
|
|
54
66
|
--> statement-breakpoint
|
|
55
67
|
alter table "mod_tracker"."hierarchy_rules" force row level security;
|
|
56
68
|
--> statement-breakpoint
|
|
69
|
+
drop policy if exists "hierarchy_rules_ws_isolation" on "mod_tracker"."hierarchy_rules";
|
|
70
|
+
--> statement-breakpoint
|
|
57
71
|
create policy "hierarchy_rules_ws_isolation" on "mod_tracker"."hierarchy_rules"
|
|
58
72
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
59
73
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -62,6 +76,8 @@ alter table "mod_tracker"."field_defs" enable row level security;
|
|
|
62
76
|
--> statement-breakpoint
|
|
63
77
|
alter table "mod_tracker"."field_defs" force row level security;
|
|
64
78
|
--> statement-breakpoint
|
|
79
|
+
drop policy if exists "field_defs_ws_isolation" on "mod_tracker"."field_defs";
|
|
80
|
+
--> statement-breakpoint
|
|
65
81
|
create policy "field_defs_ws_isolation" on "mod_tracker"."field_defs"
|
|
66
82
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
67
83
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -70,6 +86,8 @@ alter table "mod_tracker"."field_schemes" enable row level security;
|
|
|
70
86
|
--> statement-breakpoint
|
|
71
87
|
alter table "mod_tracker"."field_schemes" force row level security;
|
|
72
88
|
--> statement-breakpoint
|
|
89
|
+
drop policy if exists "field_schemes_ws_isolation" on "mod_tracker"."field_schemes";
|
|
90
|
+
--> statement-breakpoint
|
|
73
91
|
create policy "field_schemes_ws_isolation" on "mod_tracker"."field_schemes"
|
|
74
92
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
75
93
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -78,6 +96,8 @@ alter table "mod_tracker"."workflows" enable row level security;
|
|
|
78
96
|
--> statement-breakpoint
|
|
79
97
|
alter table "mod_tracker"."workflows" force row level security;
|
|
80
98
|
--> statement-breakpoint
|
|
99
|
+
drop policy if exists "workflows_ws_isolation" on "mod_tracker"."workflows";
|
|
100
|
+
--> statement-breakpoint
|
|
81
101
|
create policy "workflows_ws_isolation" on "mod_tracker"."workflows"
|
|
82
102
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
83
103
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -86,6 +106,8 @@ alter table "mod_tracker"."workflow_schemes" enable row level security;
|
|
|
86
106
|
--> statement-breakpoint
|
|
87
107
|
alter table "mod_tracker"."workflow_schemes" force row level security;
|
|
88
108
|
--> statement-breakpoint
|
|
109
|
+
drop policy if exists "workflow_schemes_ws_isolation" on "mod_tracker"."workflow_schemes";
|
|
110
|
+
--> statement-breakpoint
|
|
89
111
|
create policy "workflow_schemes_ws_isolation" on "mod_tracker"."workflow_schemes"
|
|
90
112
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
91
113
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -94,6 +116,8 @@ alter table "mod_tracker"."issues" enable row level security;
|
|
|
94
116
|
--> statement-breakpoint
|
|
95
117
|
alter table "mod_tracker"."issues" force row level security;
|
|
96
118
|
--> statement-breakpoint
|
|
119
|
+
drop policy if exists "issues_ws_isolation" on "mod_tracker"."issues";
|
|
120
|
+
--> statement-breakpoint
|
|
97
121
|
create policy "issues_ws_isolation" on "mod_tracker"."issues"
|
|
98
122
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
99
123
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -102,6 +126,8 @@ alter table "mod_tracker"."comments" enable row level security;
|
|
|
102
126
|
--> statement-breakpoint
|
|
103
127
|
alter table "mod_tracker"."comments" force row level security;
|
|
104
128
|
--> statement-breakpoint
|
|
129
|
+
drop policy if exists "comments_ws_isolation" on "mod_tracker"."comments";
|
|
130
|
+
--> statement-breakpoint
|
|
105
131
|
create policy "comments_ws_isolation" on "mod_tracker"."comments"
|
|
106
132
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
107
133
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -110,6 +136,8 @@ alter table "mod_tracker"."comment_reactions" enable row level security;
|
|
|
110
136
|
--> statement-breakpoint
|
|
111
137
|
alter table "mod_tracker"."comment_reactions" force row level security;
|
|
112
138
|
--> statement-breakpoint
|
|
139
|
+
drop policy if exists "comment_reactions_ws_isolation" on "mod_tracker"."comment_reactions";
|
|
140
|
+
--> statement-breakpoint
|
|
113
141
|
create policy "comment_reactions_ws_isolation" on "mod_tracker"."comment_reactions"
|
|
114
142
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
115
143
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -118,6 +146,8 @@ alter table "mod_tracker"."relations" enable row level security;
|
|
|
118
146
|
--> statement-breakpoint
|
|
119
147
|
alter table "mod_tracker"."relations" force row level security;
|
|
120
148
|
--> statement-breakpoint
|
|
149
|
+
drop policy if exists "relations_ws_isolation" on "mod_tracker"."relations";
|
|
150
|
+
--> statement-breakpoint
|
|
121
151
|
create policy "relations_ws_isolation" on "mod_tracker"."relations"
|
|
122
152
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
123
153
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -126,6 +156,8 @@ alter table "mod_tracker"."attachments" enable row level security;
|
|
|
126
156
|
--> statement-breakpoint
|
|
127
157
|
alter table "mod_tracker"."attachments" force row level security;
|
|
128
158
|
--> statement-breakpoint
|
|
159
|
+
drop policy if exists "attachments_ws_isolation" on "mod_tracker"."attachments";
|
|
160
|
+
--> statement-breakpoint
|
|
129
161
|
create policy "attachments_ws_isolation" on "mod_tracker"."attachments"
|
|
130
162
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
131
163
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -134,6 +166,8 @@ alter table "mod_tracker"."links" enable row level security;
|
|
|
134
166
|
--> statement-breakpoint
|
|
135
167
|
alter table "mod_tracker"."links" force row level security;
|
|
136
168
|
--> statement-breakpoint
|
|
169
|
+
drop policy if exists "links_ws_isolation" on "mod_tracker"."links";
|
|
170
|
+
--> statement-breakpoint
|
|
137
171
|
create policy "links_ws_isolation" on "mod_tracker"."links"
|
|
138
172
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
139
173
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -142,6 +176,8 @@ alter table "mod_tracker"."issue_history" enable row level security;
|
|
|
142
176
|
--> statement-breakpoint
|
|
143
177
|
alter table "mod_tracker"."issue_history" force row level security;
|
|
144
178
|
--> statement-breakpoint
|
|
179
|
+
drop policy if exists "issue_history_ws_isolation" on "mod_tracker"."issue_history";
|
|
180
|
+
--> statement-breakpoint
|
|
145
181
|
create policy "issue_history_ws_isolation" on "mod_tracker"."issue_history"
|
|
146
182
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
147
183
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -150,6 +186,8 @@ alter table "mod_tracker"."issue_status_history" enable row level security;
|
|
|
150
186
|
--> statement-breakpoint
|
|
151
187
|
alter table "mod_tracker"."issue_status_history" force row level security;
|
|
152
188
|
--> statement-breakpoint
|
|
189
|
+
drop policy if exists "issue_status_history_ws_isolation" on "mod_tracker"."issue_status_history";
|
|
190
|
+
--> statement-breakpoint
|
|
153
191
|
create policy "issue_status_history_ws_isolation" on "mod_tracker"."issue_status_history"
|
|
154
192
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
155
193
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -158,6 +196,8 @@ alter table "mod_tracker"."issue_approvals" enable row level security;
|
|
|
158
196
|
--> statement-breakpoint
|
|
159
197
|
alter table "mod_tracker"."issue_approvals" force row level security;
|
|
160
198
|
--> statement-breakpoint
|
|
199
|
+
drop policy if exists "issue_approvals_ws_isolation" on "mod_tracker"."issue_approvals";
|
|
200
|
+
--> statement-breakpoint
|
|
161
201
|
create policy "issue_approvals_ws_isolation" on "mod_tracker"."issue_approvals"
|
|
162
202
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
163
203
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -166,6 +206,8 @@ alter table "mod_tracker"."issue_templates" enable row level security;
|
|
|
166
206
|
--> statement-breakpoint
|
|
167
207
|
alter table "mod_tracker"."issue_templates" force row level security;
|
|
168
208
|
--> statement-breakpoint
|
|
209
|
+
drop policy if exists "issue_templates_ws_isolation" on "mod_tracker"."issue_templates";
|
|
210
|
+
--> statement-breakpoint
|
|
169
211
|
create policy "issue_templates_ws_isolation" on "mod_tracker"."issue_templates"
|
|
170
212
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
171
213
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -174,6 +216,8 @@ alter table "mod_tracker"."recurring_issues" enable row level security;
|
|
|
174
216
|
--> statement-breakpoint
|
|
175
217
|
alter table "mod_tracker"."recurring_issues" force row level security;
|
|
176
218
|
--> statement-breakpoint
|
|
219
|
+
drop policy if exists "recurring_issues_ws_isolation" on "mod_tracker"."recurring_issues";
|
|
220
|
+
--> statement-breakpoint
|
|
177
221
|
create policy "recurring_issues_ws_isolation" on "mod_tracker"."recurring_issues"
|
|
178
222
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
179
223
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -182,6 +226,8 @@ alter table "mod_tracker"."cycles" enable row level security;
|
|
|
182
226
|
--> statement-breakpoint
|
|
183
227
|
alter table "mod_tracker"."cycles" force row level security;
|
|
184
228
|
--> statement-breakpoint
|
|
229
|
+
drop policy if exists "cycles_ws_isolation" on "mod_tracker"."cycles";
|
|
230
|
+
--> statement-breakpoint
|
|
185
231
|
create policy "cycles_ws_isolation" on "mod_tracker"."cycles"
|
|
186
232
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
187
233
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -190,6 +236,8 @@ alter table "mod_tracker"."milestones" enable row level security;
|
|
|
190
236
|
--> statement-breakpoint
|
|
191
237
|
alter table "mod_tracker"."milestones" force row level security;
|
|
192
238
|
--> statement-breakpoint
|
|
239
|
+
drop policy if exists "milestones_ws_isolation" on "mod_tracker"."milestones";
|
|
240
|
+
--> statement-breakpoint
|
|
193
241
|
create policy "milestones_ws_isolation" on "mod_tracker"."milestones"
|
|
194
242
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
195
243
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -198,6 +246,8 @@ alter table "mod_tracker"."versions" enable row level security;
|
|
|
198
246
|
--> statement-breakpoint
|
|
199
247
|
alter table "mod_tracker"."versions" force row level security;
|
|
200
248
|
--> statement-breakpoint
|
|
249
|
+
drop policy if exists "versions_ws_isolation" on "mod_tracker"."versions";
|
|
250
|
+
--> statement-breakpoint
|
|
201
251
|
create policy "versions_ws_isolation" on "mod_tracker"."versions"
|
|
202
252
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
203
253
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -206,6 +256,8 @@ alter table "mod_tracker"."components" enable row level security;
|
|
|
206
256
|
--> statement-breakpoint
|
|
207
257
|
alter table "mod_tracker"."components" force row level security;
|
|
208
258
|
--> statement-breakpoint
|
|
259
|
+
drop policy if exists "components_ws_isolation" on "mod_tracker"."components";
|
|
260
|
+
--> statement-breakpoint
|
|
209
261
|
create policy "components_ws_isolation" on "mod_tracker"."components"
|
|
210
262
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
211
263
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -214,6 +266,8 @@ alter table "mod_tracker"."labels" enable row level security;
|
|
|
214
266
|
--> statement-breakpoint
|
|
215
267
|
alter table "mod_tracker"."labels" force row level security;
|
|
216
268
|
--> statement-breakpoint
|
|
269
|
+
drop policy if exists "labels_ws_isolation" on "mod_tracker"."labels";
|
|
270
|
+
--> statement-breakpoint
|
|
217
271
|
create policy "labels_ws_isolation" on "mod_tracker"."labels"
|
|
218
272
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
219
273
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -222,6 +276,8 @@ alter table "mod_tracker"."views" enable row level security;
|
|
|
222
276
|
--> statement-breakpoint
|
|
223
277
|
alter table "mod_tracker"."views" force row level security;
|
|
224
278
|
--> statement-breakpoint
|
|
279
|
+
drop policy if exists "views_ws_isolation" on "mod_tracker"."views";
|
|
280
|
+
--> statement-breakpoint
|
|
225
281
|
create policy "views_ws_isolation" on "mod_tracker"."views"
|
|
226
282
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
227
283
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -230,6 +286,8 @@ alter table "mod_tracker"."view_pins" enable row level security;
|
|
|
230
286
|
--> statement-breakpoint
|
|
231
287
|
alter table "mod_tracker"."view_pins" force row level security;
|
|
232
288
|
--> statement-breakpoint
|
|
289
|
+
drop policy if exists "view_pins_ws_isolation" on "mod_tracker"."view_pins";
|
|
290
|
+
--> statement-breakpoint
|
|
233
291
|
create policy "view_pins_ws_isolation" on "mod_tracker"."view_pins"
|
|
234
292
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
235
293
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -238,6 +296,8 @@ alter table "mod_tracker"."worklogs" enable row level security;
|
|
|
238
296
|
--> statement-breakpoint
|
|
239
297
|
alter table "mod_tracker"."worklogs" force row level security;
|
|
240
298
|
--> statement-breakpoint
|
|
299
|
+
drop policy if exists "worklogs_ws_isolation" on "mod_tracker"."worklogs";
|
|
300
|
+
--> statement-breakpoint
|
|
241
301
|
create policy "worklogs_ws_isolation" on "mod_tracker"."worklogs"
|
|
242
302
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
243
303
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -246,6 +306,8 @@ alter table "mod_tracker"."timers" enable row level security;
|
|
|
246
306
|
--> statement-breakpoint
|
|
247
307
|
alter table "mod_tracker"."timers" force row level security;
|
|
248
308
|
--> statement-breakpoint
|
|
309
|
+
drop policy if exists "timers_ws_isolation" on "mod_tracker"."timers";
|
|
310
|
+
--> statement-breakpoint
|
|
249
311
|
create policy "timers_ws_isolation" on "mod_tracker"."timers"
|
|
250
312
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
251
313
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -254,6 +316,8 @@ alter table "mod_tracker"."import_jobs" enable row level security;
|
|
|
254
316
|
--> statement-breakpoint
|
|
255
317
|
alter table "mod_tracker"."import_jobs" force row level security;
|
|
256
318
|
--> statement-breakpoint
|
|
319
|
+
drop policy if exists "import_jobs_ws_isolation" on "mod_tracker"."import_jobs";
|
|
320
|
+
--> statement-breakpoint
|
|
257
321
|
create policy "import_jobs_ws_isolation" on "mod_tracker"."import_jobs"
|
|
258
322
|
using (workspace_id::text = current_setting('app.workspace_id', true))
|
|
259
323
|
with check (workspace_id::text = current_setting('app.workspace_id', true));
|
|
@@ -32,4 +32,4 @@ end $$;
|
|
|
32
32
|
--> statement-breakpoint
|
|
33
33
|
DROP INDEX IF EXISTS "mod_tracker"."field_defs_ws_project_key_uq";--> statement-breakpoint
|
|
34
34
|
DROP INDEX IF EXISTS "mod_tracker"."field_defs_ws_key_uq";--> statement-breakpoint
|
|
35
|
-
CREATE UNIQUE INDEX "field_defs_ws_key_uq" ON "mod_tracker"."field_defs" USING btree ("workspace_id","key");
|
|
35
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "field_defs_ws_key_uq" ON "mod_tracker"."field_defs" USING btree ("workspace_id","key");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kernhq/module-tracker",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"description": "Kern tracker module: projects, work item types, custom fields, workflows, issues, KQL, cycles, views, reports, intake, time tracking (server + client skeleton)",
|
|
5
5
|
"homepage": "https://github.com/KernAIO/module-tracker#readme",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@biomejs/biome": "^2.0.0",
|
|
61
61
|
"@changesets/cli": "^2.27.0",
|
|
62
|
-
"@kernhq/contracts": "^0.
|
|
62
|
+
"@kernhq/contracts": "^0.7.0",
|
|
63
63
|
"@kernhq/kernel": "^0.7.0",
|
|
64
64
|
"@kernhq/tsconfig": "^0.1.0",
|
|
65
65
|
"@kernhq/ui": "^0.10.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"vitest": "^4.0.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@kernhq/contracts": "^0.
|
|
77
|
+
"@kernhq/contracts": "^0.7.0",
|
|
78
78
|
"@kernhq/kernel": "^0.7.0",
|
|
79
79
|
"@kernhq/ui": "^0.10.0",
|
|
80
80
|
"@tanstack/svelte-query": "^6.1.0",
|