the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

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

Add integrations, SSH keys and Tailscale tokens

Add Drizzle migration and metadata for the new schemas. Add a
'redacted' column to secrets and update schema files across api,
cf-sandbox, and sandbox apps

+1522 -4
+25
apps/api/src/schema/integrations.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes"; 4 + 5 + const integrations = pgTable( 6 + "integrations", 7 + { 8 + id: text("id") 9 + .primaryKey() 10 + .default(sql`xata_id()`), 11 + sandboxId: text("sandbox_id") 12 + .notNull() 13 + .references(() => sandboxes.id), 14 + name: text("name").notNull(), 15 + description: text("description"), 16 + webhookUrl: text("webhook_url").notNull(), 17 + createdAt: timestamp("created_at").defaultNow().notNull(), 18 + }, 19 + (t) => [uniqueIndex("unique_sandbox_integration").on(t.sandboxId, t.name)], 20 + ); 21 + 22 + export type SelectIntegration = InferSelectModel<typeof integrations>; 23 + export type InsertIntegration = InferInsertModel<typeof integrations>; 24 + 25 + export default integrations;
+4 -1
apps/api/src/schema/secrets.ts
··· 2 2 import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 3 4 4 const secrets = pgTable("secrets", { 5 - id: text("id").primaryKey().default(sql`secret_id()`), 5 + id: text("id") 6 + .primaryKey() 7 + .default(sql`secret_id()`), 6 8 name: text("name").notNull(), 7 9 value: text("value").notNull(), 10 + redacted: text("redacted"), 8 11 createdAt: timestamp("created_at").defaultNow().notNull(), 9 12 }); 10 13
+19
apps/api/src/schema/ssh-keys.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes"; 4 + 5 + const sshKeys = pgTable("ssh_keys", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 + publicKey: text("public_key").notNull(), 11 + privateKey: text("private_key").notNull(), 12 + redacted: text("redacted").notNull(), 13 + createdAt: timestamp("created_at").defaultNow().notNull(), 14 + }); 15 + 16 + export type SelectSshKey = InferSelectModel<typeof sshKeys>; 17 + export type InsertSshKey = InferInsertModel<typeof sshKeys>; 18 + 19 + export default sshKeys;
+18
apps/api/src/schema/tailscale-tokens.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes"; 4 + 5 + const tailscaleTokens = pgTable("tailscale_tokens", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 + tokens: text("tokens").notNull(), 11 + redacted: text("redacted").notNull(), 12 + createdAt: timestamp("created_at").defaultNow().notNull(), 13 + }); 14 + 15 + export type SelectTailscaleToken = InferSelectModel<typeof tailscaleTokens>; 16 + export type InsertTailscaleToken = InferInsertModel<typeof tailscaleTokens>; 17 + 18 + export default tailscaleTokens;
+4 -2
apps/api/src/schema/users.ts
··· 1 1 import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 - import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 3 4 4 const users = pgTable("users", { 5 - id: text("id").primaryKey().default(sql`xata_id()`), 5 + id: text("id") 6 + .primaryKey() 7 + .default(sql`xata_id()`), 6 8 did: text("did").unique().notNull(), 7 9 displayName: text("display_name"), 8 10 handle: text("handle").unique().notNull(),
+31
apps/cf-sandbox/drizzle/0020_striped_kree.sql
··· 1 + CREATE TABLE "integrations" ( 2 + "id" text PRIMARY KEY DEFAULT xata_id() NOT NULL, 3 + "sandbox_id" text NOT NULL, 4 + "name" text NOT NULL, 5 + "description" text, 6 + "webhook_url" text NOT NULL, 7 + "created_at" timestamp DEFAULT now() NOT NULL 8 + ); 9 + --> statement-breakpoint 10 + CREATE TABLE "ssh_keys" ( 11 + "id" text PRIMARY KEY DEFAULT xata_id() NOT NULL, 12 + "sandbox_id" text, 13 + "public_key" text NOT NULL, 14 + "private_key" text NOT NULL, 15 + "redacted" text NOT NULL, 16 + "created_at" timestamp DEFAULT now() NOT NULL 17 + ); 18 + --> statement-breakpoint 19 + CREATE TABLE "tailscale_tokens" ( 20 + "id" text PRIMARY KEY DEFAULT xata_id() NOT NULL, 21 + "sandbox_id" text, 22 + "tokens" text NOT NULL, 23 + "redacted" text NOT NULL, 24 + "created_at" timestamp DEFAULT now() NOT NULL 25 + ); 26 + --> statement-breakpoint 27 + ALTER TABLE "secrets" ADD COLUMN "redacted" text;--> statement-breakpoint 28 + ALTER TABLE "integrations" ADD CONSTRAINT "integrations_sandbox_id_sandboxes_id_fk" FOREIGN KEY ("sandbox_id") REFERENCES "public"."sandboxes"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 29 + ALTER TABLE "ssh_keys" ADD CONSTRAINT "ssh_keys_sandbox_id_sandboxes_id_fk" FOREIGN KEY ("sandbox_id") REFERENCES "public"."sandboxes"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 30 + ALTER TABLE "tailscale_tokens" ADD CONSTRAINT "tailscale_tokens_sandbox_id_sandboxes_id_fk" FOREIGN KEY ("sandbox_id") REFERENCES "public"."sandboxes"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 31 + CREATE UNIQUE INDEX "unique_sandbox_integration" ON "integrations" USING btree ("sandbox_id","name");
+1287
apps/cf-sandbox/drizzle/meta/0020_snapshot.json
··· 1 + { 2 + "id": "513c9a33-b832-454a-bb41-46e3f792dd24", 3 + "prevId": "a92e1110-1b61-4de4-96a5-93c2a625f646", 4 + "version": "7", 5 + "dialect": "postgresql", 6 + "tables": { 7 + "public.authorized_keys": { 8 + "name": "authorized_keys", 9 + "schema": "", 10 + "columns": { 11 + "id": { 12 + "name": "id", 13 + "type": "text", 14 + "primaryKey": true, 15 + "notNull": true, 16 + "default": "xata_id()" 17 + }, 18 + "sandbox_id": { 19 + "name": "sandbox_id", 20 + "type": "text", 21 + "primaryKey": false, 22 + "notNull": false 23 + }, 24 + "public_key": { 25 + "name": "public_key", 26 + "type": "text", 27 + "primaryKey": false, 28 + "notNull": true 29 + }, 30 + "created_at": { 31 + "name": "created_at", 32 + "type": "timestamp", 33 + "primaryKey": false, 34 + "notNull": true, 35 + "default": "now()" 36 + } 37 + }, 38 + "indexes": {}, 39 + "foreignKeys": { 40 + "authorized_keys_sandbox_id_sandboxes_id_fk": { 41 + "name": "authorized_keys_sandbox_id_sandboxes_id_fk", 42 + "tableFrom": "authorized_keys", 43 + "tableTo": "sandboxes", 44 + "columnsFrom": [ 45 + "sandbox_id" 46 + ], 47 + "columnsTo": [ 48 + "id" 49 + ], 50 + "onDelete": "no action", 51 + "onUpdate": "no action" 52 + } 53 + }, 54 + "compositePrimaryKeys": {}, 55 + "uniqueConstraints": {}, 56 + "policies": {}, 57 + "checkConstraints": {}, 58 + "isRLSEnabled": false 59 + }, 60 + "public.files": { 61 + "name": "files", 62 + "schema": "", 63 + "columns": { 64 + "id": { 65 + "name": "id", 66 + "type": "text", 67 + "primaryKey": true, 68 + "notNull": true, 69 + "default": "variable_id()" 70 + }, 71 + "content": { 72 + "name": "content", 73 + "type": "text", 74 + "primaryKey": false, 75 + "notNull": true 76 + }, 77 + "created_at": { 78 + "name": "created_at", 79 + "type": "timestamp", 80 + "primaryKey": false, 81 + "notNull": true, 82 + "default": "now()" 83 + }, 84 + "updated_at": { 85 + "name": "updated_at", 86 + "type": "timestamp", 87 + "primaryKey": false, 88 + "notNull": true, 89 + "default": "now()" 90 + } 91 + }, 92 + "indexes": {}, 93 + "foreignKeys": {}, 94 + "compositePrimaryKeys": {}, 95 + "uniqueConstraints": {}, 96 + "policies": {}, 97 + "checkConstraints": {}, 98 + "isRLSEnabled": false 99 + }, 100 + "public.sandbox_files": { 101 + "name": "sandbox_files", 102 + "schema": "", 103 + "columns": { 104 + "id": { 105 + "name": "id", 106 + "type": "text", 107 + "primaryKey": true, 108 + "notNull": true, 109 + "default": "xata_id()" 110 + }, 111 + "sandbox_id": { 112 + "name": "sandbox_id", 113 + "type": "text", 114 + "primaryKey": false, 115 + "notNull": true 116 + }, 117 + "file_id": { 118 + "name": "file_id", 119 + "type": "text", 120 + "primaryKey": false, 121 + "notNull": true 122 + }, 123 + "path": { 124 + "name": "path", 125 + "type": "text", 126 + "primaryKey": false, 127 + "notNull": true 128 + }, 129 + "created_at": { 130 + "name": "created_at", 131 + "type": "timestamp", 132 + "primaryKey": false, 133 + "notNull": true, 134 + "default": "now()" 135 + }, 136 + "updated_at": { 137 + "name": "updated_at", 138 + "type": "timestamp", 139 + "primaryKey": false, 140 + "notNull": true, 141 + "default": "now()" 142 + } 143 + }, 144 + "indexes": { 145 + "unique_sandbox_file": { 146 + "name": "unique_sandbox_file", 147 + "columns": [ 148 + { 149 + "expression": "sandbox_id", 150 + "isExpression": false, 151 + "asc": true, 152 + "nulls": "last" 153 + }, 154 + { 155 + "expression": "file_id", 156 + "isExpression": false, 157 + "asc": true, 158 + "nulls": "last" 159 + } 160 + ], 161 + "isUnique": true, 162 + "concurrently": false, 163 + "method": "btree", 164 + "with": {} 165 + }, 166 + "unique_sandbox_file_path": { 167 + "name": "unique_sandbox_file_path", 168 + "columns": [ 169 + { 170 + "expression": "sandbox_id", 171 + "isExpression": false, 172 + "asc": true, 173 + "nulls": "last" 174 + }, 175 + { 176 + "expression": "path", 177 + "isExpression": false, 178 + "asc": true, 179 + "nulls": "last" 180 + } 181 + ], 182 + "isUnique": true, 183 + "concurrently": false, 184 + "method": "btree", 185 + "with": {} 186 + } 187 + }, 188 + "foreignKeys": { 189 + "sandbox_files_sandbox_id_sandboxes_id_fk": { 190 + "name": "sandbox_files_sandbox_id_sandboxes_id_fk", 191 + "tableFrom": "sandbox_files", 192 + "tableTo": "sandboxes", 193 + "columnsFrom": [ 194 + "sandbox_id" 195 + ], 196 + "columnsTo": [ 197 + "id" 198 + ], 199 + "onDelete": "no action", 200 + "onUpdate": "no action" 201 + }, 202 + "sandbox_files_file_id_files_id_fk": { 203 + "name": "sandbox_files_file_id_files_id_fk", 204 + "tableFrom": "sandbox_files", 205 + "tableTo": "files", 206 + "columnsFrom": [ 207 + "file_id" 208 + ], 209 + "columnsTo": [ 210 + "id" 211 + ], 212 + "onDelete": "no action", 213 + "onUpdate": "no action" 214 + } 215 + }, 216 + "compositePrimaryKeys": {}, 217 + "uniqueConstraints": {}, 218 + "policies": {}, 219 + "checkConstraints": {}, 220 + "isRLSEnabled": false 221 + }, 222 + "public.sandbox_secrets": { 223 + "name": "sandbox_secrets", 224 + "schema": "", 225 + "columns": { 226 + "id": { 227 + "name": "id", 228 + "type": "text", 229 + "primaryKey": true, 230 + "notNull": true, 231 + "default": "xata_id()" 232 + }, 233 + "sandbox_id": { 234 + "name": "sandbox_id", 235 + "type": "text", 236 + "primaryKey": false, 237 + "notNull": true 238 + }, 239 + "secret_id": { 240 + "name": "secret_id", 241 + "type": "text", 242 + "primaryKey": false, 243 + "notNull": true 244 + }, 245 + "name": { 246 + "name": "name", 247 + "type": "text", 248 + "primaryKey": false, 249 + "notNull": false 250 + }, 251 + "created_at": { 252 + "name": "created_at", 253 + "type": "timestamp", 254 + "primaryKey": false, 255 + "notNull": true, 256 + "default": "now()" 257 + }, 258 + "updated_at": { 259 + "name": "updated_at", 260 + "type": "timestamp", 261 + "primaryKey": false, 262 + "notNull": true, 263 + "default": "now()" 264 + } 265 + }, 266 + "indexes": { 267 + "unique_sandbox_secret": { 268 + "name": "unique_sandbox_secret", 269 + "columns": [ 270 + { 271 + "expression": "sandbox_id", 272 + "isExpression": false, 273 + "asc": true, 274 + "nulls": "last" 275 + }, 276 + { 277 + "expression": "secret_id", 278 + "isExpression": false, 279 + "asc": true, 280 + "nulls": "last" 281 + } 282 + ], 283 + "isUnique": true, 284 + "concurrently": false, 285 + "method": "btree", 286 + "with": {} 287 + }, 288 + "unique_sandbox_secret_by_name": { 289 + "name": "unique_sandbox_secret_by_name", 290 + "columns": [ 291 + { 292 + "expression": "sandbox_id", 293 + "isExpression": false, 294 + "asc": true, 295 + "nulls": "last" 296 + }, 297 + { 298 + "expression": "name", 299 + "isExpression": false, 300 + "asc": true, 301 + "nulls": "last" 302 + } 303 + ], 304 + "isUnique": true, 305 + "concurrently": false, 306 + "method": "btree", 307 + "with": {} 308 + } 309 + }, 310 + "foreignKeys": { 311 + "sandbox_secrets_sandbox_id_sandboxes_id_fk": { 312 + "name": "sandbox_secrets_sandbox_id_sandboxes_id_fk", 313 + "tableFrom": "sandbox_secrets", 314 + "tableTo": "sandboxes", 315 + "columnsFrom": [ 316 + "sandbox_id" 317 + ], 318 + "columnsTo": [ 319 + "id" 320 + ], 321 + "onDelete": "no action", 322 + "onUpdate": "no action" 323 + }, 324 + "sandbox_secrets_secret_id_secrets_id_fk": { 325 + "name": "sandbox_secrets_secret_id_secrets_id_fk", 326 + "tableFrom": "sandbox_secrets", 327 + "tableTo": "secrets", 328 + "columnsFrom": [ 329 + "secret_id" 330 + ], 331 + "columnsTo": [ 332 + "id" 333 + ], 334 + "onDelete": "no action", 335 + "onUpdate": "no action" 336 + } 337 + }, 338 + "compositePrimaryKeys": {}, 339 + "uniqueConstraints": {}, 340 + "policies": {}, 341 + "checkConstraints": {}, 342 + "isRLSEnabled": false 343 + }, 344 + "public.sandbox_variables": { 345 + "name": "sandbox_variables", 346 + "schema": "", 347 + "columns": { 348 + "id": { 349 + "name": "id", 350 + "type": "text", 351 + "primaryKey": true, 352 + "notNull": true, 353 + "default": "xata_id()" 354 + }, 355 + "sandbox_id": { 356 + "name": "sandbox_id", 357 + "type": "text", 358 + "primaryKey": false, 359 + "notNull": true 360 + }, 361 + "variable_id": { 362 + "name": "variable_id", 363 + "type": "text", 364 + "primaryKey": false, 365 + "notNull": true 366 + }, 367 + "name": { 368 + "name": "name", 369 + "type": "text", 370 + "primaryKey": false, 371 + "notNull": true 372 + }, 373 + "created_at": { 374 + "name": "created_at", 375 + "type": "timestamp", 376 + "primaryKey": false, 377 + "notNull": true, 378 + "default": "now()" 379 + }, 380 + "updated_at": { 381 + "name": "updated_at", 382 + "type": "timestamp", 383 + "primaryKey": false, 384 + "notNull": true, 385 + "default": "now()" 386 + } 387 + }, 388 + "indexes": { 389 + "unique_sandbox_variables": { 390 + "name": "unique_sandbox_variables", 391 + "columns": [ 392 + { 393 + "expression": "sandbox_id", 394 + "isExpression": false, 395 + "asc": true, 396 + "nulls": "last" 397 + }, 398 + { 399 + "expression": "variable_id", 400 + "isExpression": false, 401 + "asc": true, 402 + "nulls": "last" 403 + } 404 + ], 405 + "isUnique": true, 406 + "concurrently": false, 407 + "method": "btree", 408 + "with": {} 409 + }, 410 + "unique_sandbox_variables_by_name": { 411 + "name": "unique_sandbox_variables_by_name", 412 + "columns": [ 413 + { 414 + "expression": "sandbox_id", 415 + "isExpression": false, 416 + "asc": true, 417 + "nulls": "last" 418 + }, 419 + { 420 + "expression": "name", 421 + "isExpression": false, 422 + "asc": true, 423 + "nulls": "last" 424 + } 425 + ], 426 + "isUnique": true, 427 + "concurrently": false, 428 + "method": "btree", 429 + "with": {} 430 + } 431 + }, 432 + "foreignKeys": { 433 + "sandbox_variables_sandbox_id_sandboxes_id_fk": { 434 + "name": "sandbox_variables_sandbox_id_sandboxes_id_fk", 435 + "tableFrom": "sandbox_variables", 436 + "tableTo": "sandboxes", 437 + "columnsFrom": [ 438 + "sandbox_id" 439 + ], 440 + "columnsTo": [ 441 + "id" 442 + ], 443 + "onDelete": "no action", 444 + "onUpdate": "no action" 445 + }, 446 + "sandbox_variables_variable_id_variables_id_fk": { 447 + "name": "sandbox_variables_variable_id_variables_id_fk", 448 + "tableFrom": "sandbox_variables", 449 + "tableTo": "variables", 450 + "columnsFrom": [ 451 + "variable_id" 452 + ], 453 + "columnsTo": [ 454 + "id" 455 + ], 456 + "onDelete": "no action", 457 + "onUpdate": "no action" 458 + } 459 + }, 460 + "compositePrimaryKeys": {}, 461 + "uniqueConstraints": {}, 462 + "policies": {}, 463 + "checkConstraints": {}, 464 + "isRLSEnabled": false 465 + }, 466 + "public.sandbox_volumes": { 467 + "name": "sandbox_volumes", 468 + "schema": "", 469 + "columns": { 470 + "id": { 471 + "name": "id", 472 + "type": "text", 473 + "primaryKey": true, 474 + "notNull": true, 475 + "default": "xata_id()" 476 + }, 477 + "sandbox_id": { 478 + "name": "sandbox_id", 479 + "type": "text", 480 + "primaryKey": false, 481 + "notNull": true 482 + }, 483 + "volume_id": { 484 + "name": "volume_id", 485 + "type": "text", 486 + "primaryKey": false, 487 + "notNull": true 488 + }, 489 + "name": { 490 + "name": "name", 491 + "type": "text", 492 + "primaryKey": false, 493 + "notNull": false 494 + }, 495 + "path": { 496 + "name": "path", 497 + "type": "text", 498 + "primaryKey": false, 499 + "notNull": true 500 + }, 501 + "created_at": { 502 + "name": "created_at", 503 + "type": "timestamp", 504 + "primaryKey": false, 505 + "notNull": true, 506 + "default": "now()" 507 + }, 508 + "updated_at": { 509 + "name": "updated_at", 510 + "type": "timestamp", 511 + "primaryKey": false, 512 + "notNull": true, 513 + "default": "now()" 514 + } 515 + }, 516 + "indexes": { 517 + "unique_sandbox_volume": { 518 + "name": "unique_sandbox_volume", 519 + "columns": [ 520 + { 521 + "expression": "sandbox_id", 522 + "isExpression": false, 523 + "asc": true, 524 + "nulls": "last" 525 + }, 526 + { 527 + "expression": "volume_id", 528 + "isExpression": false, 529 + "asc": true, 530 + "nulls": "last" 531 + } 532 + ], 533 + "isUnique": true, 534 + "concurrently": false, 535 + "method": "btree", 536 + "with": {} 537 + }, 538 + "unique_sandbox_volume_path": { 539 + "name": "unique_sandbox_volume_path", 540 + "columns": [ 541 + { 542 + "expression": "sandbox_id", 543 + "isExpression": false, 544 + "asc": true, 545 + "nulls": "last" 546 + }, 547 + { 548 + "expression": "path", 549 + "isExpression": false, 550 + "asc": true, 551 + "nulls": "last" 552 + } 553 + ], 554 + "isUnique": true, 555 + "concurrently": false, 556 + "method": "btree", 557 + "with": {} 558 + } 559 + }, 560 + "foreignKeys": { 561 + "sandbox_volumes_sandbox_id_sandboxes_id_fk": { 562 + "name": "sandbox_volumes_sandbox_id_sandboxes_id_fk", 563 + "tableFrom": "sandbox_volumes", 564 + "tableTo": "sandboxes", 565 + "columnsFrom": [ 566 + "sandbox_id" 567 + ], 568 + "columnsTo": [ 569 + "id" 570 + ], 571 + "onDelete": "no action", 572 + "onUpdate": "no action" 573 + }, 574 + "sandbox_volumes_volume_id_volumes_id_fk": { 575 + "name": "sandbox_volumes_volume_id_volumes_id_fk", 576 + "tableFrom": "sandbox_volumes", 577 + "tableTo": "volumes", 578 + "columnsFrom": [ 579 + "volume_id" 580 + ], 581 + "columnsTo": [ 582 + "id" 583 + ], 584 + "onDelete": "no action", 585 + "onUpdate": "no action" 586 + } 587 + }, 588 + "compositePrimaryKeys": {}, 589 + "uniqueConstraints": {}, 590 + "policies": {}, 591 + "checkConstraints": {}, 592 + "isRLSEnabled": false 593 + }, 594 + "public.sandboxes": { 595 + "name": "sandboxes", 596 + "schema": "", 597 + "columns": { 598 + "id": { 599 + "name": "id", 600 + "type": "text", 601 + "primaryKey": true, 602 + "notNull": true, 603 + "default": "sandbox_id()" 604 + }, 605 + "base": { 606 + "name": "base", 607 + "type": "text", 608 + "primaryKey": false, 609 + "notNull": false 610 + }, 611 + "name": { 612 + "name": "name", 613 + "type": "text", 614 + "primaryKey": false, 615 + "notNull": true 616 + }, 617 + "display_name": { 618 + "name": "display_name", 619 + "type": "text", 620 + "primaryKey": false, 621 + "notNull": false 622 + }, 623 + "uri": { 624 + "name": "uri", 625 + "type": "text", 626 + "primaryKey": false, 627 + "notNull": false 628 + }, 629 + "cid": { 630 + "name": "cid", 631 + "type": "text", 632 + "primaryKey": false, 633 + "notNull": false 634 + }, 635 + "repo": { 636 + "name": "repo", 637 + "type": "text", 638 + "primaryKey": false, 639 + "notNull": false 640 + }, 641 + "provider": { 642 + "name": "provider", 643 + "type": "text", 644 + "primaryKey": false, 645 + "notNull": true, 646 + "default": "'cloudflare'" 647 + }, 648 + "description": { 649 + "name": "description", 650 + "type": "text", 651 + "primaryKey": false, 652 + "notNull": false 653 + }, 654 + "logo": { 655 + "name": "logo", 656 + "type": "text", 657 + "primaryKey": false, 658 + "notNull": false 659 + }, 660 + "readme": { 661 + "name": "readme", 662 + "type": "text", 663 + "primaryKey": false, 664 + "notNull": false 665 + }, 666 + "public_key": { 667 + "name": "public_key", 668 + "type": "text", 669 + "primaryKey": false, 670 + "notNull": true 671 + }, 672 + "user_id": { 673 + "name": "user_id", 674 + "type": "text", 675 + "primaryKey": false, 676 + "notNull": false 677 + }, 678 + "instance_type": { 679 + "name": "instance_type", 680 + "type": "text", 681 + "primaryKey": false, 682 + "notNull": false 683 + }, 684 + "vcpus": { 685 + "name": "vcpus", 686 + "type": "integer", 687 + "primaryKey": false, 688 + "notNull": false 689 + }, 690 + "memory": { 691 + "name": "memory", 692 + "type": "integer", 693 + "primaryKey": false, 694 + "notNull": false 695 + }, 696 + "disk": { 697 + "name": "disk", 698 + "type": "integer", 699 + "primaryKey": false, 700 + "notNull": false 701 + }, 702 + "status": { 703 + "name": "status", 704 + "type": "text", 705 + "primaryKey": false, 706 + "notNull": true 707 + }, 708 + "keep_alive": { 709 + "name": "keep_alive", 710 + "type": "boolean", 711 + "primaryKey": false, 712 + "notNull": true, 713 + "default": false 714 + }, 715 + "sleep_after": { 716 + "name": "sleep_after", 717 + "type": "text", 718 + "primaryKey": false, 719 + "notNull": false 720 + }, 721 + "sandbox_id": { 722 + "name": "sandbox_id", 723 + "type": "text", 724 + "primaryKey": false, 725 + "notNull": false 726 + }, 727 + "installs": { 728 + "name": "installs", 729 + "type": "integer", 730 + "primaryKey": false, 731 + "notNull": true, 732 + "default": 0 733 + }, 734 + "started_at": { 735 + "name": "started_at", 736 + "type": "timestamp", 737 + "primaryKey": false, 738 + "notNull": false 739 + }, 740 + "created_at": { 741 + "name": "created_at", 742 + "type": "timestamp", 743 + "primaryKey": false, 744 + "notNull": true, 745 + "default": "now()" 746 + }, 747 + "updated_at": { 748 + "name": "updated_at", 749 + "type": "timestamp", 750 + "primaryKey": false, 751 + "notNull": true, 752 + "default": "now()" 753 + } 754 + }, 755 + "indexes": {}, 756 + "foreignKeys": { 757 + "sandboxes_user_id_users_id_fk": { 758 + "name": "sandboxes_user_id_users_id_fk", 759 + "tableFrom": "sandboxes", 760 + "tableTo": "users", 761 + "columnsFrom": [ 762 + "user_id" 763 + ], 764 + "columnsTo": [ 765 + "id" 766 + ], 767 + "onDelete": "no action", 768 + "onUpdate": "no action" 769 + } 770 + }, 771 + "compositePrimaryKeys": {}, 772 + "uniqueConstraints": { 773 + "sandboxes_name_unique": { 774 + "name": "sandboxes_name_unique", 775 + "nullsNotDistinct": false, 776 + "columns": [ 777 + "name" 778 + ] 779 + }, 780 + "sandboxes_uri_unique": { 781 + "name": "sandboxes_uri_unique", 782 + "nullsNotDistinct": false, 783 + "columns": [ 784 + "uri" 785 + ] 786 + }, 787 + "sandboxes_cid_unique": { 788 + "name": "sandboxes_cid_unique", 789 + "nullsNotDistinct": false, 790 + "columns": [ 791 + "cid" 792 + ] 793 + } 794 + }, 795 + "policies": {}, 796 + "checkConstraints": {}, 797 + "isRLSEnabled": false 798 + }, 799 + "public.secrets": { 800 + "name": "secrets", 801 + "schema": "", 802 + "columns": { 803 + "id": { 804 + "name": "id", 805 + "type": "text", 806 + "primaryKey": true, 807 + "notNull": true, 808 + "default": "secret_id()" 809 + }, 810 + "name": { 811 + "name": "name", 812 + "type": "text", 813 + "primaryKey": false, 814 + "notNull": true 815 + }, 816 + "value": { 817 + "name": "value", 818 + "type": "text", 819 + "primaryKey": false, 820 + "notNull": true 821 + }, 822 + "redacted": { 823 + "name": "redacted", 824 + "type": "text", 825 + "primaryKey": false, 826 + "notNull": false 827 + }, 828 + "created_at": { 829 + "name": "created_at", 830 + "type": "timestamp", 831 + "primaryKey": false, 832 + "notNull": true, 833 + "default": "now()" 834 + } 835 + }, 836 + "indexes": {}, 837 + "foreignKeys": {}, 838 + "compositePrimaryKeys": {}, 839 + "uniqueConstraints": {}, 840 + "policies": {}, 841 + "checkConstraints": {}, 842 + "isRLSEnabled": false 843 + }, 844 + "public.snapshots": { 845 + "name": "snapshots", 846 + "schema": "", 847 + "columns": { 848 + "id": { 849 + "name": "id", 850 + "type": "text", 851 + "primaryKey": true, 852 + "notNull": true, 853 + "default": "snapshot_id()" 854 + }, 855 + "slug": { 856 + "name": "slug", 857 + "type": "text", 858 + "primaryKey": false, 859 + "notNull": true 860 + }, 861 + "created_at": { 862 + "name": "created_at", 863 + "type": "timestamp", 864 + "primaryKey": false, 865 + "notNull": true, 866 + "default": "now()" 867 + } 868 + }, 869 + "indexes": {}, 870 + "foreignKeys": {}, 871 + "compositePrimaryKeys": {}, 872 + "uniqueConstraints": { 873 + "snapshots_slug_unique": { 874 + "name": "snapshots_slug_unique", 875 + "nullsNotDistinct": false, 876 + "columns": [ 877 + "slug" 878 + ] 879 + } 880 + }, 881 + "policies": {}, 882 + "checkConstraints": {}, 883 + "isRLSEnabled": false 884 + }, 885 + "public.users": { 886 + "name": "users", 887 + "schema": "", 888 + "columns": { 889 + "id": { 890 + "name": "id", 891 + "type": "text", 892 + "primaryKey": true, 893 + "notNull": true, 894 + "default": "xata_id()" 895 + }, 896 + "did": { 897 + "name": "did", 898 + "type": "text", 899 + "primaryKey": false, 900 + "notNull": true 901 + }, 902 + "display_name": { 903 + "name": "display_name", 904 + "type": "text", 905 + "primaryKey": false, 906 + "notNull": false 907 + }, 908 + "handle": { 909 + "name": "handle", 910 + "type": "text", 911 + "primaryKey": false, 912 + "notNull": true 913 + }, 914 + "avatar": { 915 + "name": "avatar", 916 + "type": "text", 917 + "primaryKey": false, 918 + "notNull": false 919 + }, 920 + "created_at": { 921 + "name": "created_at", 922 + "type": "timestamp", 923 + "primaryKey": false, 924 + "notNull": true, 925 + "default": "now()" 926 + }, 927 + "updated_at": { 928 + "name": "updated_at", 929 + "type": "timestamp", 930 + "primaryKey": false, 931 + "notNull": true, 932 + "default": "now()" 933 + } 934 + }, 935 + "indexes": {}, 936 + "foreignKeys": {}, 937 + "compositePrimaryKeys": {}, 938 + "uniqueConstraints": { 939 + "users_did_unique": { 940 + "name": "users_did_unique", 941 + "nullsNotDistinct": false, 942 + "columns": [ 943 + "did" 944 + ] 945 + }, 946 + "users_handle_unique": { 947 + "name": "users_handle_unique", 948 + "nullsNotDistinct": false, 949 + "columns": [ 950 + "handle" 951 + ] 952 + } 953 + }, 954 + "policies": {}, 955 + "checkConstraints": {}, 956 + "isRLSEnabled": false 957 + }, 958 + "public.variables": { 959 + "name": "variables", 960 + "schema": "", 961 + "columns": { 962 + "id": { 963 + "name": "id", 964 + "type": "text", 965 + "primaryKey": true, 966 + "notNull": true, 967 + "default": "variable_id()" 968 + }, 969 + "name": { 970 + "name": "name", 971 + "type": "text", 972 + "primaryKey": false, 973 + "notNull": true 974 + }, 975 + "value": { 976 + "name": "value", 977 + "type": "text", 978 + "primaryKey": false, 979 + "notNull": true 980 + }, 981 + "created_at": { 982 + "name": "created_at", 983 + "type": "timestamp", 984 + "primaryKey": false, 985 + "notNull": true, 986 + "default": "now()" 987 + }, 988 + "updated_at": { 989 + "name": "updated_at", 990 + "type": "timestamp", 991 + "primaryKey": false, 992 + "notNull": true, 993 + "default": "now()" 994 + } 995 + }, 996 + "indexes": {}, 997 + "foreignKeys": {}, 998 + "compositePrimaryKeys": {}, 999 + "uniqueConstraints": {}, 1000 + "policies": {}, 1001 + "checkConstraints": {}, 1002 + "isRLSEnabled": false 1003 + }, 1004 + "public.volumes": { 1005 + "name": "volumes", 1006 + "schema": "", 1007 + "columns": { 1008 + "id": { 1009 + "name": "id", 1010 + "type": "text", 1011 + "primaryKey": true, 1012 + "notNull": true, 1013 + "default": "volume_id()" 1014 + }, 1015 + "slug": { 1016 + "name": "slug", 1017 + "type": "text", 1018 + "primaryKey": false, 1019 + "notNull": true 1020 + }, 1021 + "size": { 1022 + "name": "size", 1023 + "type": "integer", 1024 + "primaryKey": false, 1025 + "notNull": true 1026 + }, 1027 + "size_unit": { 1028 + "name": "size_unit", 1029 + "type": "text", 1030 + "primaryKey": false, 1031 + "notNull": true 1032 + }, 1033 + "created_at": { 1034 + "name": "created_at", 1035 + "type": "timestamp", 1036 + "primaryKey": false, 1037 + "notNull": true, 1038 + "default": "now()" 1039 + }, 1040 + "updated_at": { 1041 + "name": "updated_at", 1042 + "type": "timestamp", 1043 + "primaryKey": false, 1044 + "notNull": true, 1045 + "default": "now()" 1046 + } 1047 + }, 1048 + "indexes": {}, 1049 + "foreignKeys": {}, 1050 + "compositePrimaryKeys": {}, 1051 + "uniqueConstraints": { 1052 + "volumes_slug_unique": { 1053 + "name": "volumes_slug_unique", 1054 + "nullsNotDistinct": false, 1055 + "columns": [ 1056 + "slug" 1057 + ] 1058 + } 1059 + }, 1060 + "policies": {}, 1061 + "checkConstraints": {}, 1062 + "isRLSEnabled": false 1063 + }, 1064 + "public.integrations": { 1065 + "name": "integrations", 1066 + "schema": "", 1067 + "columns": { 1068 + "id": { 1069 + "name": "id", 1070 + "type": "text", 1071 + "primaryKey": true, 1072 + "notNull": true, 1073 + "default": "xata_id()" 1074 + }, 1075 + "sandbox_id": { 1076 + "name": "sandbox_id", 1077 + "type": "text", 1078 + "primaryKey": false, 1079 + "notNull": true 1080 + }, 1081 + "name": { 1082 + "name": "name", 1083 + "type": "text", 1084 + "primaryKey": false, 1085 + "notNull": true 1086 + }, 1087 + "description": { 1088 + "name": "description", 1089 + "type": "text", 1090 + "primaryKey": false, 1091 + "notNull": false 1092 + }, 1093 + "webhook_url": { 1094 + "name": "webhook_url", 1095 + "type": "text", 1096 + "primaryKey": false, 1097 + "notNull": true 1098 + }, 1099 + "created_at": { 1100 + "name": "created_at", 1101 + "type": "timestamp", 1102 + "primaryKey": false, 1103 + "notNull": true, 1104 + "default": "now()" 1105 + } 1106 + }, 1107 + "indexes": { 1108 + "unique_sandbox_integration": { 1109 + "name": "unique_sandbox_integration", 1110 + "columns": [ 1111 + { 1112 + "expression": "sandbox_id", 1113 + "isExpression": false, 1114 + "asc": true, 1115 + "nulls": "last" 1116 + }, 1117 + { 1118 + "expression": "name", 1119 + "isExpression": false, 1120 + "asc": true, 1121 + "nulls": "last" 1122 + } 1123 + ], 1124 + "isUnique": true, 1125 + "concurrently": false, 1126 + "method": "btree", 1127 + "with": {} 1128 + } 1129 + }, 1130 + "foreignKeys": { 1131 + "integrations_sandbox_id_sandboxes_id_fk": { 1132 + "name": "integrations_sandbox_id_sandboxes_id_fk", 1133 + "tableFrom": "integrations", 1134 + "tableTo": "sandboxes", 1135 + "columnsFrom": [ 1136 + "sandbox_id" 1137 + ], 1138 + "columnsTo": [ 1139 + "id" 1140 + ], 1141 + "onDelete": "no action", 1142 + "onUpdate": "no action" 1143 + } 1144 + }, 1145 + "compositePrimaryKeys": {}, 1146 + "uniqueConstraints": {}, 1147 + "policies": {}, 1148 + "checkConstraints": {}, 1149 + "isRLSEnabled": false 1150 + }, 1151 + "public.ssh_keys": { 1152 + "name": "ssh_keys", 1153 + "schema": "", 1154 + "columns": { 1155 + "id": { 1156 + "name": "id", 1157 + "type": "text", 1158 + "primaryKey": true, 1159 + "notNull": true, 1160 + "default": "xata_id()" 1161 + }, 1162 + "sandbox_id": { 1163 + "name": "sandbox_id", 1164 + "type": "text", 1165 + "primaryKey": false, 1166 + "notNull": false 1167 + }, 1168 + "public_key": { 1169 + "name": "public_key", 1170 + "type": "text", 1171 + "primaryKey": false, 1172 + "notNull": true 1173 + }, 1174 + "private_key": { 1175 + "name": "private_key", 1176 + "type": "text", 1177 + "primaryKey": false, 1178 + "notNull": true 1179 + }, 1180 + "redacted": { 1181 + "name": "redacted", 1182 + "type": "text", 1183 + "primaryKey": false, 1184 + "notNull": true 1185 + }, 1186 + "created_at": { 1187 + "name": "created_at", 1188 + "type": "timestamp", 1189 + "primaryKey": false, 1190 + "notNull": true, 1191 + "default": "now()" 1192 + } 1193 + }, 1194 + "indexes": {}, 1195 + "foreignKeys": { 1196 + "ssh_keys_sandbox_id_sandboxes_id_fk": { 1197 + "name": "ssh_keys_sandbox_id_sandboxes_id_fk", 1198 + "tableFrom": "ssh_keys", 1199 + "tableTo": "sandboxes", 1200 + "columnsFrom": [ 1201 + "sandbox_id" 1202 + ], 1203 + "columnsTo": [ 1204 + "id" 1205 + ], 1206 + "onDelete": "no action", 1207 + "onUpdate": "no action" 1208 + } 1209 + }, 1210 + "compositePrimaryKeys": {}, 1211 + "uniqueConstraints": {}, 1212 + "policies": {}, 1213 + "checkConstraints": {}, 1214 + "isRLSEnabled": false 1215 + }, 1216 + "public.tailscale_tokens": { 1217 + "name": "tailscale_tokens", 1218 + "schema": "", 1219 + "columns": { 1220 + "id": { 1221 + "name": "id", 1222 + "type": "text", 1223 + "primaryKey": true, 1224 + "notNull": true, 1225 + "default": "xata_id()" 1226 + }, 1227 + "sandbox_id": { 1228 + "name": "sandbox_id", 1229 + "type": "text", 1230 + "primaryKey": false, 1231 + "notNull": false 1232 + }, 1233 + "tokens": { 1234 + "name": "tokens", 1235 + "type": "text", 1236 + "primaryKey": false, 1237 + "notNull": true 1238 + }, 1239 + "redacted": { 1240 + "name": "redacted", 1241 + "type": "text", 1242 + "primaryKey": false, 1243 + "notNull": true 1244 + }, 1245 + "created_at": { 1246 + "name": "created_at", 1247 + "type": "timestamp", 1248 + "primaryKey": false, 1249 + "notNull": true, 1250 + "default": "now()" 1251 + } 1252 + }, 1253 + "indexes": {}, 1254 + "foreignKeys": { 1255 + "tailscale_tokens_sandbox_id_sandboxes_id_fk": { 1256 + "name": "tailscale_tokens_sandbox_id_sandboxes_id_fk", 1257 + "tableFrom": "tailscale_tokens", 1258 + "tableTo": "sandboxes", 1259 + "columnsFrom": [ 1260 + "sandbox_id" 1261 + ], 1262 + "columnsTo": [ 1263 + "id" 1264 + ], 1265 + "onDelete": "no action", 1266 + "onUpdate": "no action" 1267 + } 1268 + }, 1269 + "compositePrimaryKeys": {}, 1270 + "uniqueConstraints": {}, 1271 + "policies": {}, 1272 + "checkConstraints": {}, 1273 + "isRLSEnabled": false 1274 + } 1275 + }, 1276 + "enums": {}, 1277 + "schemas": {}, 1278 + "sequences": {}, 1279 + "roles": {}, 1280 + "policies": {}, 1281 + "views": {}, 1282 + "_meta": { 1283 + "columns": {}, 1284 + "schemas": {}, 1285 + "tables": {} 1286 + } 1287 + }
+7
apps/cf-sandbox/drizzle/meta/_journal.json
··· 141 141 "when": 1773000076930, 142 142 "tag": "0019_hot_nextwave", 143 143 "breakpoints": true 144 + }, 145 + { 146 + "idx": 20, 147 + "version": "7", 148 + "when": 1773002299756, 149 + "tag": "0020_striped_kree", 150 + "breakpoints": true 144 151 } 145 152 ] 146 153 }
+25
apps/cf-sandbox/src/schema/integrations.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes"; 4 + 5 + const integrations = pgTable( 6 + "integrations", 7 + { 8 + id: text("id") 9 + .primaryKey() 10 + .default(sql`xata_id()`), 11 + sandboxId: text("sandbox_id") 12 + .notNull() 13 + .references(() => sandboxes.id), 14 + name: text("name").notNull(), 15 + description: text("description"), 16 + webhookUrl: text("webhook_url").notNull(), 17 + createdAt: timestamp("created_at").defaultNow().notNull(), 18 + }, 19 + (t) => [uniqueIndex("unique_sandbox_integration").on(t.sandboxId, t.name)], 20 + ); 21 + 22 + export type SelectIntegration = InferSelectModel<typeof integrations>; 23 + export type InsertIntegration = InferInsertModel<typeof integrations>; 24 + 25 + export default integrations;
+2 -1
apps/cf-sandbox/src/schema/secrets.ts
··· 1 1 import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 - import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 3 4 4 const secrets = pgTable("secrets", { 5 5 id: text("id") ··· 7 7 .default(sql`secret_id()`), 8 8 name: text("name").notNull(), 9 9 value: text("value").notNull(), 10 + redacted: text("redacted"), 10 11 createdAt: timestamp("created_at").defaultNow().notNull(), 11 12 }); 12 13
+19
apps/cf-sandbox/src/schema/ssh-keys.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes"; 4 + 5 + const sshKeys = pgTable("ssh_keys", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 + publicKey: text("public_key").notNull(), 11 + privateKey: text("private_key").notNull(), 12 + redacted: text("redacted").notNull(), 13 + createdAt: timestamp("created_at").defaultNow().notNull(), 14 + }); 15 + 16 + export type SelectSshKey = InferSelectModel<typeof sshKeys>; 17 + export type InsertSshKey = InferInsertModel<typeof sshKeys>; 18 + 19 + export default sshKeys;
+18
apps/cf-sandbox/src/schema/tailscale-tokens.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes"; 4 + 5 + const tailscaleTokens = pgTable("tailscale_tokens", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 + tokens: text("tokens").notNull(), 11 + redacted: text("redacted").notNull(), 12 + createdAt: timestamp("created_at").defaultNow().notNull(), 13 + }); 14 + 15 + export type SelectTailscaleToken = InferSelectModel<typeof tailscaleTokens>; 16 + export type InsertTailscaleToken = InferInsertModel<typeof tailscaleTokens>; 17 + 18 + export default tailscaleTokens;
+25
apps/sandbox/src/schema/integrations.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes.ts"; 4 + 5 + const integrations = pgTable( 6 + "integrations", 7 + { 8 + id: text("id") 9 + .primaryKey() 10 + .default(sql`xata_id()`), 11 + sandboxId: text("sandbox_id") 12 + .notNull() 13 + .references(() => sandboxes.id), 14 + name: text("name").notNull(), 15 + description: text("description"), 16 + webhookUrl: text("webhook_url").notNull(), 17 + createdAt: timestamp("created_at").defaultNow().notNull(), 18 + }, 19 + (t) => [uniqueIndex("unique_sandbox_integration").on(t.sandboxId, t.name)], 20 + ); 21 + 22 + export type SelectIntegration = InferSelectModel<typeof integrations>; 23 + export type InsertIntegration = InferInsertModel<typeof integrations>; 24 + 25 + export default integrations;
+1
apps/sandbox/src/schema/secrets.ts
··· 7 7 .default(sql`secret_id()`), 8 8 name: text("name").notNull(), 9 9 value: text("value").notNull(), 10 + redacted: text("redacted"), 10 11 createdAt: timestamp("created_at").defaultNow().notNull(), 11 12 }); 12 13
+19
apps/sandbox/src/schema/ssh-keys.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes.ts"; 4 + 5 + const sshKeys = pgTable("ssh_keys", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 + publicKey: text("public_key").notNull(), 11 + privateKey: text("private_key").notNull(), 12 + redacted: text("redacted").notNull(), 13 + createdAt: timestamp("created_at").defaultNow().notNull(), 14 + }); 15 + 16 + export type SelectSshKey = InferSelectModel<typeof sshKeys>; 17 + export type InsertSshKey = InferInsertModel<typeof sshKeys>; 18 + 19 + export default sshKeys;
+18
apps/sandbox/src/schema/tailscale-tokens.ts
··· 1 + import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2 + import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 + import sandboxes from "./sandboxes.ts"; 4 + 5 + const tailscaleTokens = pgTable("tailscale_tokens", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 + tokens: text("tokens").notNull(), 11 + redacted: text("redacted").notNull(), 12 + createdAt: timestamp("created_at").defaultNow().notNull(), 13 + }); 14 + 15 + export type SelectTailscaleToken = InferSelectModel<typeof tailscaleTokens>; 16 + export type InsertTailscaleToken = InferInsertModel<typeof tailscaleTokens>; 17 + 18 + export default tailscaleTokens;