@netsirk/hippocampe-linux-x64 0.0.0-stage → 0.7.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/bin/hippo +4 -0
- package/bin/migrations/20261006095556_baseline/migration.sql +201 -0
- package/bin/migrations/20261006095556_baseline/snapshot.json +2298 -0
- package/bin/migrations/20261006100925_sensitive_types/migration.sql +1 -0
- package/bin/migrations/20261006100925_sensitive_types/snapshot.json +2311 -0
- package/bin/migrations/20261006103751_entry_sources/migration.sql +1 -0
- package/bin/migrations/20261006103751_entry_sources/snapshot.json +2324 -0
- package/bin/migrations/20261006104542_inbox/migration.sql +20 -0
- package/bin/migrations/20261006104542_inbox/snapshot.json +2562 -0
- package/bin/migrations/20261006111614_inbox_mime/migration.sql +1 -0
- package/bin/migrations/20261006111614_inbox_mime/snapshot.json +2575 -0
- package/bin/migrations/20261006120126_search_index/migration.sql +9 -0
- package/bin/migrations/20261006120126_search_index/snapshot.json +2620 -0
- package/bin/migrations/20261006160724_findings/migration.sql +36 -0
- package/bin/migrations/20261006160724_findings/snapshot.json +3068 -0
- package/bin/migrations/20261007073146_instance_rules/migration.sql +6 -0
- package/bin/migrations/20261007073146_instance_rules/snapshot.json +3128 -0
- package/bin/migrations/20261007080007_read_in_parent/migration.sql +1 -0
- package/bin/migrations/20261007080007_read_in_parent/snapshot.json +3141 -0
- package/bin/migrations/20261007084816_pending_references/migration.sql +8 -0
- package/bin/migrations/20261007084816_pending_references/snapshot.json +3215 -0
- package/bin/migrations/20261007085835_merged_findings/migration.sql +1 -0
- package/bin/migrations/20261007085835_merged_findings/snapshot.json +3228 -0
- package/bin/migrations/20261007105935_merged_into_key/migration.sql +1 -0
- package/bin/migrations/20261007105935_merged_into_key/snapshot.json +3241 -0
- package/bin/migrations/20261007111353_remove_source_registry/migration.sql +13 -0
- package/bin/migrations/20261007111353_remove_source_registry/snapshot.json +3149 -0
- package/bin/migrations/20261007115731_link_note_and_dates/migration.sql +3 -0
- package/bin/migrations/20261007115731_link_note_and_dates/snapshot.json +3188 -0
- package/bin/migrations/20261008075945_resolve_stale_pending/migration.sql +11 -0
- package/bin/migrations/20261008075945_resolve_stale_pending/snapshot.json +3188 -0
- package/bin/migrations/20261008081223_archived_reason/migration.sql +1 -0
- package/bin/migrations/20261008081223_archived_reason/snapshot.json +3201 -0
- package/bin/migrations/20261009160041_entries_aliases/migration.sql +1 -0
- package/bin/migrations/20261009160041_entries_aliases/snapshot.json +3222 -0
- package/bin/migrations/20261009182911_known_or_supposed/migration.sql +32 -0
- package/bin/migrations/20261009182911_known_or_supposed/snapshot.json +3229 -0
- package/bin/migrations/20261009194740_part_of/migration.sql +86 -0
- package/bin/migrations/20261009194740_part_of/snapshot.json +3232 -0
- package/bin/migrations/20261009210344_rename_to_hippocampe/migration.sql +28 -0
- package/bin/migrations/20261009210344_rename_to_hippocampe/snapshot.json +3232 -0
- package/bin/migrations/20261010154936_dated_by/migration.sql +1 -0
- package/bin/migrations/20261010154936_dated_by/snapshot.json +3245 -0
- package/bin/migrations/20261010202749_instance_owner/migration.sql +8 -0
- package/bin/migrations/20261010202749_instance_owner/snapshot.json +3318 -0
- package/package.json +17 -4
- package/README.md +0 -3
package/bin/hippo
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
-- Full-text search removes accents through this extension (see search/language.ts).
|
|
2
|
+
CREATE EXTENSION IF NOT EXISTS unaccent;
|
|
3
|
+
--> statement-breakpoint
|
|
4
|
+
CREATE TABLE "auth_account" (
|
|
5
|
+
"id" text PRIMARY KEY,
|
|
6
|
+
"accountId" text NOT NULL,
|
|
7
|
+
"providerId" text NOT NULL,
|
|
8
|
+
"userId" text NOT NULL,
|
|
9
|
+
"accessToken" text,
|
|
10
|
+
"refreshToken" text,
|
|
11
|
+
"idToken" text,
|
|
12
|
+
"accessTokenExpiresAt" timestamp with time zone,
|
|
13
|
+
"refreshTokenExpiresAt" timestamp with time zone,
|
|
14
|
+
"scope" text,
|
|
15
|
+
"password" text,
|
|
16
|
+
"createdAt" timestamp with time zone NOT NULL,
|
|
17
|
+
"updatedAt" timestamp with time zone NOT NULL
|
|
18
|
+
);
|
|
19
|
+
--> statement-breakpoint
|
|
20
|
+
CREATE TABLE "auth_apikey" (
|
|
21
|
+
"id" text PRIMARY KEY,
|
|
22
|
+
"configId" text NOT NULL,
|
|
23
|
+
"name" text,
|
|
24
|
+
"start" text,
|
|
25
|
+
"referenceId" text NOT NULL,
|
|
26
|
+
"prefix" text,
|
|
27
|
+
"key" text NOT NULL,
|
|
28
|
+
"refillInterval" integer,
|
|
29
|
+
"refillAmount" integer,
|
|
30
|
+
"lastRefillAt" timestamp with time zone,
|
|
31
|
+
"enabled" boolean,
|
|
32
|
+
"rateLimitEnabled" boolean,
|
|
33
|
+
"rateLimitTimeWindow" integer,
|
|
34
|
+
"rateLimitMax" integer,
|
|
35
|
+
"requestCount" integer,
|
|
36
|
+
"remaining" integer,
|
|
37
|
+
"lastRequest" timestamp with time zone,
|
|
38
|
+
"expiresAt" timestamp with time zone,
|
|
39
|
+
"createdAt" timestamp with time zone NOT NULL,
|
|
40
|
+
"updatedAt" timestamp with time zone NOT NULL,
|
|
41
|
+
"permissions" text,
|
|
42
|
+
"metadata" text
|
|
43
|
+
);
|
|
44
|
+
--> statement-breakpoint
|
|
45
|
+
CREATE TABLE "auth_session" (
|
|
46
|
+
"id" text PRIMARY KEY,
|
|
47
|
+
"expiresAt" timestamp with time zone NOT NULL,
|
|
48
|
+
"token" text NOT NULL CONSTRAINT "auth_session_token_key" UNIQUE,
|
|
49
|
+
"createdAt" timestamp with time zone NOT NULL,
|
|
50
|
+
"updatedAt" timestamp with time zone NOT NULL,
|
|
51
|
+
"ipAddress" text,
|
|
52
|
+
"userAgent" text,
|
|
53
|
+
"userId" text NOT NULL
|
|
54
|
+
);
|
|
55
|
+
--> statement-breakpoint
|
|
56
|
+
CREATE TABLE "auth_user" (
|
|
57
|
+
"id" text PRIMARY KEY,
|
|
58
|
+
"name" text NOT NULL,
|
|
59
|
+
"email" text NOT NULL CONSTRAINT "auth_user_email_key" UNIQUE,
|
|
60
|
+
"emailVerified" boolean NOT NULL,
|
|
61
|
+
"image" text,
|
|
62
|
+
"createdAt" timestamp with time zone NOT NULL,
|
|
63
|
+
"updatedAt" timestamp with time zone NOT NULL
|
|
64
|
+
);
|
|
65
|
+
--> statement-breakpoint
|
|
66
|
+
CREATE TABLE "auth_verification" (
|
|
67
|
+
"id" text PRIMARY KEY,
|
|
68
|
+
"identifier" text NOT NULL,
|
|
69
|
+
"value" text NOT NULL,
|
|
70
|
+
"expiresAt" timestamp with time zone NOT NULL,
|
|
71
|
+
"createdAt" timestamp with time zone NOT NULL,
|
|
72
|
+
"updatedAt" timestamp with time zone NOT NULL
|
|
73
|
+
);
|
|
74
|
+
--> statement-breakpoint
|
|
75
|
+
CREATE TABLE "entries" (
|
|
76
|
+
"id" uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
77
|
+
"type" text NOT NULL,
|
|
78
|
+
"title" text NOT NULL,
|
|
79
|
+
"slug" text NOT NULL CONSTRAINT "entries_slug_key" UNIQUE,
|
|
80
|
+
"aliases" jsonb DEFAULT '[]' NOT NULL,
|
|
81
|
+
"tags" jsonb DEFAULT '[]' NOT NULL,
|
|
82
|
+
"parent_id" uuid,
|
|
83
|
+
"fields" jsonb DEFAULT '{}' NOT NULL,
|
|
84
|
+
"provenance" jsonb DEFAULT '{}' NOT NULL,
|
|
85
|
+
"body" text DEFAULT '' NOT NULL,
|
|
86
|
+
"summary" text DEFAULT '' NOT NULL,
|
|
87
|
+
"verified" boolean DEFAULT false NOT NULL,
|
|
88
|
+
"created" timestamp with time zone DEFAULT now() NOT NULL,
|
|
89
|
+
"updated" timestamp with time zone DEFAULT now() NOT NULL,
|
|
90
|
+
"valid_from" date,
|
|
91
|
+
"valid_until" date,
|
|
92
|
+
"superseded_by" uuid,
|
|
93
|
+
"archived_at" timestamp with time zone,
|
|
94
|
+
"search_language" regconfig DEFAULT 'simple' NOT NULL,
|
|
95
|
+
"media_text" text DEFAULT '' NOT NULL,
|
|
96
|
+
"search" tsvector GENERATED ALWAYS AS (setweight(to_tsvector(search_language, title || ' ' || aliases::text), 'A') ||
|
|
97
|
+
setweight(to_tsvector(search_language, tags::text || ' ' || summary), 'B') ||
|
|
98
|
+
setweight(to_tsvector(search_language, body || ' ' || media_text), 'C')) STORED
|
|
99
|
+
);
|
|
100
|
+
--> statement-breakpoint
|
|
101
|
+
CREATE TABLE "events" (
|
|
102
|
+
"id" bigint PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "events_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1),
|
|
103
|
+
"at" timestamp with time zone DEFAULT clock_timestamp() NOT NULL,
|
|
104
|
+
"actor" text NOT NULL,
|
|
105
|
+
"entry_id" uuid,
|
|
106
|
+
"type_name" text,
|
|
107
|
+
"action" text NOT NULL,
|
|
108
|
+
"changes" jsonb NOT NULL,
|
|
109
|
+
CONSTRAINT "events_check" CHECK ((entry_id IS NULL) <> (type_name IS NULL))
|
|
110
|
+
);
|
|
111
|
+
--> statement-breakpoint
|
|
112
|
+
CREATE TABLE "heads_up" (
|
|
113
|
+
"actor" text,
|
|
114
|
+
"entry_id" uuid,
|
|
115
|
+
"field" text,
|
|
116
|
+
"period" text,
|
|
117
|
+
"day" date,
|
|
118
|
+
CONSTRAINT "heads_up_pkey" PRIMARY KEY("actor","entry_id","field","period","day")
|
|
119
|
+
);
|
|
120
|
+
--> statement-breakpoint
|
|
121
|
+
CREATE TABLE "links" (
|
|
122
|
+
"source_id" uuid,
|
|
123
|
+
"target_id" uuid,
|
|
124
|
+
"relation" text,
|
|
125
|
+
"period" text DEFAULT '',
|
|
126
|
+
"field" text DEFAULT '',
|
|
127
|
+
CONSTRAINT "links_pkey" PRIMARY KEY("source_id","target_id","relation","period","field")
|
|
128
|
+
);
|
|
129
|
+
--> statement-breakpoint
|
|
130
|
+
CREATE TABLE "media" (
|
|
131
|
+
"id" uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
132
|
+
"entry_id" uuid NOT NULL,
|
|
133
|
+
"kind" text NOT NULL,
|
|
134
|
+
"mime" text NOT NULL,
|
|
135
|
+
"size" integer NOT NULL,
|
|
136
|
+
"sha256" text NOT NULL,
|
|
137
|
+
"width" integer,
|
|
138
|
+
"height" integer,
|
|
139
|
+
"duration" double precision,
|
|
140
|
+
"source_url" text,
|
|
141
|
+
"alt" text DEFAULT '' NOT NULL,
|
|
142
|
+
"position" integer NOT NULL,
|
|
143
|
+
"created" timestamp with time zone DEFAULT now() NOT NULL
|
|
144
|
+
);
|
|
145
|
+
--> statement-breakpoint
|
|
146
|
+
CREATE TABLE "sources" (
|
|
147
|
+
"source" text,
|
|
148
|
+
"identifier" text,
|
|
149
|
+
"entry_id" uuid NOT NULL,
|
|
150
|
+
"hash" text NOT NULL,
|
|
151
|
+
"imported_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
152
|
+
CONSTRAINT "sources_pkey" PRIMARY KEY("source","identifier")
|
|
153
|
+
);
|
|
154
|
+
--> statement-breakpoint
|
|
155
|
+
CREATE TABLE "type_proposals" (
|
|
156
|
+
"id" uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
157
|
+
"action" text NOT NULL,
|
|
158
|
+
"type_name" text NOT NULL,
|
|
159
|
+
"into_type" text,
|
|
160
|
+
"mapping" jsonb,
|
|
161
|
+
"proposed_by" text NOT NULL,
|
|
162
|
+
"proposed_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
163
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
164
|
+
"decided_by" text,
|
|
165
|
+
"decided_at" timestamp with time zone
|
|
166
|
+
);
|
|
167
|
+
--> statement-breakpoint
|
|
168
|
+
CREATE TABLE "types" (
|
|
169
|
+
"name" text PRIMARY KEY,
|
|
170
|
+
"label" text NOT NULL,
|
|
171
|
+
"description" text NOT NULL,
|
|
172
|
+
"fields" jsonb NOT NULL,
|
|
173
|
+
"created" timestamp with time zone DEFAULT now() NOT NULL,
|
|
174
|
+
"updated" timestamp with time zone DEFAULT now() NOT NULL,
|
|
175
|
+
"deleted_at" timestamp with time zone
|
|
176
|
+
);
|
|
177
|
+
--> statement-breakpoint
|
|
178
|
+
CREATE INDEX "auth_apikey_key" ON "auth_apikey" ("key");--> statement-breakpoint
|
|
179
|
+
CREATE INDEX "auth_session_user" ON "auth_session" ("userId");--> statement-breakpoint
|
|
180
|
+
CREATE INDEX "entries_parent_id" ON "entries" ("parent_id");--> statement-breakpoint
|
|
181
|
+
CREATE INDEX "entries_search" ON "entries" USING gin ("search");--> statement-breakpoint
|
|
182
|
+
CREATE INDEX "events_entry_id" ON "events" ("entry_id");--> statement-breakpoint
|
|
183
|
+
CREATE INDEX "events_type_name" ON "events" ("type_name");--> statement-breakpoint
|
|
184
|
+
CREATE INDEX "links_target_id" ON "links" ("target_id");--> statement-breakpoint
|
|
185
|
+
CREATE INDEX "media_entry_id" ON "media" ("entry_id");--> statement-breakpoint
|
|
186
|
+
CREATE INDEX "media_sha256" ON "media" ("sha256");--> statement-breakpoint
|
|
187
|
+
ALTER TABLE "auth_account" ADD CONSTRAINT "auth_account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "auth_user"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
188
|
+
ALTER TABLE "auth_apikey" ADD CONSTRAINT "auth_apikey_referenceId_fkey" FOREIGN KEY ("referenceId") REFERENCES "auth_user"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
189
|
+
ALTER TABLE "auth_session" ADD CONSTRAINT "auth_session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "auth_user"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
190
|
+
ALTER TABLE "entries" ADD CONSTRAINT "entries_type_fkey" FOREIGN KEY ("type") REFERENCES "types"("name");--> statement-breakpoint
|
|
191
|
+
ALTER TABLE "entries" ADD CONSTRAINT "entries_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "entries"("id");--> statement-breakpoint
|
|
192
|
+
ALTER TABLE "entries" ADD CONSTRAINT "entries_superseded_by_fkey" FOREIGN KEY ("superseded_by") REFERENCES "entries"("id");--> statement-breakpoint
|
|
193
|
+
ALTER TABLE "events" ADD CONSTRAINT "events_entry_id_fkey" FOREIGN KEY ("entry_id") REFERENCES "entries"("id");--> statement-breakpoint
|
|
194
|
+
ALTER TABLE "events" ADD CONSTRAINT "events_type_name_fkey" FOREIGN KEY ("type_name") REFERENCES "types"("name");--> statement-breakpoint
|
|
195
|
+
ALTER TABLE "heads_up" ADD CONSTRAINT "heads_up_entry_id_fkey" FOREIGN KEY ("entry_id") REFERENCES "entries"("id");--> statement-breakpoint
|
|
196
|
+
ALTER TABLE "links" ADD CONSTRAINT "links_source_id_fkey" FOREIGN KEY ("source_id") REFERENCES "entries"("id");--> statement-breakpoint
|
|
197
|
+
ALTER TABLE "links" ADD CONSTRAINT "links_target_id_fkey" FOREIGN KEY ("target_id") REFERENCES "entries"("id");--> statement-breakpoint
|
|
198
|
+
ALTER TABLE "media" ADD CONSTRAINT "media_entry_id_fkey" FOREIGN KEY ("entry_id") REFERENCES "entries"("id");--> statement-breakpoint
|
|
199
|
+
ALTER TABLE "sources" ADD CONSTRAINT "sources_entry_id_fkey" FOREIGN KEY ("entry_id") REFERENCES "entries"("id");--> statement-breakpoint
|
|
200
|
+
ALTER TABLE "type_proposals" ADD CONSTRAINT "type_proposals_type_name_fkey" FOREIGN KEY ("type_name") REFERENCES "types"("name");--> statement-breakpoint
|
|
201
|
+
ALTER TABLE "type_proposals" ADD CONSTRAINT "type_proposals_into_type_fkey" FOREIGN KEY ("into_type") REFERENCES "types"("name");
|