attraverso 0.0.1 → 0.1.0
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/README.txt +9 -0
- package/assets/migrations/0000_burly_firestar.sql +76 -0
- package/assets/migrations/0001_sleepy_gorilla_man.sql +27 -0
- package/assets/migrations/0002_smart_ikaris.sql +14 -0
- package/assets/migrations/0003_pink_zodiak.sql +17 -0
- package/assets/migrations/0004_loose_hitman.sql +14 -0
- package/assets/migrations/0005_glamorous_typhoid_mary.sql +5 -0
- package/assets/migrations/0006_slow_deadpool.sql +1 -0
- package/assets/migrations/0007_jittery_tag.sql +8 -0
- package/assets/migrations/0008_daily_firestar.sql +1 -0
- package/assets/migrations/0009_cute_marvex.sql +13 -0
- package/assets/migrations/0010_acoustic_pixie.sql +10 -0
- package/assets/migrations/0011_orange_rawhide_kid.sql +1 -0
- package/assets/migrations/0012_smiling_butterfly.sql +23 -0
- package/assets/migrations/0013_kind_bloodscream.sql +9 -0
- package/assets/migrations/meta/0000_snapshot.json +629 -0
- package/assets/migrations/meta/0001_snapshot.json +852 -0
- package/assets/migrations/meta/0002_snapshot.json +972 -0
- package/assets/migrations/meta/0003_snapshot.json +1130 -0
- package/assets/migrations/meta/0004_snapshot.json +1244 -0
- package/assets/migrations/meta/0005_snapshot.json +1275 -0
- package/assets/migrations/meta/0006_snapshot.json +1276 -0
- package/assets/migrations/meta/0007_snapshot.json +1376 -0
- package/assets/migrations/meta/0008_snapshot.json +1241 -0
- package/assets/migrations/meta/0009_snapshot.json +1241 -0
- package/assets/migrations/meta/0010_snapshot.json +1329 -0
- package/assets/migrations/meta/0011_snapshot.json +1322 -0
- package/assets/migrations/meta/0012_snapshot.json +1516 -0
- package/assets/migrations/meta/0013_snapshot.json +1576 -0
- package/assets/migrations/meta/_journal.json +104 -0
- package/assets/nodefs-BbnD6x79.js +33 -0
- package/assets/opfs-ahp-CFnUNF4E.js +308 -0
- package/assets/postgres-X5RxLyOz.js +5438 -0
- package/initdb.wasm +0 -0
- package/migrations/0000_burly_firestar.sql +76 -0
- package/migrations/0001_sleepy_gorilla_man.sql +27 -0
- package/migrations/0002_smart_ikaris.sql +14 -0
- package/migrations/0003_pink_zodiak.sql +17 -0
- package/migrations/0004_loose_hitman.sql +14 -0
- package/migrations/0005_glamorous_typhoid_mary.sql +5 -0
- package/migrations/0006_slow_deadpool.sql +1 -0
- package/migrations/0007_jittery_tag.sql +8 -0
- package/migrations/0008_daily_firestar.sql +1 -0
- package/migrations/0009_cute_marvex.sql +13 -0
- package/migrations/0010_acoustic_pixie.sql +10 -0
- package/migrations/0011_orange_rawhide_kid.sql +1 -0
- package/migrations/0012_smiling_butterfly.sql +23 -0
- package/migrations/0013_kind_bloodscream.sql +9 -0
- package/migrations/meta/0000_snapshot.json +629 -0
- package/migrations/meta/0001_snapshot.json +852 -0
- package/migrations/meta/0002_snapshot.json +972 -0
- package/migrations/meta/0003_snapshot.json +1130 -0
- package/migrations/meta/0004_snapshot.json +1244 -0
- package/migrations/meta/0005_snapshot.json +1275 -0
- package/migrations/meta/0006_snapshot.json +1276 -0
- package/migrations/meta/0007_snapshot.json +1376 -0
- package/migrations/meta/0008_snapshot.json +1241 -0
- package/migrations/meta/0009_snapshot.json +1241 -0
- package/migrations/meta/0010_snapshot.json +1329 -0
- package/migrations/meta/0011_snapshot.json +1322 -0
- package/migrations/meta/0012_snapshot.json +1516 -0
- package/migrations/meta/0013_snapshot.json +1576 -0
- package/migrations/meta/_journal.json +104 -0
- package/package.json +28 -4
- package/pglite.data +37667 -8
- package/pglite.wasm +0 -0
- package/server.js +47451 -0
- package/viewer/assets/index-BW6lgiAa.css +1 -0
- package/viewer/assets/index-CBMcK_jK.js +90 -0
- package/viewer/index.html +13 -0
- package/README.md +0 -19
package/initdb.wasm
ADDED
|
Binary file
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
CREATE TABLE "areas" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"project_id" text NOT NULL,
|
|
4
|
+
"key" text NOT NULL,
|
|
5
|
+
"name" text NOT NULL,
|
|
6
|
+
"description" text,
|
|
7
|
+
"colour" text,
|
|
8
|
+
"sort_order" integer DEFAULT 0 NOT NULL,
|
|
9
|
+
"created_at" text NOT NULL
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE TABLE "dependencies" (
|
|
13
|
+
"item_id" text NOT NULL,
|
|
14
|
+
"depends_on_id" text NOT NULL,
|
|
15
|
+
"created_at" text NOT NULL,
|
|
16
|
+
CONSTRAINT "dependencies_item_id_depends_on_id_pk" PRIMARY KEY("item_id","depends_on_id")
|
|
17
|
+
);
|
|
18
|
+
--> statement-breakpoint
|
|
19
|
+
CREATE TABLE "events" (
|
|
20
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
21
|
+
"project_id" text,
|
|
22
|
+
"entity_type" text NOT NULL,
|
|
23
|
+
"entity_id" text NOT NULL,
|
|
24
|
+
"at" text NOT NULL,
|
|
25
|
+
"actor" text NOT NULL,
|
|
26
|
+
"kind" text NOT NULL,
|
|
27
|
+
"correlation_id" text,
|
|
28
|
+
"before" text,
|
|
29
|
+
"after" text
|
|
30
|
+
);
|
|
31
|
+
--> statement-breakpoint
|
|
32
|
+
CREATE TABLE "items" (
|
|
33
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
34
|
+
"project_id" text NOT NULL,
|
|
35
|
+
"ref" text NOT NULL,
|
|
36
|
+
"area_key" text NOT NULL,
|
|
37
|
+
"sort_path" text NOT NULL,
|
|
38
|
+
"parent_id" text,
|
|
39
|
+
"title" text NOT NULL,
|
|
40
|
+
"body" text,
|
|
41
|
+
"status" text NOT NULL,
|
|
42
|
+
"priority" integer DEFAULT 0 NOT NULL,
|
|
43
|
+
"created_at" text NOT NULL,
|
|
44
|
+
"updated_at" text NOT NULL,
|
|
45
|
+
"closed_at" text,
|
|
46
|
+
"deleted_at" text
|
|
47
|
+
);
|
|
48
|
+
--> statement-breakpoint
|
|
49
|
+
CREATE TABLE "projects" (
|
|
50
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
51
|
+
"key" text NOT NULL,
|
|
52
|
+
"name" text NOT NULL,
|
|
53
|
+
"type" text NOT NULL,
|
|
54
|
+
"direction" text,
|
|
55
|
+
"status" text NOT NULL,
|
|
56
|
+
"created_at" text NOT NULL,
|
|
57
|
+
"updated_at" text NOT NULL,
|
|
58
|
+
"archived_at" text,
|
|
59
|
+
CONSTRAINT "projects_key_unique" UNIQUE("key")
|
|
60
|
+
);
|
|
61
|
+
--> statement-breakpoint
|
|
62
|
+
ALTER TABLE "areas" ADD CONSTRAINT "areas_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
63
|
+
ALTER TABLE "dependencies" ADD CONSTRAINT "dependencies_item_id_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
64
|
+
ALTER TABLE "dependencies" ADD CONSTRAINT "dependencies_depends_on_id_items_id_fk" FOREIGN KEY ("depends_on_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
65
|
+
ALTER TABLE "events" ADD CONSTRAINT "events_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
66
|
+
ALTER TABLE "items" ADD CONSTRAINT "items_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
67
|
+
ALTER TABLE "items" ADD CONSTRAINT "items_parent_id_items_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
68
|
+
CREATE UNIQUE INDEX "areas_project_key" ON "areas" USING btree ("project_id","key");--> statement-breakpoint
|
|
69
|
+
CREATE INDEX "dependencies_depends_on" ON "dependencies" USING btree ("depends_on_id");--> statement-breakpoint
|
|
70
|
+
CREATE INDEX "events_entity" ON "events" USING btree ("entity_type","entity_id");--> statement-breakpoint
|
|
71
|
+
CREATE INDEX "events_project_at" ON "events" USING btree ("project_id","at");--> statement-breakpoint
|
|
72
|
+
CREATE UNIQUE INDEX "items_project_ref" ON "items" USING btree ("project_id","ref");--> statement-breakpoint
|
|
73
|
+
CREATE INDEX "items_project_status" ON "items" USING btree ("project_id","status");--> statement-breakpoint
|
|
74
|
+
CREATE INDEX "items_project_area" ON "items" USING btree ("project_id","area_key");--> statement-breakpoint
|
|
75
|
+
CREATE INDEX "items_project_sort" ON "items" USING btree ("project_id","sort_path");--> statement-breakpoint
|
|
76
|
+
CREATE INDEX "items_parent" ON "items" USING btree ("parent_id");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
CREATE TABLE "context_sections" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"project_id" text NOT NULL,
|
|
4
|
+
"heading" text NOT NULL,
|
|
5
|
+
"content" text NOT NULL,
|
|
6
|
+
"sort_order" integer DEFAULT 0 NOT NULL,
|
|
7
|
+
"created_at" text NOT NULL,
|
|
8
|
+
"updated_at" text NOT NULL
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
CREATE TABLE "sessions" (
|
|
12
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
13
|
+
"project_id" text NOT NULL,
|
|
14
|
+
"started_at" text NOT NULL,
|
|
15
|
+
"ended_at" text,
|
|
16
|
+
"summary" text,
|
|
17
|
+
"actor" text NOT NULL,
|
|
18
|
+
"compacted_into" text,
|
|
19
|
+
"created_at" text NOT NULL
|
|
20
|
+
);
|
|
21
|
+
--> statement-breakpoint
|
|
22
|
+
ALTER TABLE "context_sections" ADD CONSTRAINT "context_sections_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
23
|
+
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
24
|
+
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_compacted_into_sessions_id_fk" FOREIGN KEY ("compacted_into") REFERENCES "public"."sessions"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
25
|
+
CREATE UNIQUE INDEX "context_sections_project_heading" ON "context_sections" USING btree ("project_id","heading");--> statement-breakpoint
|
|
26
|
+
CREATE INDEX "context_sections_project_order" ON "context_sections" USING btree ("project_id","sort_order");--> statement-breakpoint
|
|
27
|
+
CREATE INDEX "sessions_project_started" ON "sessions" USING btree ("project_id","started_at");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TABLE "notes" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"project_id" text NOT NULL,
|
|
4
|
+
"item_id" text,
|
|
5
|
+
"body" text NOT NULL,
|
|
6
|
+
"audience" text DEFAULT 'user' NOT NULL,
|
|
7
|
+
"actor" text NOT NULL,
|
|
8
|
+
"created_at" text NOT NULL
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
ALTER TABLE "notes" ADD CONSTRAINT "notes_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
12
|
+
ALTER TABLE "notes" ADD CONSTRAINT "notes_item_id_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
13
|
+
CREATE INDEX "notes_project_created" ON "notes" USING btree ("project_id","created_at");--> statement-breakpoint
|
|
14
|
+
CREATE INDEX "notes_item" ON "notes" USING btree ("item_id");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
CREATE TABLE "attachments" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"project_id" text NOT NULL,
|
|
4
|
+
"item_id" text,
|
|
5
|
+
"hash" text NOT NULL,
|
|
6
|
+
"mime" text NOT NULL,
|
|
7
|
+
"bytes" integer NOT NULL,
|
|
8
|
+
"caption" text,
|
|
9
|
+
"actor" text NOT NULL,
|
|
10
|
+
"created_at" text NOT NULL
|
|
11
|
+
);
|
|
12
|
+
--> statement-breakpoint
|
|
13
|
+
ALTER TABLE "attachments" ADD CONSTRAINT "attachments_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
14
|
+
ALTER TABLE "attachments" ADD CONSTRAINT "attachments_item_id_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
15
|
+
CREATE INDEX "attachments_project_item" ON "attachments" USING btree ("project_id","item_id");--> statement-breakpoint
|
|
16
|
+
CREATE INDEX "attachments_hash" ON "attachments" USING btree ("hash");--> statement-breakpoint
|
|
17
|
+
CREATE UNIQUE INDEX "attachments_item_hash" ON "attachments" USING btree ("project_id","item_id","hash");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TABLE "users" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"issuer" text NOT NULL,
|
|
4
|
+
"subject" text NOT NULL,
|
|
5
|
+
"email" text,
|
|
6
|
+
"created_at" text NOT NULL
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "projects" DROP CONSTRAINT "projects_key_unique";--> statement-breakpoint
|
|
10
|
+
ALTER TABLE "projects" ADD COLUMN "owner_id" text NOT NULL;--> statement-breakpoint
|
|
11
|
+
CREATE UNIQUE INDEX "users_issuer_subject" ON "users" USING btree ("issuer","subject");--> statement-breakpoint
|
|
12
|
+
CREATE UNIQUE INDEX "users_email" ON "users" USING btree ("email");--> statement-breakpoint
|
|
13
|
+
ALTER TABLE "projects" ADD CONSTRAINT "projects_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
14
|
+
CREATE UNIQUE INDEX "projects_owner_key" ON "projects" USING btree ("owner_id","key");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "allowed_emails" ALTER COLUMN "created_at" SET DEFAULT to_char(now() AT TIME ZONE 'utc', 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"');
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
ALTER TABLE "context_sections" ADD COLUMN "tsv" "tsvector" GENERATED ALWAYS AS (setweight(to_tsvector('english', coalesce("heading", '')), 'A') || setweight(to_tsvector('english', coalesce("content", '')), 'B')) STORED;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "items" ADD COLUMN "tsv" "tsvector" GENERATED ALWAYS AS (setweight(to_tsvector('english', coalesce("title", '')), 'A') || setweight(to_tsvector('english', coalesce("body", '')), 'B')) STORED;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "notes" ADD COLUMN "tsv" "tsvector" GENERATED ALWAYS AS (setweight(to_tsvector('english', coalesce("body", '')), 'A')) STORED;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "sessions" ADD COLUMN "tsv" "tsvector" GENERATED ALWAYS AS (setweight(to_tsvector('english', coalesce("summary", '')), 'A')) STORED;--> statement-breakpoint
|
|
5
|
+
CREATE INDEX "context_sections_tsv" ON "context_sections" USING gin ("tsv");--> statement-breakpoint
|
|
6
|
+
CREATE INDEX "items_tsv" ON "items" USING gin ("tsv");--> statement-breakpoint
|
|
7
|
+
CREATE INDEX "notes_tsv" ON "notes" USING gin ("tsv");--> statement-breakpoint
|
|
8
|
+
CREATE INDEX "sessions_tsv" ON "sessions" USING gin ("tsv");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DROP TABLE "sessions" CASCADE;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
ALTER TABLE "notes" RENAME TO "comments";--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "comments" DROP CONSTRAINT "notes_project_id_projects_id_fk";
|
|
3
|
+
--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "comments" DROP CONSTRAINT "notes_item_id_items_id_fk";
|
|
5
|
+
--> statement-breakpoint
|
|
6
|
+
DROP INDEX "notes_project_created";--> statement-breakpoint
|
|
7
|
+
DROP INDEX "notes_item";--> statement-breakpoint
|
|
8
|
+
DROP INDEX "notes_tsv";--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "comments" ADD CONSTRAINT "comments_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
10
|
+
ALTER TABLE "comments" ADD CONSTRAINT "comments_item_id_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
11
|
+
CREATE INDEX "comments_project_created" ON "comments" USING btree ("project_id","created_at");--> statement-breakpoint
|
|
12
|
+
CREATE INDEX "comments_item" ON "comments" USING btree ("item_id");--> statement-breakpoint
|
|
13
|
+
CREATE INDEX "comments_tsv" ON "comments" USING gin ("tsv");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
CREATE TABLE "project_next" (
|
|
2
|
+
"project_id" text NOT NULL,
|
|
3
|
+
"item_id" text NOT NULL,
|
|
4
|
+
"position" integer NOT NULL,
|
|
5
|
+
CONSTRAINT "project_next_project_id_item_id_pk" PRIMARY KEY("project_id","item_id")
|
|
6
|
+
);
|
|
7
|
+
--> statement-breakpoint
|
|
8
|
+
ALTER TABLE "project_next" ADD CONSTRAINT "project_next_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "project_next" ADD CONSTRAINT "project_next_item_id_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
10
|
+
CREATE UNIQUE INDEX "project_next_position" ON "project_next" USING btree ("project_id","position");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "items" DROP COLUMN "priority";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
CREATE TABLE "measurements" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"project_id" text NOT NULL,
|
|
4
|
+
"item_id" text,
|
|
5
|
+
"parent_id" text,
|
|
6
|
+
"metric" text NOT NULL,
|
|
7
|
+
"value" double precision,
|
|
8
|
+
"text_value" text,
|
|
9
|
+
"unit" text,
|
|
10
|
+
"label" text,
|
|
11
|
+
"at" text NOT NULL,
|
|
12
|
+
"source" text,
|
|
13
|
+
"actor" text NOT NULL,
|
|
14
|
+
"created_at" text NOT NULL,
|
|
15
|
+
CONSTRAINT "measurements_one_reading" CHECK (NOT ("measurements"."value" IS NOT NULL AND "measurements"."text_value" IS NOT NULL))
|
|
16
|
+
);
|
|
17
|
+
--> statement-breakpoint
|
|
18
|
+
ALTER TABLE "measurements" ADD CONSTRAINT "measurements_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
19
|
+
ALTER TABLE "measurements" ADD CONSTRAINT "measurements_item_id_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
20
|
+
ALTER TABLE "measurements" ADD CONSTRAINT "measurements_parent_id_measurements_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."measurements"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
21
|
+
CREATE INDEX "measurements_project_metric_at" ON "measurements" USING btree ("project_id","metric","at");--> statement-breakpoint
|
|
22
|
+
CREATE INDEX "measurements_item" ON "measurements" USING btree ("item_id");--> statement-breakpoint
|
|
23
|
+
CREATE INDEX "measurements_parent" ON "measurements" USING btree ("parent_id");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
CREATE TABLE "scoped_dependencies" (
|
|
2
|
+
"item_id" text NOT NULL,
|
|
3
|
+
"target_project" text NOT NULL,
|
|
4
|
+
"target_ref" text NOT NULL,
|
|
5
|
+
"created_at" text NOT NULL,
|
|
6
|
+
CONSTRAINT "scoped_dependencies_item_id_target_project_target_ref_pk" PRIMARY KEY("item_id","target_project","target_ref")
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "scoped_dependencies" ADD CONSTRAINT "scoped_dependencies_item_id_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."items"("id") ON DELETE cascade ON UPDATE no action;
|