this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add all tables, but don't fill them yet

+1021 -1
+371
api/src/db/drizzle/0003_add_level_one_tables.sql
··· 1 + CREATE TYPE "public"."tangled_pipeline_status_status" AS ENUM('pending', 'running', 'failed', 'timeout', 'cancelled', 'success');--> statement-breakpoint 2 + CREATE TYPE "public"."tangled_pipeline_trigger_metadata_kind" AS ENUM('push', 'pull_request', 'manual');--> statement-breakpoint 3 + CREATE TYPE "public"."tangled_vouch_kind" AS ENUM('vouch', 'denounce');--> statement-breakpoint 4 + CREATE TABLE "tangled_artifact" ( 5 + "did" text NOT NULL, 6 + "rev" text NOT NULL, 7 + "rkey" text NOT NULL, 8 + "cid" text, 9 + "deleted" boolean NOT NULL, 10 + "name" text, 11 + "repo" text, 12 + "repo_did" text, 13 + "tag" text, 14 + "created_at" timestamp with time zone, 15 + "artifact_ref" text, 16 + "artifact_size" integer, 17 + "artifact_mime_type" text, 18 + CONSTRAINT "tangled_artifact_did_rkey_pk" PRIMARY KEY("did","rkey"), 19 + CONSTRAINT "tangled_artifact_cid_only_null_if_deleted" CHECK (("tangled_artifact"."cid" is not null or "tangled_artifact"."deleted" = true)), 20 + CONSTRAINT "tangled_artifact_non_null_fields" CHECK (("tangled_artifact"."deleted" = true or ("tangled_artifact"."name" is not null and "tangled_artifact"."tag" is not null and "tangled_artifact"."created_at" is not null and "tangled_artifact"."artifact_ref" is not null and "tangled_artifact"."artifact_size" is not null and "tangled_artifact"."artifact_mime_type" is not null))) 21 + ); 22 + --> statement-breakpoint 23 + CREATE TABLE "tangled_collaborator" ( 24 + "did" text NOT NULL, 25 + "rev" text NOT NULL, 26 + "rkey" text NOT NULL, 27 + "cid" text, 28 + "deleted" boolean NOT NULL, 29 + "subject" text, 30 + "repo" text, 31 + "repo_did" text, 32 + "created_at" timestamp with time zone, 33 + CONSTRAINT "tangled_collaborator_did_rkey_pk" PRIMARY KEY("did","rkey"), 34 + CONSTRAINT "tangled_collaborator_cid_only_null_if_deleted" CHECK (("tangled_collaborator"."cid" is not null or "tangled_collaborator"."deleted" = true)), 35 + CONSTRAINT "tangled_collaborator_non_null_fields" CHECK (("tangled_collaborator"."deleted" = true or ("tangled_collaborator"."subject" is not null and "tangled_collaborator"."created_at" is not null))) 36 + ); 37 + --> statement-breakpoint 38 + CREATE TABLE "tangled_follow" ( 39 + "did" text NOT NULL, 40 + "rev" text NOT NULL, 41 + "rkey" text NOT NULL, 42 + "cid" text, 43 + "deleted" boolean NOT NULL, 44 + "subject" text, 45 + "created_at" timestamp with time zone, 46 + CONSTRAINT "tangled_follow_did_rkey_pk" PRIMARY KEY("did","rkey"), 47 + CONSTRAINT "tangled_follow_cid_only_null_if_deleted" CHECK (("tangled_follow"."cid" is not null or "tangled_follow"."deleted" = true)), 48 + CONSTRAINT "tangled_follow_non_null_fields" CHECK (("tangled_follow"."deleted" = true or ("tangled_follow"."subject" is not null and "tangled_follow"."created_at" is not null))) 49 + ); 50 + --> statement-breakpoint 51 + CREATE TABLE "tangled_issue" ( 52 + "did" text NOT NULL, 53 + "rev" text NOT NULL, 54 + "rkey" text NOT NULL, 55 + "cid" text, 56 + "deleted" boolean NOT NULL, 57 + "repo" text, 58 + "repo_did" text, 59 + "title" text, 60 + "body" text, 61 + "created_at" timestamp with time zone, 62 + "mentions" text[], 63 + "references" text[], 64 + CONSTRAINT "tangled_issue_did_rkey_pk" PRIMARY KEY("did","rkey"), 65 + CONSTRAINT "tangled_issue_cid_only_null_if_deleted" CHECK (("tangled_issue"."cid" is not null or "tangled_issue"."deleted" = true)), 66 + CONSTRAINT "tangled_issue_non_null_fields" CHECK (("tangled_issue"."deleted" = true or ("tangled_issue"."title" is not null and "tangled_issue"."created_at" is not null))) 67 + ); 68 + --> statement-breakpoint 69 + CREATE TABLE "tangled_issue_comment" ( 70 + "did" text NOT NULL, 71 + "rev" text NOT NULL, 72 + "rkey" text NOT NULL, 73 + "cid" text, 74 + "deleted" boolean NOT NULL, 75 + "issue" text, 76 + "body" text, 77 + "created_at" timestamp with time zone, 78 + "reply_to" text, 79 + "mentions" text[], 80 + "references" text[], 81 + CONSTRAINT "tangled_issue_comment_did_rkey_pk" PRIMARY KEY("did","rkey"), 82 + CONSTRAINT "tangled_issue_comment_cid_only_null_if_deleted" CHECK (("tangled_issue_comment"."cid" is not null or "tangled_issue_comment"."deleted" = true)), 83 + CONSTRAINT "tangled_issue_comment_non_null_fields" CHECK (("tangled_issue_comment"."deleted" = true or ("tangled_issue_comment"."issue" is not null and "tangled_issue_comment"."body" is not null and "tangled_issue_comment"."created_at" is not null))) 84 + ); 85 + --> statement-breakpoint 86 + CREATE TABLE "tangled_issue_state" ( 87 + "did" text NOT NULL, 88 + "rev" text NOT NULL, 89 + "rkey" text NOT NULL, 90 + "cid" text, 91 + "deleted" boolean NOT NULL, 92 + "issue" text, 93 + "state" text, 94 + CONSTRAINT "tangled_issue_state_did_rkey_pk" PRIMARY KEY("did","rkey"), 95 + CONSTRAINT "tangled_issue_state_cid_only_null_if_deleted" CHECK (("tangled_issue_state"."cid" is not null or "tangled_issue_state"."deleted" = true)), 96 + CONSTRAINT "tangled_issue_state_non_null_fields" CHECK (("tangled_issue_state"."deleted" = true or ("tangled_issue_state"."issue" is not null and "tangled_issue_state"."state" is not null))) 97 + ); 98 + --> statement-breakpoint 99 + CREATE TABLE "tangled_knot" ( 100 + "did" text NOT NULL, 101 + "rev" text NOT NULL, 102 + "rkey" text NOT NULL, 103 + "cid" text, 104 + "deleted" boolean NOT NULL, 105 + "created_at" timestamp with time zone, 106 + CONSTRAINT "tangled_knot_did_rkey_pk" PRIMARY KEY("did","rkey"), 107 + CONSTRAINT "tangled_knot_cid_only_null_if_deleted" CHECK (("tangled_knot"."cid" is not null or "tangled_knot"."deleted" = true)), 108 + CONSTRAINT "tangled_knot_non_null_fields" CHECK (("tangled_knot"."deleted" = true or "tangled_knot"."created_at" is not null)) 109 + ); 110 + --> statement-breakpoint 111 + CREATE TABLE "tangled_knot_member" ( 112 + "did" text NOT NULL, 113 + "rev" text NOT NULL, 114 + "rkey" text NOT NULL, 115 + "cid" text, 116 + "deleted" boolean NOT NULL, 117 + "subject" text, 118 + "domain" text, 119 + "created_at" timestamp with time zone, 120 + CONSTRAINT "tangled_knot_member_did_rkey_pk" PRIMARY KEY("did","rkey"), 121 + CONSTRAINT "tangled_knot_member_cid_only_null_if_deleted" CHECK (("tangled_knot_member"."cid" is not null or "tangled_knot_member"."deleted" = true)), 122 + CONSTRAINT "tangled_knot_member_non_null_fields" CHECK (("tangled_knot_member"."deleted" = true or ("tangled_knot_member"."subject" is not null and "tangled_knot_member"."domain" is not null and "tangled_knot_member"."created_at" is not null))) 123 + ); 124 + --> statement-breakpoint 125 + CREATE TABLE "tangled_label_definition" ( 126 + "did" text NOT NULL, 127 + "rev" text NOT NULL, 128 + "rkey" text NOT NULL, 129 + "cid" text, 130 + "deleted" boolean NOT NULL, 131 + "name" text, 132 + "value_type" text, 133 + "value_format" text, 134 + "value_enum" text[], 135 + "scope" text[], 136 + "color" text, 137 + "created_at" timestamp with time zone, 138 + "multiple" boolean, 139 + CONSTRAINT "tangled_label_definition_did_rkey_pk" PRIMARY KEY("did","rkey"), 140 + CONSTRAINT "tangled_label_definition_cid_only_null_if_deleted" CHECK (("tangled_label_definition"."cid" is not null or "tangled_label_definition"."deleted" = true)), 141 + CONSTRAINT "tangled_label_definition_non_null_fields" CHECK (("tangled_label_definition"."deleted" = true or ("tangled_label_definition"."name" is not null and "tangled_label_definition"."value_type" is not null and "tangled_label_definition"."value_format" is not null and "tangled_label_definition"."scope" is not null and "tangled_label_definition"."created_at" is not null))) 142 + ); 143 + --> statement-breakpoint 144 + CREATE TABLE "tangled_label_op" ( 145 + "did" text NOT NULL, 146 + "rev" text NOT NULL, 147 + "rkey" text NOT NULL, 148 + "cid" text, 149 + "deleted" boolean NOT NULL, 150 + "subject" text, 151 + "performed_at" timestamp with time zone, 152 + "add" jsonb, 153 + "delete" jsonb, 154 + CONSTRAINT "tangled_label_op_did_rkey_pk" PRIMARY KEY("did","rkey"), 155 + CONSTRAINT "tangled_label_op_cid_only_null_if_deleted" CHECK (("tangled_label_op"."cid" is not null or "tangled_label_op"."deleted" = true)), 156 + CONSTRAINT "tangled_label_op_non_null_fields" CHECK (("tangled_label_op"."deleted" = true or ("tangled_label_op"."subject" is not null and "tangled_label_op"."add" is not null and "tangled_label_op"."delete" is not null and "tangled_label_op"."performed_at" is not null))) 157 + ); 158 + --> statement-breakpoint 159 + CREATE TABLE "tangled_pipeline" ( 160 + "did" text NOT NULL, 161 + "rev" text NOT NULL, 162 + "rkey" text NOT NULL, 163 + "cid" text, 164 + "deleted" boolean NOT NULL, 165 + "trigger_metadata_kind" "tangled_pipeline_trigger_metadata_kind", 166 + "trigger_metadata_repo_knot" text, 167 + "trigger_metadata_repo_did" text, 168 + "trigger_metadata_repo_repo_did" text, 169 + "trigger_metadata_repo_repo" text, 170 + "trigger_metadata_repo_default_branch" text, 171 + "trigger_metadata_push_ref" text, 172 + "trigger_metadata_push_new_sha" text, 173 + "trigger_metadata_push_old_sha" text, 174 + "trigger_metadata_pull_source_branch" text, 175 + "trigger_metadata_pull_target_branch" text, 176 + "trigger_metadata_pull_source_sha" text, 177 + "trigger_metadata_pull_action" text, 178 + "trigger_metadata_manual" jsonb, 179 + "workflows" jsonb, 180 + CONSTRAINT "tangled_pipeline_did_rkey_pk" PRIMARY KEY("did","rkey"), 181 + CONSTRAINT "tangled_pipeline_cid_only_null_if_deleted" CHECK (("tangled_pipeline"."cid" is not null or "tangled_pipeline"."deleted" = true)), 182 + CONSTRAINT "tangled_pipeline_non_null_fields" CHECK (("tangled_pipeline"."deleted" = true or ("tangled_pipeline"."trigger_metadata_kind" is not null and "tangled_pipeline"."trigger_metadata_repo_knot" is not null and "tangled_pipeline"."trigger_metadata_repo_did" is not null and "tangled_pipeline"."trigger_metadata_repo_default_branch" is not null and "tangled_pipeline"."workflows" is not null))) 183 + ); 184 + --> statement-breakpoint 185 + CREATE TABLE "tangled_pipeline_status" ( 186 + "did" text NOT NULL, 187 + "rev" text NOT NULL, 188 + "rkey" text NOT NULL, 189 + "cid" text, 190 + "deleted" boolean NOT NULL, 191 + "pipeline" text, 192 + "workflow" text, 193 + "status" "tangled_pipeline_status_status", 194 + "created_at" timestamp with time zone, 195 + "error" text, 196 + "exit_code" integer, 197 + CONSTRAINT "tangled_pipeline_status_did_rkey_pk" PRIMARY KEY("did","rkey"), 198 + CONSTRAINT "tangled_pipeline_status_cid_only_null_if_deleted" CHECK (("tangled_pipeline_status"."cid" is not null or "tangled_pipeline_status"."deleted" = true)), 199 + CONSTRAINT "tangled_pipeline_status_non_null_fields" CHECK (("tangled_pipeline_status"."deleted" = true or ("tangled_pipeline_status"."pipeline" is not null and "tangled_pipeline_status"."workflow" is not null and "tangled_pipeline_status"."status" is not null and "tangled_pipeline_status"."created_at" is not null))) 200 + ); 201 + --> statement-breakpoint 202 + CREATE TABLE "tangled_public_key" ( 203 + "did" text NOT NULL, 204 + "rev" text NOT NULL, 205 + "rkey" text NOT NULL, 206 + "cid" text, 207 + "deleted" boolean NOT NULL, 208 + "key" text, 209 + "name" text, 210 + "created_at" timestamp with time zone, 211 + CONSTRAINT "tangled_public_key_did_rkey_pk" PRIMARY KEY("did","rkey"), 212 + CONSTRAINT "tangled_public_key_cid_only_null_if_deleted" CHECK (("tangled_public_key"."cid" is not null or "tangled_public_key"."deleted" = true)), 213 + CONSTRAINT "tangled_public_key_non_null_fields" CHECK (("tangled_public_key"."deleted" = true or ("tangled_public_key"."key" is not null and "tangled_public_key"."name" is not null and "tangled_public_key"."created_at" is not null))) 214 + ); 215 + --> statement-breakpoint 216 + CREATE TABLE "tangled_pull" ( 217 + "did" text NOT NULL, 218 + "rev" text NOT NULL, 219 + "rkey" text NOT NULL, 220 + "cid" text, 221 + "deleted" boolean NOT NULL, 222 + "title" text, 223 + "body" text, 224 + "rounds" jsonb, 225 + "source_branch" text, 226 + "source_repo" text, 227 + "source_repo_did" text, 228 + "target_branch" text, 229 + "target_repo" text, 230 + "target_repo_did" text, 231 + "created_at" timestamp with time zone, 232 + "mentions" text[], 233 + "references" text[], 234 + "dependent_on" text, 235 + CONSTRAINT "tangled_pull_did_rkey_pk" PRIMARY KEY("did","rkey"), 236 + CONSTRAINT "tangled_pull_cid_only_null_if_deleted" CHECK (("tangled_pull"."cid" is not null or "tangled_pull"."deleted" = true)), 237 + CONSTRAINT "tangled_pull_non_null_fields" CHECK (("tangled_pull"."deleted" = true or ("tangled_pull"."target_branch" is not null and "tangled_pull"."title" is not null and "tangled_pull"."created_at" is not null and "tangled_pull"."rounds" is not null))) 238 + ); 239 + --> statement-breakpoint 240 + CREATE TABLE "tangled_pull_comment" ( 241 + "did" text NOT NULL, 242 + "rev" text NOT NULL, 243 + "rkey" text NOT NULL, 244 + "cid" text, 245 + "deleted" boolean NOT NULL, 246 + "pull" text, 247 + "body" text, 248 + "created_at" timestamp with time zone, 249 + "mentions" text[], 250 + "references" text[], 251 + CONSTRAINT "tangled_pull_comment_did_rkey_pk" PRIMARY KEY("did","rkey"), 252 + CONSTRAINT "tangled_pull_comment_cid_only_null_if_deleted" CHECK (("tangled_pull_comment"."cid" is not null or "tangled_pull_comment"."deleted" = true)), 253 + CONSTRAINT "tangled_pull_comment_non_null_fields" CHECK (("tangled_pull_comment"."deleted" = true or ("tangled_pull_comment"."pull" is not null and "tangled_pull_comment"."body" is not null and "tangled_pull_comment"."created_at" is not null))) 254 + ); 255 + --> statement-breakpoint 256 + CREATE TABLE "tangled_pull_status" ( 257 + "did" text NOT NULL, 258 + "rev" text NOT NULL, 259 + "rkey" text NOT NULL, 260 + "cid" text, 261 + "deleted" boolean NOT NULL, 262 + "pull" text, 263 + "status" text, 264 + CONSTRAINT "tangled_pull_status_did_rkey_pk" PRIMARY KEY("did","rkey"), 265 + CONSTRAINT "tangled_pull_status_cid_only_null_if_deleted" CHECK (("tangled_pull_status"."cid" is not null or "tangled_pull_status"."deleted" = true)), 266 + CONSTRAINT "tangled_pull_status_non_null_fields" CHECK (("tangled_pull_status"."deleted" = true or ("tangled_pull_status"."pull" is not null and "tangled_pull_status"."status" is not null))) 267 + ); 268 + --> statement-breakpoint 269 + CREATE TABLE "tangled_reaction" ( 270 + "did" text NOT NULL, 271 + "rev" text NOT NULL, 272 + "rkey" text NOT NULL, 273 + "cid" text, 274 + "deleted" boolean NOT NULL, 275 + "subject" text, 276 + "reaction" text, 277 + "created_at" timestamp with time zone, 278 + CONSTRAINT "tangled_reaction_did_rkey_pk" PRIMARY KEY("did","rkey"), 279 + CONSTRAINT "tangled_reaction_cid_only_null_if_deleted" CHECK (("tangled_reaction"."cid" is not null or "tangled_reaction"."deleted" = true)), 280 + CONSTRAINT "tangled_reaction_non_null_fields" CHECK (("tangled_reaction"."deleted" = true or ("tangled_reaction"."subject" is not null and "tangled_reaction"."reaction" is not null and "tangled_reaction"."created_at" is not null))) 281 + ); 282 + --> statement-breakpoint 283 + CREATE TABLE "tangled_ref_update" ( 284 + "did" text NOT NULL, 285 + "rev" text NOT NULL, 286 + "rkey" text NOT NULL, 287 + "cid" text, 288 + "deleted" boolean NOT NULL, 289 + "ref" text, 290 + "committer_did" text, 291 + "owner_did" text, 292 + "repo_did" text, 293 + "repo_name" text, 294 + "old_sha" text, 295 + "new_sha" text, 296 + "meta_is_default_ref" boolean, 297 + "meta_lang_breakdown" jsonb, 298 + "meta_commit_count" jsonb, 299 + CONSTRAINT "tangled_ref_update_did_rkey_pk" PRIMARY KEY("did","rkey"), 300 + CONSTRAINT "tangled_ref_update_cid_only_null_if_deleted" CHECK (("tangled_ref_update"."cid" is not null or "tangled_ref_update"."deleted" = true)), 301 + CONSTRAINT "tangled_ref_update_non_null_fields" CHECK (("tangled_ref_update"."deleted" = true or ("tangled_ref_update"."ref" is not null and "tangled_ref_update"."committer_did" is not null and "tangled_ref_update"."repo_name" is not null and "tangled_ref_update"."old_sha" is not null and "tangled_ref_update"."new_sha" is not null and "tangled_ref_update"."meta_is_default_ref" is not null and "tangled_ref_update"."meta_commit_count" is not null))) 302 + ); 303 + --> statement-breakpoint 304 + CREATE TABLE "tangled_spindle" ( 305 + "did" text NOT NULL, 306 + "rev" text NOT NULL, 307 + "rkey" text NOT NULL, 308 + "cid" text, 309 + "deleted" boolean NOT NULL, 310 + "created_at" timestamp with time zone, 311 + CONSTRAINT "tangled_spindle_did_rkey_pk" PRIMARY KEY("did","rkey"), 312 + CONSTRAINT "tangled_spindle_cid_only_null_if_deleted" CHECK (("tangled_spindle"."cid" is not null or "tangled_spindle"."deleted" = true)), 313 + CONSTRAINT "tangled_spindle_non_null_fields" CHECK (("tangled_spindle"."deleted" = true or "tangled_spindle"."created_at" is not null)) 314 + ); 315 + --> statement-breakpoint 316 + CREATE TABLE "tangled_spindle_member" ( 317 + "did" text NOT NULL, 318 + "rev" text NOT NULL, 319 + "rkey" text NOT NULL, 320 + "cid" text, 321 + "deleted" boolean NOT NULL, 322 + "subject" text, 323 + "instance" text, 324 + "created_at" timestamp with time zone, 325 + CONSTRAINT "tangled_spindle_member_did_rkey_pk" PRIMARY KEY("did","rkey"), 326 + CONSTRAINT "tangled_spindle_member_cid_only_null_if_deleted" CHECK (("tangled_spindle_member"."cid" is not null or "tangled_spindle_member"."deleted" = true)), 327 + CONSTRAINT "tangled_spindle_member_non_null_fields" CHECK (("tangled_spindle_member"."deleted" = true or ("tangled_spindle_member"."subject" is not null and "tangled_spindle_member"."instance" is not null and "tangled_spindle_member"."created_at" is not null))) 328 + ); 329 + --> statement-breakpoint 330 + CREATE TABLE "tangled_star" ( 331 + "did" text NOT NULL, 332 + "rev" text NOT NULL, 333 + "rkey" text NOT NULL, 334 + "cid" text, 335 + "deleted" boolean NOT NULL, 336 + "subject" text, 337 + "subject_did" text, 338 + "created_at" timestamp with time zone, 339 + CONSTRAINT "tangled_star_did_rkey_pk" PRIMARY KEY("did","rkey"), 340 + CONSTRAINT "tangled_star_cid_only_null_if_deleted" CHECK (("tangled_star"."cid" is not null or "tangled_star"."deleted" = true)), 341 + CONSTRAINT "tangled_star_non_null_fields" CHECK (("tangled_star"."deleted" = true or "tangled_star"."created_at" is not null)) 342 + ); 343 + --> statement-breakpoint 344 + CREATE TABLE "tangled_string" ( 345 + "did" text NOT NULL, 346 + "rev" text NOT NULL, 347 + "rkey" text NOT NULL, 348 + "cid" text, 349 + "deleted" boolean NOT NULL, 350 + "filename" text, 351 + "description" text, 352 + "created_at" timestamp with time zone, 353 + "contents" text, 354 + CONSTRAINT "tangled_string_did_rkey_pk" PRIMARY KEY("did","rkey"), 355 + CONSTRAINT "tangled_string_cid_only_null_if_deleted" CHECK (("tangled_string"."cid" is not null or "tangled_string"."deleted" = true)), 356 + CONSTRAINT "tangled_string_non_null_fields" CHECK (("tangled_string"."deleted" = true or ("tangled_string"."filename" is not null and "tangled_string"."description" is not null and "tangled_string"."created_at" is not null and "tangled_string"."contents" is not null))) 357 + ); 358 + --> statement-breakpoint 359 + CREATE TABLE "tangled_vouch" ( 360 + "did" text NOT NULL, 361 + "rev" text NOT NULL, 362 + "rkey" text NOT NULL, 363 + "cid" text, 364 + "deleted" boolean NOT NULL, 365 + "kind" "tangled_vouch_kind", 366 + "reason" text, 367 + "created_at" timestamp with time zone, 368 + CONSTRAINT "tangled_vouch_did_rkey_pk" PRIMARY KEY("did","rkey"), 369 + CONSTRAINT "tangled_vouch_cid_only_null_if_deleted" CHECK (("tangled_vouch"."cid" is not null or "tangled_vouch"."deleted" = true)), 370 + CONSTRAINT "tangled_vouch_non_null_fields" CHECK (("tangled_vouch"."deleted" = true or ("tangled_vouch"."kind" is not null and "tangled_vouch"."created_at" is not null))) 371 + );
+1
api/src/db/drizzle/meta/0003_snapshot.json
··· 1 + {"id":"ea550240-2125-411e-8852-822e016d5abc","prevId":"6bf06586-128f-4b67-9e6e-5f3ff761c8d3","version":"7","dialect":"postgresql","tables":{"public.raw_records":{"name":"raw_records","schema":"","columns":{"id":{"name":"id","type":"uuidv7","primaryKey":true,"notNull":true},"tap_id":{"name":"tap_id","type":"bigint","primaryKey":false,"notNull":true},"received_at":{"name":"received_at","type":"timestamp with time zone","primaryKey":false,"notNull":true,"default":"now()"},"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"collection":{"name":"collection","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"action":{"name":"action","type":"raw_action","typeSchema":"public","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"record":{"name":"record","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{"raw_records_collection_index":{"name":"raw_records_collection_index","columns":[{"expression":"collection","isExpression":false,"asc":true,"nulls":"last"}],"isUnique":false,"concurrently":false,"method":"btree","with":{}},"raw_records_did_collection_rkey_index":{"name":"raw_records_did_collection_rkey_index","columns":[{"expression":"did","isExpression":false,"asc":true,"nulls":"last"},{"expression":"collection","isExpression":false,"asc":true,"nulls":"last"},{"expression":"rkey","isExpression":false,"asc":true,"nulls":"last"}],"isUnique":false,"concurrently":false,"method":"btree","with":{}}},"foreignKeys":{},"compositePrimaryKeys":{},"uniqueConstraints":{"raw_records_tap_id_unique":{"name":"raw_records_tap_id_unique","nullsNotDistinct":false,"columns":["tap_id"]}},"policies":{},"checkConstraints":{"raw_records_not_null_unless_delete":{"name":"raw_records_not_null_unless_delete","value":"(\"raw_records\".\"action\" = 'delete' or (\"raw_records\".\"cid\" is not null and \"raw_records\".\"record\" is not null))"}},"isRLSEnabled":false},"public.tangled_artifact":{"name":"tangled_artifact","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"repo":{"name":"repo","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"tag":{"name":"tag","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"artifact_ref":{"name":"artifact_ref","type":"text","primaryKey":false,"notNull":false},"artifact_size":{"name":"artifact_size","type":"integer","primaryKey":false,"notNull":false},"artifact_mime_type":{"name":"artifact_mime_type","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_artifact_did_rkey_pk":{"name":"tangled_artifact_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_artifact_cid_only_null_if_deleted":{"name":"tangled_artifact_cid_only_null_if_deleted","value":"(\"tangled_artifact\".\"cid\" is not null or \"tangled_artifact\".\"deleted\" = true)"},"tangled_artifact_non_null_fields":{"name":"tangled_artifact_non_null_fields","value":"(\"tangled_artifact\".\"deleted\" = true or (\"tangled_artifact\".\"name\" is not null and \"tangled_artifact\".\"tag\" is not null and \"tangled_artifact\".\"created_at\" is not null and \"tangled_artifact\".\"artifact_ref\" is not null and \"tangled_artifact\".\"artifact_size\" is not null and \"tangled_artifact\".\"artifact_mime_type\" is not null))"}},"isRLSEnabled":false},"public.tangled_collaborator":{"name":"tangled_collaborator","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"repo":{"name":"repo","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_collaborator_did_rkey_pk":{"name":"tangled_collaborator_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_collaborator_cid_only_null_if_deleted":{"name":"tangled_collaborator_cid_only_null_if_deleted","value":"(\"tangled_collaborator\".\"cid\" is not null or \"tangled_collaborator\".\"deleted\" = true)"},"tangled_collaborator_non_null_fields":{"name":"tangled_collaborator_non_null_fields","value":"(\"tangled_collaborator\".\"deleted\" = true or (\"tangled_collaborator\".\"subject\" is not null and \"tangled_collaborator\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_follow":{"name":"tangled_follow","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_follow_did_rkey_pk":{"name":"tangled_follow_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_follow_cid_only_null_if_deleted":{"name":"tangled_follow_cid_only_null_if_deleted","value":"(\"tangled_follow\".\"cid\" is not null or \"tangled_follow\".\"deleted\" = true)"},"tangled_follow_non_null_fields":{"name":"tangled_follow_non_null_fields","value":"(\"tangled_follow\".\"deleted\" = true or (\"tangled_follow\".\"subject\" is not null and \"tangled_follow\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_issue":{"name":"tangled_issue","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"repo":{"name":"repo","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"title":{"name":"title","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_issue_did_rkey_pk":{"name":"tangled_issue_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_issue_cid_only_null_if_deleted":{"name":"tangled_issue_cid_only_null_if_deleted","value":"(\"tangled_issue\".\"cid\" is not null or \"tangled_issue\".\"deleted\" = true)"},"tangled_issue_non_null_fields":{"name":"tangled_issue_non_null_fields","value":"(\"tangled_issue\".\"deleted\" = true or (\"tangled_issue\".\"title\" is not null and \"tangled_issue\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_issue_comment":{"name":"tangled_issue_comment","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"issue":{"name":"issue","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"reply_to":{"name":"reply_to","type":"text","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_issue_comment_did_rkey_pk":{"name":"tangled_issue_comment_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_issue_comment_cid_only_null_if_deleted":{"name":"tangled_issue_comment_cid_only_null_if_deleted","value":"(\"tangled_issue_comment\".\"cid\" is not null or \"tangled_issue_comment\".\"deleted\" = true)"},"tangled_issue_comment_non_null_fields":{"name":"tangled_issue_comment_non_null_fields","value":"(\"tangled_issue_comment\".\"deleted\" = true or (\"tangled_issue_comment\".\"issue\" is not null and \"tangled_issue_comment\".\"body\" is not null and \"tangled_issue_comment\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_issue_state":{"name":"tangled_issue_state","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"issue":{"name":"issue","type":"text","primaryKey":false,"notNull":false},"state":{"name":"state","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_issue_state_did_rkey_pk":{"name":"tangled_issue_state_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_issue_state_cid_only_null_if_deleted":{"name":"tangled_issue_state_cid_only_null_if_deleted","value":"(\"tangled_issue_state\".\"cid\" is not null or \"tangled_issue_state\".\"deleted\" = true)"},"tangled_issue_state_non_null_fields":{"name":"tangled_issue_state_non_null_fields","value":"(\"tangled_issue_state\".\"deleted\" = true or (\"tangled_issue_state\".\"issue\" is not null and \"tangled_issue_state\".\"state\" is not null))"}},"isRLSEnabled":false},"public.tangled_knot":{"name":"tangled_knot","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_knot_did_rkey_pk":{"name":"tangled_knot_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_knot_cid_only_null_if_deleted":{"name":"tangled_knot_cid_only_null_if_deleted","value":"(\"tangled_knot\".\"cid\" is not null or \"tangled_knot\".\"deleted\" = true)"},"tangled_knot_non_null_fields":{"name":"tangled_knot_non_null_fields","value":"(\"tangled_knot\".\"deleted\" = true or \"tangled_knot\".\"created_at\" is not null)"}},"isRLSEnabled":false},"public.tangled_knot_member":{"name":"tangled_knot_member","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"domain":{"name":"domain","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_knot_member_did_rkey_pk":{"name":"tangled_knot_member_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_knot_member_cid_only_null_if_deleted":{"name":"tangled_knot_member_cid_only_null_if_deleted","value":"(\"tangled_knot_member\".\"cid\" is not null or \"tangled_knot_member\".\"deleted\" = true)"},"tangled_knot_member_non_null_fields":{"name":"tangled_knot_member_non_null_fields","value":"(\"tangled_knot_member\".\"deleted\" = true or (\"tangled_knot_member\".\"subject\" is not null and \"tangled_knot_member\".\"domain\" is not null and \"tangled_knot_member\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_label_definition":{"name":"tangled_label_definition","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"value_type":{"name":"value_type","type":"text","primaryKey":false,"notNull":false},"value_format":{"name":"value_format","type":"text","primaryKey":false,"notNull":false},"value_enum":{"name":"value_enum","type":"text[]","primaryKey":false,"notNull":false},"scope":{"name":"scope","type":"text[]","primaryKey":false,"notNull":false},"color":{"name":"color","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"multiple":{"name":"multiple","type":"boolean","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_label_definition_did_rkey_pk":{"name":"tangled_label_definition_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_label_definition_cid_only_null_if_deleted":{"name":"tangled_label_definition_cid_only_null_if_deleted","value":"(\"tangled_label_definition\".\"cid\" is not null or \"tangled_label_definition\".\"deleted\" = true)"},"tangled_label_definition_non_null_fields":{"name":"tangled_label_definition_non_null_fields","value":"(\"tangled_label_definition\".\"deleted\" = true or (\"tangled_label_definition\".\"name\" is not null and \"tangled_label_definition\".\"value_type\" is not null and \"tangled_label_definition\".\"value_format\" is not null and \"tangled_label_definition\".\"scope\" is not null and \"tangled_label_definition\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_label_op":{"name":"tangled_label_op","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"performed_at":{"name":"performed_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"add":{"name":"add","type":"jsonb","primaryKey":false,"notNull":false},"delete":{"name":"delete","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_label_op_did_rkey_pk":{"name":"tangled_label_op_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_label_op_cid_only_null_if_deleted":{"name":"tangled_label_op_cid_only_null_if_deleted","value":"(\"tangled_label_op\".\"cid\" is not null or \"tangled_label_op\".\"deleted\" = true)"},"tangled_label_op_non_null_fields":{"name":"tangled_label_op_non_null_fields","value":"(\"tangled_label_op\".\"deleted\" = true or (\"tangled_label_op\".\"subject\" is not null and \"tangled_label_op\".\"add\" is not null and \"tangled_label_op\".\"delete\" is not null and \"tangled_label_op\".\"performed_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_pipeline":{"name":"tangled_pipeline","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"trigger_metadata_kind":{"name":"trigger_metadata_kind","type":"tangled_pipeline_trigger_metadata_kind","typeSchema":"public","primaryKey":false,"notNull":false},"trigger_metadata_repo_knot":{"name":"trigger_metadata_repo_knot","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_did":{"name":"trigger_metadata_repo_did","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_repo_did":{"name":"trigger_metadata_repo_repo_did","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_repo":{"name":"trigger_metadata_repo_repo","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_default_branch":{"name":"trigger_metadata_repo_default_branch","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_push_ref":{"name":"trigger_metadata_push_ref","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_push_new_sha":{"name":"trigger_metadata_push_new_sha","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_push_old_sha":{"name":"trigger_metadata_push_old_sha","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_source_branch":{"name":"trigger_metadata_pull_source_branch","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_target_branch":{"name":"trigger_metadata_pull_target_branch","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_source_sha":{"name":"trigger_metadata_pull_source_sha","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_action":{"name":"trigger_metadata_pull_action","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_manual":{"name":"trigger_metadata_manual","type":"jsonb","primaryKey":false,"notNull":false},"workflows":{"name":"workflows","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pipeline_did_rkey_pk":{"name":"tangled_pipeline_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pipeline_cid_only_null_if_deleted":{"name":"tangled_pipeline_cid_only_null_if_deleted","value":"(\"tangled_pipeline\".\"cid\" is not null or \"tangled_pipeline\".\"deleted\" = true)"},"tangled_pipeline_non_null_fields":{"name":"tangled_pipeline_non_null_fields","value":"(\"tangled_pipeline\".\"deleted\" = true or (\"tangled_pipeline\".\"trigger_metadata_kind\" is not null and \"tangled_pipeline\".\"trigger_metadata_repo_knot\" is not null and \"tangled_pipeline\".\"trigger_metadata_repo_did\" is not null and \"tangled_pipeline\".\"trigger_metadata_repo_default_branch\" is not null and \"tangled_pipeline\".\"workflows\" is not null))"}},"isRLSEnabled":false},"public.tangled_pipeline_status":{"name":"tangled_pipeline_status","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"pipeline":{"name":"pipeline","type":"text","primaryKey":false,"notNull":false},"workflow":{"name":"workflow","type":"text","primaryKey":false,"notNull":false},"status":{"name":"status","type":"tangled_pipeline_status_status","typeSchema":"public","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"error":{"name":"error","type":"text","primaryKey":false,"notNull":false},"exit_code":{"name":"exit_code","type":"integer","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pipeline_status_did_rkey_pk":{"name":"tangled_pipeline_status_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pipeline_status_cid_only_null_if_deleted":{"name":"tangled_pipeline_status_cid_only_null_if_deleted","value":"(\"tangled_pipeline_status\".\"cid\" is not null or \"tangled_pipeline_status\".\"deleted\" = true)"},"tangled_pipeline_status_non_null_fields":{"name":"tangled_pipeline_status_non_null_fields","value":"(\"tangled_pipeline_status\".\"deleted\" = true or (\"tangled_pipeline_status\".\"pipeline\" is not null and \"tangled_pipeline_status\".\"workflow\" is not null and \"tangled_pipeline_status\".\"status\" is not null and \"tangled_pipeline_status\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_profile":{"name":"tangled_profile","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":true,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"avatar":{"name":"avatar","type":"text","primaryKey":false,"notNull":false},"description":{"name":"description","type":"text","primaryKey":false,"notNull":false},"links":{"name":"links","type":"text[]","primaryKey":false,"notNull":false},"stats":{"name":"stats","type":"text[]","primaryKey":false,"notNull":false},"bluesky":{"name":"bluesky","type":"boolean","primaryKey":false,"notNull":false},"location":{"name":"location","type":"text","primaryKey":false,"notNull":false},"pinned_repositories":{"name":"pinned_repositories","type":"text[]","primaryKey":false,"notNull":false},"pronouns":{"name":"pronouns","type":"text","primaryKey":false,"notNull":false},"preferred_handle":{"name":"preferred_handle","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_profile_cid_only_null_if_deleted":{"name":"tangled_profile_cid_only_null_if_deleted","value":"(\"tangled_profile\".\"cid\" is not null or \"tangled_profile\".\"deleted\" = true)"},"tangled_profile_non_null_fields":{"name":"tangled_profile_non_null_fields","value":"(\"tangled_profile\".\"deleted\" = true or \"tangled_profile\".\"bluesky\" is not null)"}},"isRLSEnabled":false},"public.tangled_public_key":{"name":"tangled_public_key","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"key":{"name":"key","type":"text","primaryKey":false,"notNull":false},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_public_key_did_rkey_pk":{"name":"tangled_public_key_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_public_key_cid_only_null_if_deleted":{"name":"tangled_public_key_cid_only_null_if_deleted","value":"(\"tangled_public_key\".\"cid\" is not null or \"tangled_public_key\".\"deleted\" = true)"},"tangled_public_key_non_null_fields":{"name":"tangled_public_key_non_null_fields","value":"(\"tangled_public_key\".\"deleted\" = true or (\"tangled_public_key\".\"key\" is not null and \"tangled_public_key\".\"name\" is not null and \"tangled_public_key\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_pull":{"name":"tangled_pull","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"title":{"name":"title","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"rounds":{"name":"rounds","type":"jsonb","primaryKey":false,"notNull":false},"source_branch":{"name":"source_branch","type":"text","primaryKey":false,"notNull":false},"source_repo":{"name":"source_repo","type":"text","primaryKey":false,"notNull":false},"source_repo_did":{"name":"source_repo_did","type":"text","primaryKey":false,"notNull":false},"target_branch":{"name":"target_branch","type":"text","primaryKey":false,"notNull":false},"target_repo":{"name":"target_repo","type":"text","primaryKey":false,"notNull":false},"target_repo_did":{"name":"target_repo_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false},"dependent_on":{"name":"dependent_on","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pull_did_rkey_pk":{"name":"tangled_pull_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pull_cid_only_null_if_deleted":{"name":"tangled_pull_cid_only_null_if_deleted","value":"(\"tangled_pull\".\"cid\" is not null or \"tangled_pull\".\"deleted\" = true)"},"tangled_pull_non_null_fields":{"name":"tangled_pull_non_null_fields","value":"(\"tangled_pull\".\"deleted\" = true or (\"tangled_pull\".\"target_branch\" is not null and \"tangled_pull\".\"title\" is not null and \"tangled_pull\".\"created_at\" is not null and \"tangled_pull\".\"rounds\" is not null))"}},"isRLSEnabled":false},"public.tangled_pull_comment":{"name":"tangled_pull_comment","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"pull":{"name":"pull","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pull_comment_did_rkey_pk":{"name":"tangled_pull_comment_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pull_comment_cid_only_null_if_deleted":{"name":"tangled_pull_comment_cid_only_null_if_deleted","value":"(\"tangled_pull_comment\".\"cid\" is not null or \"tangled_pull_comment\".\"deleted\" = true)"},"tangled_pull_comment_non_null_fields":{"name":"tangled_pull_comment_non_null_fields","value":"(\"tangled_pull_comment\".\"deleted\" = true or (\"tangled_pull_comment\".\"pull\" is not null and \"tangled_pull_comment\".\"body\" is not null and \"tangled_pull_comment\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_pull_status":{"name":"tangled_pull_status","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"pull":{"name":"pull","type":"text","primaryKey":false,"notNull":false},"status":{"name":"status","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pull_status_did_rkey_pk":{"name":"tangled_pull_status_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pull_status_cid_only_null_if_deleted":{"name":"tangled_pull_status_cid_only_null_if_deleted","value":"(\"tangled_pull_status\".\"cid\" is not null or \"tangled_pull_status\".\"deleted\" = true)"},"tangled_pull_status_non_null_fields":{"name":"tangled_pull_status_non_null_fields","value":"(\"tangled_pull_status\".\"deleted\" = true or (\"tangled_pull_status\".\"pull\" is not null and \"tangled_pull_status\".\"status\" is not null))"}},"isRLSEnabled":false},"public.tangled_reaction":{"name":"tangled_reaction","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"reaction":{"name":"reaction","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_reaction_did_rkey_pk":{"name":"tangled_reaction_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_reaction_cid_only_null_if_deleted":{"name":"tangled_reaction_cid_only_null_if_deleted","value":"(\"tangled_reaction\".\"cid\" is not null or \"tangled_reaction\".\"deleted\" = true)"},"tangled_reaction_non_null_fields":{"name":"tangled_reaction_non_null_fields","value":"(\"tangled_reaction\".\"deleted\" = true or (\"tangled_reaction\".\"subject\" is not null and \"tangled_reaction\".\"reaction\" is not null and \"tangled_reaction\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_ref_update":{"name":"tangled_ref_update","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"ref":{"name":"ref","type":"text","primaryKey":false,"notNull":false},"committer_did":{"name":"committer_did","type":"text","primaryKey":false,"notNull":false},"owner_did":{"name":"owner_did","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"repo_name":{"name":"repo_name","type":"text","primaryKey":false,"notNull":false},"old_sha":{"name":"old_sha","type":"text","primaryKey":false,"notNull":false},"new_sha":{"name":"new_sha","type":"text","primaryKey":false,"notNull":false},"meta_is_default_ref":{"name":"meta_is_default_ref","type":"boolean","primaryKey":false,"notNull":false},"meta_lang_breakdown":{"name":"meta_lang_breakdown","type":"jsonb","primaryKey":false,"notNull":false},"meta_commit_count":{"name":"meta_commit_count","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_ref_update_did_rkey_pk":{"name":"tangled_ref_update_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_ref_update_cid_only_null_if_deleted":{"name":"tangled_ref_update_cid_only_null_if_deleted","value":"(\"tangled_ref_update\".\"cid\" is not null or \"tangled_ref_update\".\"deleted\" = true)"},"tangled_ref_update_non_null_fields":{"name":"tangled_ref_update_non_null_fields","value":"(\"tangled_ref_update\".\"deleted\" = true or (\"tangled_ref_update\".\"ref\" is not null and \"tangled_ref_update\".\"committer_did\" is not null and \"tangled_ref_update\".\"repo_name\" is not null and \"tangled_ref_update\".\"old_sha\" is not null and \"tangled_ref_update\".\"new_sha\" is not null and \"tangled_ref_update\".\"meta_is_default_ref\" is not null and \"tangled_ref_update\".\"meta_commit_count\" is not null))"}},"isRLSEnabled":false},"public.tangled_repo":{"name":"tangled_repo","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"knot":{"name":"knot","type":"text","primaryKey":false,"notNull":false},"spindle":{"name":"spindle","type":"text","primaryKey":false,"notNull":false},"description":{"name":"description","type":"text","primaryKey":false,"notNull":false},"website":{"name":"website","type":"text","primaryKey":false,"notNull":false},"topics":{"name":"topics","type":"text[]","primaryKey":false,"notNull":false},"source":{"name":"source","type":"text","primaryKey":false,"notNull":false},"labels":{"name":"labels","type":"text[]","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_repo_did_rkey_pk":{"name":"tangled_repo_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_repo_cid_only_null_if_deleted":{"name":"tangled_repo_cid_only_null_if_deleted","value":"(\"tangled_repo\".\"cid\" is not null or \"tangled_repo\".\"deleted\" = true)"},"tangled_repo_non_null_fields":{"name":"tangled_repo_non_null_fields","value":"(\"tangled_repo\".\"deleted\" = true or (\"tangled_repo\".\"name\" is not null and \"tangled_repo\".\"knot\" is not null and \"tangled_repo\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_spindle":{"name":"tangled_spindle","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_spindle_did_rkey_pk":{"name":"tangled_spindle_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_spindle_cid_only_null_if_deleted":{"name":"tangled_spindle_cid_only_null_if_deleted","value":"(\"tangled_spindle\".\"cid\" is not null or \"tangled_spindle\".\"deleted\" = true)"},"tangled_spindle_non_null_fields":{"name":"tangled_spindle_non_null_fields","value":"(\"tangled_spindle\".\"deleted\" = true or \"tangled_spindle\".\"created_at\" is not null)"}},"isRLSEnabled":false},"public.tangled_spindle_member":{"name":"tangled_spindle_member","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"instance":{"name":"instance","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_spindle_member_did_rkey_pk":{"name":"tangled_spindle_member_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_spindle_member_cid_only_null_if_deleted":{"name":"tangled_spindle_member_cid_only_null_if_deleted","value":"(\"tangled_spindle_member\".\"cid\" is not null or \"tangled_spindle_member\".\"deleted\" = true)"},"tangled_spindle_member_non_null_fields":{"name":"tangled_spindle_member_non_null_fields","value":"(\"tangled_spindle_member\".\"deleted\" = true or (\"tangled_spindle_member\".\"subject\" is not null and \"tangled_spindle_member\".\"instance\" is not null and \"tangled_spindle_member\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_star":{"name":"tangled_star","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"subject_did":{"name":"subject_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_star_did_rkey_pk":{"name":"tangled_star_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_star_cid_only_null_if_deleted":{"name":"tangled_star_cid_only_null_if_deleted","value":"(\"tangled_star\".\"cid\" is not null or \"tangled_star\".\"deleted\" = true)"},"tangled_star_non_null_fields":{"name":"tangled_star_non_null_fields","value":"(\"tangled_star\".\"deleted\" = true or \"tangled_star\".\"created_at\" is not null)"}},"isRLSEnabled":false},"public.tangled_string":{"name":"tangled_string","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"filename":{"name":"filename","type":"text","primaryKey":false,"notNull":false},"description":{"name":"description","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"contents":{"name":"contents","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_string_did_rkey_pk":{"name":"tangled_string_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_string_cid_only_null_if_deleted":{"name":"tangled_string_cid_only_null_if_deleted","value":"(\"tangled_string\".\"cid\" is not null or \"tangled_string\".\"deleted\" = true)"},"tangled_string_non_null_fields":{"name":"tangled_string_non_null_fields","value":"(\"tangled_string\".\"deleted\" = true or (\"tangled_string\".\"filename\" is not null and \"tangled_string\".\"description\" is not null and \"tangled_string\".\"created_at\" is not null and \"tangled_string\".\"contents\" is not null))"}},"isRLSEnabled":false},"public.tangled_vouch":{"name":"tangled_vouch","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"kind":{"name":"kind","type":"tangled_vouch_kind","typeSchema":"public","primaryKey":false,"notNull":false},"reason":{"name":"reason","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_vouch_did_rkey_pk":{"name":"tangled_vouch_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_vouch_cid_only_null_if_deleted":{"name":"tangled_vouch_cid_only_null_if_deleted","value":"(\"tangled_vouch\".\"cid\" is not null or \"tangled_vouch\".\"deleted\" = true)"},"tangled_vouch_non_null_fields":{"name":"tangled_vouch_non_null_fields","value":"(\"tangled_vouch\".\"deleted\" = true or (\"tangled_vouch\".\"kind\" is not null and \"tangled_vouch\".\"created_at\" is not null))"}},"isRLSEnabled":false}},"enums":{"public.raw_action":{"name":"raw_action","schema":"public","values":["create","update","delete"]},"public.tangled_pipeline_status_status":{"name":"tangled_pipeline_status_status","schema":"public","values":["pending","running","failed","timeout","cancelled","success"]},"public.tangled_pipeline_trigger_metadata_kind":{"name":"tangled_pipeline_trigger_metadata_kind","schema":"public","values":["push","pull_request","manual"]},"public.tangled_vouch_kind":{"name":"tangled_vouch_kind","schema":"public","values":["vouch","denounce"]}},"schemas":{},"sequences":{},"roles":{},"policies":{},"views":{},"_meta":{"columns":{},"schemas":{},"tables":{}}}
+7
api/src/db/drizzle/meta/_journal.json
··· 22 22 "when": 1777821401885, 23 23 "tag": "0002_tangled_repo", 24 24 "breakpoints": true 25 + }, 26 + { 27 + "idx": 3, 28 + "version": "7", 29 + "when": 1777827302131, 30 + "tag": "0003_add_level_one_tables", 31 + "breakpoints": true 25 32 } 26 33 ] 27 34 }
+642 -1
api/src/db/tables/tangled.ts
··· 1 1 import { and, eq, isNotNull, or, sql } from "drizzle-orm"; 2 - import { boolean, check, pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core"; 2 + import { boolean, check, integer, jsonb, pgEnum, pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core"; 3 3 4 4 export const tangledProfile = pgTable("tangled_profile", { 5 5 did: text().primaryKey(), ··· 29 29 ) 30 30 ]); 31 31 32 + export const tangledReaction = pgTable("tangled_reaction", { 33 + did: text().notNull(), 34 + rev: text().notNull(), 35 + rkey: text().notNull(), 36 + cid: text(), 37 + deleted: boolean().notNull(), 38 + 39 + subject: text(), 40 + reaction: text(), 41 + createdAt: timestamp({ withTimezone: true }), 42 + }, (table) => [ 43 + primaryKey({ columns: [table.did, table.rkey] }), 44 + check("tangled_reaction_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 45 + check("tangled_reaction_non_null_fields", 46 + or( 47 + eq(table.deleted, sql`true`), 48 + and( 49 + isNotNull(table.subject), 50 + isNotNull(table.reaction), 51 + isNotNull(table.createdAt), 52 + ) 53 + )! 54 + ) 55 + ]); 56 + 57 + export const tangledStar = pgTable("tangled_star", { 58 + did: text().notNull(), 59 + rev: text().notNull(), 60 + rkey: text().notNull(), 61 + cid: text(), 62 + deleted: boolean().notNull(), 63 + 64 + subject: text(), 65 + subjectDid: text(), 66 + createdAt: timestamp({ withTimezone: true }), 67 + }, (table) => [ 68 + primaryKey({ columns: [table.did, table.rkey] }), 69 + check("tangled_star_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 70 + check("tangled_star_non_null_fields", 71 + or( 72 + eq(table.deleted, sql`true`), 73 + and( 74 + isNotNull(table.createdAt), 75 + ) 76 + )! 77 + ) 78 + ]); 79 + 80 + export const tangledRefUpdate = pgTable("tangled_ref_update", { 81 + did: text().notNull(), 82 + rev: text().notNull(), 83 + rkey: text().notNull(), 84 + cid: text(), 85 + deleted: boolean().notNull(), 86 + 87 + ref: text(), 88 + committerDid: text(), 89 + ownerDid: text(), 90 + repoDid: text(), 91 + repoName: text(), 92 + oldSha: text(), 93 + newSha: text(), 94 + metaIsDefaultRef: boolean(), 95 + metaLangBreakdown: jsonb(), 96 + metaCommitCount: jsonb(), 97 + }, (table) => [ 98 + primaryKey({ columns: [table.did, table.rkey] }), 99 + check("tangled_ref_update_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 100 + check("tangled_ref_update_non_null_fields", 101 + or( 102 + eq(table.deleted, sql`true`), 103 + and( 104 + isNotNull(table.ref), 105 + isNotNull(table.committerDid), 106 + isNotNull(table.repoName), 107 + isNotNull(table.oldSha), 108 + isNotNull(table.newSha), 109 + isNotNull(table.metaIsDefaultRef), 110 + isNotNull(table.metaCommitCount), 111 + ) 112 + )! 113 + ) 114 + ]); 115 + 116 + export const tangledFollow = pgTable("tangled_follow", { 117 + did: text().notNull(), 118 + rev: text().notNull(), 119 + rkey: text().notNull(), 120 + cid: text(), 121 + deleted: boolean().notNull(), 122 + 123 + subject: text(), 124 + createdAt: timestamp({ withTimezone: true }), 125 + }, (table) => [ 126 + primaryKey({ columns: [table.did, table.rkey] }), 127 + check("tangled_follow_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 128 + check("tangled_follow_non_null_fields", 129 + or( 130 + eq(table.deleted, sql`true`), 131 + and( 132 + isNotNull(table.subject), 133 + isNotNull(table.createdAt), 134 + ) 135 + )! 136 + ) 137 + ]); 138 + 139 + export const tangledVouchKind = pgEnum('tangled_vouch_kind', ["vouch", "denounce"]); 140 + 141 + export const tangledVouch = pgTable("tangled_vouch", { 142 + did: text().notNull(), 143 + rev: text().notNull(), 144 + rkey: text().notNull(), 145 + cid: text(), 146 + deleted: boolean().notNull(), 147 + 148 + kind: tangledVouchKind(), 149 + reason: text(), 150 + createdAt: timestamp({ withTimezone: true }), 151 + }, (table) => [ 152 + primaryKey({ columns: [table.did, table.rkey] }), 153 + check("tangled_vouch_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 154 + check("tangled_vouch_non_null_fields", 155 + or( 156 + eq(table.deleted, sql`true`), 157 + and( 158 + isNotNull(table.kind), 159 + isNotNull(table.createdAt), 160 + ) 161 + )! 162 + ) 163 + ]); 164 + 165 + export const tangledIssueComment = pgTable("tangled_issue_comment", { 166 + did: text().notNull(), 167 + rev: text().notNull(), 168 + rkey: text().notNull(), 169 + cid: text(), 170 + deleted: boolean().notNull(), 171 + 172 + issue: text(), 173 + body: text(), 174 + createdAt: timestamp({ withTimezone: true }), 175 + replyTo: text(), 176 + mentions: text().array(), 177 + references: text().array(), 178 + }, (table) => [ 179 + primaryKey({ columns: [table.did, table.rkey] }), 180 + check("tangled_issue_comment_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 181 + check("tangled_issue_comment_non_null_fields", 182 + or( 183 + eq(table.deleted, sql`true`), 184 + and( 185 + isNotNull(table.issue), 186 + isNotNull(table.body), 187 + isNotNull(table.createdAt), 188 + ) 189 + )! 190 + ) 191 + ]); 192 + 193 + export const tangledIssue = pgTable("tangled_issue", { 194 + did: text().notNull(), 195 + rev: text().notNull(), 196 + rkey: text().notNull(), 197 + cid: text(), 198 + deleted: boolean().notNull(), 199 + 200 + repo: text(), 201 + repoDid: text(), 202 + title: text(), 203 + body: text(), 204 + createdAt: timestamp({ withTimezone: true }), 205 + mentions: text().array(), 206 + references: text().array(), 207 + }, (table) => [ 208 + primaryKey({ columns: [table.did, table.rkey] }), 209 + check("tangled_issue_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 210 + check("tangled_issue_non_null_fields", 211 + or( 212 + eq(table.deleted, sql`true`), 213 + and( 214 + isNotNull(table.title), 215 + isNotNull(table.createdAt), 216 + ) 217 + )! 218 + ) 219 + ]); 220 + 221 + export const tangledIssueState = pgTable("tangled_issue_state", { 222 + did: text().notNull(), 223 + rev: text().notNull(), 224 + rkey: text().notNull(), 225 + cid: text(), 226 + deleted: boolean().notNull(), 227 + 228 + issue: text(), 229 + state: text(), 230 + }, (table) => [ 231 + primaryKey({ columns: [table.did, table.rkey] }), 232 + check("tangled_issue_state_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 233 + check("tangled_issue_state_non_null_fields", 234 + or( 235 + eq(table.deleted, sql`true`), 236 + and( 237 + isNotNull(table.issue), 238 + isNotNull(table.state), 239 + ) 240 + )! 241 + ) 242 + ]); 243 + 244 + export const tangledKnot = pgTable("tangled_knot", { 245 + did: text().notNull(), 246 + rev: text().notNull(), 247 + rkey: text().notNull(), 248 + cid: text(), 249 + deleted: boolean().notNull(), 250 + 251 + createdAt: timestamp({ withTimezone: true }), 252 + }, (table) => [ 253 + primaryKey({ columns: [table.did, table.rkey] }), 254 + check("tangled_knot_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 255 + check("tangled_knot_non_null_fields", 256 + or( 257 + eq(table.deleted, sql`true`), 258 + and( 259 + isNotNull(table.createdAt), 260 + ) 261 + )! 262 + ) 263 + ]); 264 + 265 + export const tangledKnotMember = pgTable("tangled_knot_member", { 266 + did: text().notNull(), 267 + rev: text().notNull(), 268 + rkey: text().notNull(), 269 + cid: text(), 270 + deleted: boolean().notNull(), 271 + 272 + subject: text(), 273 + domain: text(), 274 + createdAt: timestamp({ withTimezone: true }), 275 + }, (table) => [ 276 + primaryKey({ columns: [table.did, table.rkey] }), 277 + check("tangled_knot_member_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 278 + check("tangled_knot_member_non_null_fields", 279 + or( 280 + eq(table.deleted, sql`true`), 281 + and( 282 + isNotNull(table.subject), 283 + isNotNull(table.domain), 284 + isNotNull(table.createdAt), 285 + ) 286 + )! 287 + ) 288 + ]); 289 + 290 + export const tangledLabelDefinition = pgTable("tangled_label_definition", { 291 + did: text().notNull(), 292 + rev: text().notNull(), 293 + rkey: text().notNull(), 294 + cid: text(), 295 + deleted: boolean().notNull(), 296 + 297 + name: text(), 298 + valueType: text(), 299 + valueFormat: text(), 300 + valueEnum: text().array(), 301 + scope: text().array(), 302 + color: text(), 303 + createdAt: timestamp({ withTimezone: true }), 304 + multiple: boolean(), 305 + 306 + }, (table) => [ 307 + primaryKey({ columns: [table.did, table.rkey] }), 308 + check("tangled_label_definition_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 309 + check("tangled_label_definition_non_null_fields", 310 + or( 311 + eq(table.deleted, sql`true`), 312 + and( 313 + isNotNull(table.name), 314 + isNotNull(table.valueType), 315 + isNotNull(table.valueFormat), 316 + isNotNull(table.scope), 317 + isNotNull(table.createdAt), 318 + ) 319 + )! 320 + ) 321 + ]); 322 + 323 + export const tangledLabelOp = pgTable("tangled_label_op", { 324 + did: text().notNull(), 325 + rev: text().notNull(), 326 + rkey: text().notNull(), 327 + cid: text(), 328 + deleted: boolean().notNull(), 329 + 330 + subject: text(), 331 + performedAt: timestamp({ withTimezone: true }), 332 + add: jsonb(), 333 + delete: jsonb(), 334 + }, (table) => [ 335 + primaryKey({ columns: [table.did, table.rkey] }), 336 + check("tangled_label_op_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 337 + check("tangled_label_op_non_null_fields", 338 + or( 339 + eq(table.deleted, sql`true`), 340 + and( 341 + isNotNull(table.subject), 342 + isNotNull(table.add), 343 + isNotNull(table.delete), 344 + isNotNull(table.performedAt), 345 + ) 346 + )! 347 + ) 348 + ]); 349 + 350 + export const tangledPipelineTriggerMetadataKind = pgEnum('tangled_pipeline_trigger_metadata_kind', ["push", "pull_request", "manual"]); 351 + 352 + export const tangledPipeline = pgTable("tangled_pipeline", { 353 + did: text().notNull(), 354 + rev: text().notNull(), 355 + rkey: text().notNull(), 356 + cid: text(), 357 + deleted: boolean().notNull(), 358 + 359 + triggerMetadataKind: tangledPipelineTriggerMetadataKind(), 360 + triggerMetadataRepoKnot: text(), 361 + triggerMetadataRepoDid: text(), 362 + triggerMetadataRepoRepoDid: text(), // I know, confusing 363 + triggerMetadataRepoRepo: text(), // i know, I know, 364 + triggerMetadataRepoDefaultBranch: text(), 365 + triggerMetadataPushRef: text(), 366 + triggerMetadataPushNewSha: text(), 367 + triggerMetadataPushOldSha: text(), 368 + triggerMetadataPullSourceBranch: text(), 369 + triggerMetadataPullTargetBranch: text(), 370 + triggerMetadataPullSourceSha: text(), 371 + triggerMetadataPullAction: text(), 372 + triggerMetadataManual: jsonb(), 373 + 374 + workflows: jsonb(), 375 + }, (table) => [ 376 + primaryKey({ columns: [table.did, table.rkey] }), 377 + check("tangled_pipeline_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 378 + check("tangled_pipeline_non_null_fields", 379 + or( 380 + eq(table.deleted, sql`true`), 381 + and( 382 + isNotNull(table.triggerMetadataKind), 383 + isNotNull(table.triggerMetadataRepoKnot), 384 + isNotNull(table.triggerMetadataRepoDid), 385 + isNotNull(table.triggerMetadataRepoDefaultBranch), 386 + isNotNull(table.workflows), 387 + ) 388 + )! 389 + ) 390 + ]); 391 + 392 + export const tangledPipelineStatusStatus = pgEnum('tangled_pipeline_status_status', [ 393 + "pending", 394 + "running", 395 + "failed", 396 + "timeout", 397 + "cancelled", 398 + "success" 399 + ]); 400 + 401 + export const tangledPipelineStatus = pgTable("tangled_pipeline_status", { 402 + did: text().notNull(), 403 + rev: text().notNull(), 404 + rkey: text().notNull(), 405 + cid: text(), 406 + deleted: boolean().notNull(), 407 + 408 + pipeline: text(), 409 + workflow: text(), 410 + status: tangledPipelineStatusStatus(), 411 + createdAt: timestamp({ withTimezone: true }), 412 + error: text(), 413 + exitCode: integer(), 414 + }, (table) => [ 415 + primaryKey({ columns: [table.did, table.rkey] }), 416 + check("tangled_pipeline_status_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 417 + check("tangled_pipeline_status_non_null_fields", 418 + or( 419 + eq(table.deleted, sql`true`), 420 + and( 421 + isNotNull(table.pipeline), 422 + isNotNull(table.workflow), 423 + isNotNull(table.status), 424 + isNotNull(table.createdAt), 425 + ) 426 + )! 427 + ) 428 + ]); 429 + 430 + export const tangledPublicKey = pgTable("tangled_public_key", { 431 + did: text().notNull(), 432 + rev: text().notNull(), 433 + rkey: text().notNull(), 434 + cid: text(), 435 + deleted: boolean().notNull(), 436 + 437 + key: text(), 438 + name: text(), 439 + createdAt: timestamp({ withTimezone: true }), 440 + }, (table) => [ 441 + primaryKey({ columns: [table.did, table.rkey] }), 442 + check("tangled_public_key_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 443 + check("tangled_public_key_non_null_fields", 444 + or( 445 + eq(table.deleted, sql`true`), 446 + and( 447 + isNotNull(table.key), 448 + isNotNull(table.name), 449 + isNotNull(table.createdAt), 450 + ) 451 + )! 452 + ) 453 + ]); 454 + 455 + export const tangledPullComment = pgTable("tangled_pull_comment", { 456 + did: text().notNull(), 457 + rev: text().notNull(), 458 + rkey: text().notNull(), 459 + cid: text(), 460 + deleted: boolean().notNull(), 461 + 462 + pull: text(), 463 + body: text(), 464 + createdAt: timestamp({ withTimezone: true }), 465 + mentions: text().array(), 466 + references: text().array(), 467 + }, (table) => [ 468 + primaryKey({ columns: [table.did, table.rkey] }), 469 + check("tangled_pull_comment_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 470 + check("tangled_pull_comment_non_null_fields", 471 + or( 472 + eq(table.deleted, sql`true`), 473 + and( 474 + isNotNull(table.pull), 475 + isNotNull(table.body), 476 + isNotNull(table.createdAt), 477 + ) 478 + )! 479 + ) 480 + ]); 481 + 482 + export const tangledPull = pgTable("tangled_pull", { 483 + did: text().notNull(), 484 + rev: text().notNull(), 485 + rkey: text().notNull(), 486 + cid: text(), 487 + deleted: boolean().notNull(), 488 + 489 + title: text(), 490 + body: text(), 491 + rounds: jsonb(), 492 + sourceBranch: text(), 493 + sourceRepo: text(), 494 + sourceRepoDid: text(), 495 + targetBranch: text(), 496 + targetRepo: text(), 497 + targetRepoDid: text(), 498 + createdAt: timestamp({ withTimezone: true }), 499 + mentions: text().array(), 500 + references: text().array(), 501 + dependentOn: text(), 502 + 503 + }, (table) => [ 504 + primaryKey({ columns: [table.did, table.rkey] }), 505 + check("tangled_pull_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 506 + check("tangled_pull_non_null_fields", 507 + or( 508 + eq(table.deleted, sql`true`), 509 + and( 510 + isNotNull(table.targetBranch), 511 + isNotNull(table.title), 512 + isNotNull(table.createdAt), 513 + isNotNull(table.rounds), 514 + ) 515 + )! 516 + ) 517 + ]); 518 + 519 + export const tangledPullStatus = pgTable("tangled_pull_status", { 520 + did: text().notNull(), 521 + rev: text().notNull(), 522 + rkey: text().notNull(), 523 + cid: text(), 524 + deleted: boolean().notNull(), 525 + 526 + pull: text(), 527 + status: text(), 528 + }, (table) => [ 529 + primaryKey({ columns: [table.did, table.rkey] }), 530 + check("tangled_pull_status_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 531 + check("tangled_pull_status_non_null_fields", 532 + or( 533 + eq(table.deleted, sql`true`), 534 + and( 535 + isNotNull(table.pull), 536 + isNotNull(table.status), 537 + ) 538 + )! 539 + ) 540 + ]); 541 + 542 + export const tangledArtifact = pgTable("tangled_artifact", { 543 + did: text().notNull(), 544 + rev: text().notNull(), 545 + rkey: text().notNull(), 546 + cid: text(), 547 + deleted: boolean().notNull(), 548 + 549 + name: text(), 550 + repo: text(), 551 + repoDid: text(), 552 + tag: text(), // TODO: look into making this... bytes 553 + createdAt: timestamp({ withTimezone: true }), 554 + artifactRef: text(), 555 + artifactSize: integer(), 556 + artifactMimeType: text(), 557 + }, (table) => [ 558 + primaryKey({ columns: [table.did, table.rkey] }), 559 + check("tangled_artifact_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 560 + check("tangled_artifact_non_null_fields", 561 + or( 562 + eq(table.deleted, sql`true`), 563 + and( 564 + isNotNull(table.name), 565 + isNotNull(table.tag), 566 + isNotNull(table.createdAt), 567 + isNotNull(table.artifactRef), 568 + isNotNull(table.artifactSize), 569 + isNotNull(table.artifactMimeType), 570 + ) 571 + )! 572 + ) 573 + ]); 574 + 575 + export const tangledCollaborator = pgTable("tangled_collaborator", { 576 + did: text().notNull(), 577 + rev: text().notNull(), 578 + rkey: text().notNull(), 579 + cid: text(), 580 + deleted: boolean().notNull(), 581 + 582 + subject: text(), 583 + repo: text(), 584 + repoDid: text(), 585 + createdAt: timestamp({ withTimezone: true }), 586 + }, (table) => [ 587 + primaryKey({ columns: [table.did, table.rkey] }), 588 + check("tangled_collaborator_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 589 + check("tangled_collaborator_non_null_fields", 590 + or( 591 + eq(table.deleted, sql`true`), 592 + and( 593 + isNotNull(table.subject), 594 + isNotNull(table.createdAt), 595 + ) 596 + )! 597 + ) 598 + ]); 599 + 32 600 export const tangledRepo = pgTable("tangled_repo", { 33 601 did: text().notNull(), 34 602 rev: text().notNull(), ··· 60 628 )! 61 629 ) 62 630 ]); 631 + 632 + export const tangledSpindleMember = pgTable("tangled_spindle_member", { 633 + did: text().notNull(), 634 + rev: text().notNull(), 635 + rkey: text().notNull(), 636 + cid: text(), 637 + deleted: boolean().notNull(), 638 + 639 + subject: text(), 640 + instance: text(), 641 + createdAt: timestamp({ withTimezone: true }), 642 + }, (table) => [ 643 + primaryKey({ columns: [table.did, table.rkey] }), 644 + check("tangled_spindle_member_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 645 + check("tangled_spindle_member_non_null_fields", 646 + or( 647 + eq(table.deleted, sql`true`), 648 + and( 649 + isNotNull(table.subject), 650 + isNotNull(table.instance), 651 + isNotNull(table.createdAt), 652 + ) 653 + )! 654 + ) 655 + ]); 656 + 657 + export const tangledSpindle = pgTable("tangled_spindle", { 658 + did: text().notNull(), 659 + rev: text().notNull(), 660 + rkey: text().notNull(), 661 + cid: text(), 662 + deleted: boolean().notNull(), 663 + 664 + createdAt: timestamp({ withTimezone: true }), 665 + }, (table) => [ 666 + primaryKey({ columns: [table.did, table.rkey] }), 667 + check("tangled_spindle_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 668 + check("tangled_spindle_non_null_fields", 669 + or( 670 + eq(table.deleted, sql`true`), 671 + and( 672 + isNotNull(table.createdAt), 673 + ) 674 + )! 675 + ) 676 + ]); 677 + 678 + export const tangledString = pgTable("tangled_string", { 679 + did: text().notNull(), 680 + rev: text().notNull(), 681 + rkey: text().notNull(), 682 + cid: text(), 683 + deleted: boolean().notNull(), 684 + 685 + filename: text(), 686 + description: text(), 687 + createdAt: timestamp({ withTimezone: true }), 688 + contents: text(), 689 + }, (table) => [ 690 + primaryKey({ columns: [table.did, table.rkey] }), 691 + check("tangled_string_cid_only_null_if_deleted", or(isNotNull(table.cid), eq(table.deleted, sql`true`))!), 692 + check("tangled_string_non_null_fields", 693 + or( 694 + eq(table.deleted, sql`true`), 695 + and( 696 + isNotNull(table.filename), 697 + isNotNull(table.description), 698 + isNotNull(table.createdAt), 699 + isNotNull(table.contents), 700 + ) 701 + )! 702 + ) 703 + ]);