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 backups table, migrations and endpoints

+4063 -3
+22
apps/api/src/schema/backups.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 backups = pgTable("backups", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id") 10 + .notNull() 11 + .references(() => sandboxes.id, { onDelete: "cascade" }), 12 + backupId: text("backup_id").notNull(), 13 + directory: text("directory").notNull(), 14 + description: text("description"), 15 + expiresAt: timestamp("expires_at"), 16 + createdAt: timestamp("created_at").defaultNow().notNull(), 17 + }); 18 + 19 + export type SelectBakcup = InferSelectModel<typeof backups>; 20 + export type InsertBackup = InferInsertModel<typeof backups>; 21 + 22 + export default backups;
+2
apps/api/src/schema/index.ts
··· 18 18 import spriteAuth from "./sprite-auth"; 19 19 import vercelAuth from "./vercel-auth"; 20 20 import sandboxCp from "./sandbox-cp"; 21 + import backups from "./backups"; 21 22 22 23 export default { 23 24 sandboxes, ··· 40 41 spriteAuth, 41 42 vercelAuth, 42 43 sandboxCp, 44 + backups, 43 45 };
-3
apps/cf-sandbox/deploy/pkgx/wrangler.jsonc
··· 12 12 "main": "src/index.ts", 13 13 "compatibility_date": "2025-05-06", 14 14 "compatibility_flags": ["nodejs_compat"], 15 - "observability": { 16 - "enabled": true, 17 - }, 18 15 "r2_buckets": [ 19 16 { 20 17 "binding": "POCKETENV_COPY",
+10
apps/cf-sandbox/drizzle/0041_slippery_sunspot.sql
··· 1 + CREATE TABLE "backups" ( 2 + "id" text PRIMARY KEY DEFAULT xata_id() NOT NULL, 3 + "sandbox_id" text NOT NULL, 4 + "backup_id" text NOT NULL, 5 + "directory" text NOT NULL, 6 + "description" text, 7 + "created_at" timestamp DEFAULT now() NOT NULL 8 + ); 9 + --> statement-breakpoint 10 + ALTER TABLE "backups" ADD CONSTRAINT "backups_sandbox_id_sandboxes_id_fk" FOREIGN KEY ("sandbox_id") REFERENCES "public"."sandboxes"("id") ON DELETE cascade ON UPDATE no action;
+1
apps/cf-sandbox/drizzle/0042_awesome_havok.sql
··· 1 + ALTER TABLE "backups" ADD COLUMN "expires_at" timestamp;
+1975
apps/cf-sandbox/drizzle/meta/0041_snapshot.json
··· 1 + { 2 + "id": "11b98563-4936-4b10-bef9-20d2f241bfb5", 3 + "prevId": "c774999c-f2ee-4f9e-9650-a616eb7e8c03", 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.backups": { 61 + "name": "backups", 62 + "schema": "", 63 + "columns": { 64 + "id": { 65 + "name": "id", 66 + "type": "text", 67 + "primaryKey": true, 68 + "notNull": true, 69 + "default": "xata_id()" 70 + }, 71 + "sandbox_id": { 72 + "name": "sandbox_id", 73 + "type": "text", 74 + "primaryKey": false, 75 + "notNull": true 76 + }, 77 + "backup_id": { 78 + "name": "backup_id", 79 + "type": "text", 80 + "primaryKey": false, 81 + "notNull": true 82 + }, 83 + "directory": { 84 + "name": "directory", 85 + "type": "text", 86 + "primaryKey": false, 87 + "notNull": true 88 + }, 89 + "description": { 90 + "name": "description", 91 + "type": "text", 92 + "primaryKey": false, 93 + "notNull": false 94 + }, 95 + "created_at": { 96 + "name": "created_at", 97 + "type": "timestamp", 98 + "primaryKey": false, 99 + "notNull": true, 100 + "default": "now()" 101 + } 102 + }, 103 + "indexes": {}, 104 + "foreignKeys": { 105 + "backups_sandbox_id_sandboxes_id_fk": { 106 + "name": "backups_sandbox_id_sandboxes_id_fk", 107 + "tableFrom": "backups", 108 + "tableTo": "sandboxes", 109 + "columnsFrom": [ 110 + "sandbox_id" 111 + ], 112 + "columnsTo": [ 113 + "id" 114 + ], 115 + "onDelete": "cascade", 116 + "onUpdate": "no action" 117 + } 118 + }, 119 + "compositePrimaryKeys": {}, 120 + "uniqueConstraints": {}, 121 + "policies": {}, 122 + "checkConstraints": {}, 123 + "isRLSEnabled": false 124 + }, 125 + "public.daytona_auth": { 126 + "name": "daytona_auth", 127 + "schema": "", 128 + "columns": { 129 + "id": { 130 + "name": "id", 131 + "type": "text", 132 + "primaryKey": true, 133 + "notNull": true, 134 + "default": "xata_id()" 135 + }, 136 + "sandbox_id": { 137 + "name": "sandbox_id", 138 + "type": "text", 139 + "primaryKey": false, 140 + "notNull": true 141 + }, 142 + "user_id": { 143 + "name": "user_id", 144 + "type": "text", 145 + "primaryKey": false, 146 + "notNull": true 147 + }, 148 + "api_key": { 149 + "name": "api_key", 150 + "type": "text", 151 + "primaryKey": false, 152 + "notNull": true 153 + }, 154 + "organization_id": { 155 + "name": "organization_id", 156 + "type": "text", 157 + "primaryKey": false, 158 + "notNull": true 159 + }, 160 + "redacted_api_key": { 161 + "name": "redacted_api_key", 162 + "type": "text", 163 + "primaryKey": false, 164 + "notNull": true 165 + }, 166 + "created_at": { 167 + "name": "created_at", 168 + "type": "timestamp", 169 + "primaryKey": false, 170 + "notNull": true, 171 + "default": "now()" 172 + } 173 + }, 174 + "indexes": { 175 + "unique_daytona_auth": { 176 + "name": "unique_daytona_auth", 177 + "columns": [ 178 + { 179 + "expression": "sandbox_id", 180 + "isExpression": false, 181 + "asc": true, 182 + "nulls": "last" 183 + }, 184 + { 185 + "expression": "user_id", 186 + "isExpression": false, 187 + "asc": true, 188 + "nulls": "last" 189 + } 190 + ], 191 + "isUnique": true, 192 + "concurrently": false, 193 + "method": "btree", 194 + "with": {} 195 + } 196 + }, 197 + "foreignKeys": { 198 + "daytona_auth_sandbox_id_sandboxes_id_fk": { 199 + "name": "daytona_auth_sandbox_id_sandboxes_id_fk", 200 + "tableFrom": "daytona_auth", 201 + "tableTo": "sandboxes", 202 + "columnsFrom": [ 203 + "sandbox_id" 204 + ], 205 + "columnsTo": [ 206 + "id" 207 + ], 208 + "onDelete": "cascade", 209 + "onUpdate": "no action" 210 + }, 211 + "daytona_auth_user_id_users_id_fk": { 212 + "name": "daytona_auth_user_id_users_id_fk", 213 + "tableFrom": "daytona_auth", 214 + "tableTo": "users", 215 + "columnsFrom": [ 216 + "user_id" 217 + ], 218 + "columnsTo": [ 219 + "id" 220 + ], 221 + "onDelete": "no action", 222 + "onUpdate": "no action" 223 + } 224 + }, 225 + "compositePrimaryKeys": {}, 226 + "uniqueConstraints": {}, 227 + "policies": {}, 228 + "checkConstraints": {}, 229 + "isRLSEnabled": false 230 + }, 231 + "public.deno_auth": { 232 + "name": "deno_auth", 233 + "schema": "", 234 + "columns": { 235 + "id": { 236 + "name": "id", 237 + "type": "text", 238 + "primaryKey": true, 239 + "notNull": true, 240 + "default": "xata_id()" 241 + }, 242 + "sandbox_id": { 243 + "name": "sandbox_id", 244 + "type": "text", 245 + "primaryKey": false, 246 + "notNull": true 247 + }, 248 + "deploy_token": { 249 + "name": "deploy_token", 250 + "type": "text", 251 + "primaryKey": false, 252 + "notNull": true 253 + }, 254 + "user_id": { 255 + "name": "user_id", 256 + "type": "text", 257 + "primaryKey": false, 258 + "notNull": true 259 + }, 260 + "redacted_deno_token": { 261 + "name": "redacted_deno_token", 262 + "type": "text", 263 + "primaryKey": false, 264 + "notNull": true 265 + }, 266 + "created_at": { 267 + "name": "created_at", 268 + "type": "timestamp", 269 + "primaryKey": false, 270 + "notNull": true, 271 + "default": "now()" 272 + } 273 + }, 274 + "indexes": { 275 + "unique_deno_auth": { 276 + "name": "unique_deno_auth", 277 + "columns": [ 278 + { 279 + "expression": "sandbox_id", 280 + "isExpression": false, 281 + "asc": true, 282 + "nulls": "last" 283 + }, 284 + { 285 + "expression": "user_id", 286 + "isExpression": false, 287 + "asc": true, 288 + "nulls": "last" 289 + } 290 + ], 291 + "isUnique": true, 292 + "concurrently": false, 293 + "method": "btree", 294 + "with": {} 295 + } 296 + }, 297 + "foreignKeys": { 298 + "deno_auth_sandbox_id_sandboxes_id_fk": { 299 + "name": "deno_auth_sandbox_id_sandboxes_id_fk", 300 + "tableFrom": "deno_auth", 301 + "tableTo": "sandboxes", 302 + "columnsFrom": [ 303 + "sandbox_id" 304 + ], 305 + "columnsTo": [ 306 + "id" 307 + ], 308 + "onDelete": "cascade", 309 + "onUpdate": "no action" 310 + }, 311 + "deno_auth_user_id_users_id_fk": { 312 + "name": "deno_auth_user_id_users_id_fk", 313 + "tableFrom": "deno_auth", 314 + "tableTo": "users", 315 + "columnsFrom": [ 316 + "user_id" 317 + ], 318 + "columnsTo": [ 319 + "id" 320 + ], 321 + "onDelete": "no action", 322 + "onUpdate": "no action" 323 + } 324 + }, 325 + "compositePrimaryKeys": {}, 326 + "uniqueConstraints": {}, 327 + "policies": {}, 328 + "checkConstraints": {}, 329 + "isRLSEnabled": false 330 + }, 331 + "public.files": { 332 + "name": "files", 333 + "schema": "", 334 + "columns": { 335 + "id": { 336 + "name": "id", 337 + "type": "text", 338 + "primaryKey": true, 339 + "notNull": true, 340 + "default": "xata_id()" 341 + }, 342 + "content": { 343 + "name": "content", 344 + "type": "text", 345 + "primaryKey": false, 346 + "notNull": true 347 + }, 348 + "created_at": { 349 + "name": "created_at", 350 + "type": "timestamp", 351 + "primaryKey": false, 352 + "notNull": true, 353 + "default": "now()" 354 + }, 355 + "updated_at": { 356 + "name": "updated_at", 357 + "type": "timestamp", 358 + "primaryKey": false, 359 + "notNull": true, 360 + "default": "now()" 361 + } 362 + }, 363 + "indexes": {}, 364 + "foreignKeys": {}, 365 + "compositePrimaryKeys": {}, 366 + "uniqueConstraints": {}, 367 + "policies": {}, 368 + "checkConstraints": {}, 369 + "isRLSEnabled": false 370 + }, 371 + "public.sandbox_cp": { 372 + "name": "sandbox_cp", 373 + "schema": "", 374 + "columns": { 375 + "id": { 376 + "name": "id", 377 + "type": "text", 378 + "primaryKey": true, 379 + "notNull": true, 380 + "default": "xata_id()" 381 + }, 382 + "copy_uuid": { 383 + "name": "copy_uuid", 384 + "type": "text", 385 + "primaryKey": false, 386 + "notNull": true 387 + }, 388 + "created_at": { 389 + "name": "created_at", 390 + "type": "timestamp", 391 + "primaryKey": false, 392 + "notNull": true, 393 + "default": "now()" 394 + } 395 + }, 396 + "indexes": {}, 397 + "foreignKeys": {}, 398 + "compositePrimaryKeys": {}, 399 + "uniqueConstraints": { 400 + "sandbox_cp_copy_uuid_unique": { 401 + "name": "sandbox_cp_copy_uuid_unique", 402 + "nullsNotDistinct": false, 403 + "columns": [ 404 + "copy_uuid" 405 + ] 406 + } 407 + }, 408 + "policies": {}, 409 + "checkConstraints": {}, 410 + "isRLSEnabled": false 411 + }, 412 + "public.sandbox_files": { 413 + "name": "sandbox_files", 414 + "schema": "", 415 + "columns": { 416 + "id": { 417 + "name": "id", 418 + "type": "text", 419 + "primaryKey": true, 420 + "notNull": true, 421 + "default": "file_id()" 422 + }, 423 + "sandbox_id": { 424 + "name": "sandbox_id", 425 + "type": "text", 426 + "primaryKey": false, 427 + "notNull": true 428 + }, 429 + "file_id": { 430 + "name": "file_id", 431 + "type": "text", 432 + "primaryKey": false, 433 + "notNull": true 434 + }, 435 + "path": { 436 + "name": "path", 437 + "type": "text", 438 + "primaryKey": false, 439 + "notNull": true 440 + }, 441 + "created_at": { 442 + "name": "created_at", 443 + "type": "timestamp", 444 + "primaryKey": false, 445 + "notNull": true, 446 + "default": "now()" 447 + }, 448 + "updated_at": { 449 + "name": "updated_at", 450 + "type": "timestamp", 451 + "primaryKey": false, 452 + "notNull": true, 453 + "default": "now()" 454 + } 455 + }, 456 + "indexes": { 457 + "unique_sandbox_file_path": { 458 + "name": "unique_sandbox_file_path", 459 + "columns": [ 460 + { 461 + "expression": "sandbox_id", 462 + "isExpression": false, 463 + "asc": true, 464 + "nulls": "last" 465 + }, 466 + { 467 + "expression": "path", 468 + "isExpression": false, 469 + "asc": true, 470 + "nulls": "last" 471 + } 472 + ], 473 + "isUnique": true, 474 + "concurrently": false, 475 + "method": "btree", 476 + "with": {} 477 + } 478 + }, 479 + "foreignKeys": { 480 + "sandbox_files_sandbox_id_sandboxes_id_fk": { 481 + "name": "sandbox_files_sandbox_id_sandboxes_id_fk", 482 + "tableFrom": "sandbox_files", 483 + "tableTo": "sandboxes", 484 + "columnsFrom": [ 485 + "sandbox_id" 486 + ], 487 + "columnsTo": [ 488 + "id" 489 + ], 490 + "onDelete": "cascade", 491 + "onUpdate": "no action" 492 + }, 493 + "sandbox_files_file_id_files_id_fk": { 494 + "name": "sandbox_files_file_id_files_id_fk", 495 + "tableFrom": "sandbox_files", 496 + "tableTo": "files", 497 + "columnsFrom": [ 498 + "file_id" 499 + ], 500 + "columnsTo": [ 501 + "id" 502 + ], 503 + "onDelete": "no action", 504 + "onUpdate": "no action" 505 + } 506 + }, 507 + "compositePrimaryKeys": {}, 508 + "uniqueConstraints": {}, 509 + "policies": {}, 510 + "checkConstraints": {}, 511 + "isRLSEnabled": false 512 + }, 513 + "public.sandbox_ports": { 514 + "name": "sandbox_ports", 515 + "schema": "", 516 + "columns": { 517 + "id": { 518 + "name": "id", 519 + "type": "text", 520 + "primaryKey": true, 521 + "notNull": true, 522 + "default": "xata_id()" 523 + }, 524 + "sandbox_id": { 525 + "name": "sandbox_id", 526 + "type": "text", 527 + "primaryKey": false, 528 + "notNull": true 529 + }, 530 + "exposed_port": { 531 + "name": "exposed_port", 532 + "type": "integer", 533 + "primaryKey": false, 534 + "notNull": true 535 + }, 536 + "preview_url": { 537 + "name": "preview_url", 538 + "type": "text", 539 + "primaryKey": false, 540 + "notNull": false 541 + }, 542 + "description": { 543 + "name": "description", 544 + "type": "text", 545 + "primaryKey": false, 546 + "notNull": false 547 + }, 548 + "service_id": { 549 + "name": "service_id", 550 + "type": "text", 551 + "primaryKey": false, 552 + "notNull": false 553 + }, 554 + "created_at": { 555 + "name": "created_at", 556 + "type": "timestamp", 557 + "primaryKey": false, 558 + "notNull": true, 559 + "default": "now()" 560 + }, 561 + "updated_at": { 562 + "name": "updated_at", 563 + "type": "timestamp", 564 + "primaryKey": false, 565 + "notNull": true, 566 + "default": "now()" 567 + } 568 + }, 569 + "indexes": { 570 + "unique_sandbox_port": { 571 + "name": "unique_sandbox_port", 572 + "columns": [ 573 + { 574 + "expression": "sandbox_id", 575 + "isExpression": false, 576 + "asc": true, 577 + "nulls": "last" 578 + }, 579 + { 580 + "expression": "exposed_port", 581 + "isExpression": false, 582 + "asc": true, 583 + "nulls": "last" 584 + } 585 + ], 586 + "isUnique": true, 587 + "concurrently": false, 588 + "method": "btree", 589 + "with": {} 590 + } 591 + }, 592 + "foreignKeys": { 593 + "sandbox_ports_sandbox_id_sandboxes_id_fk": { 594 + "name": "sandbox_ports_sandbox_id_sandboxes_id_fk", 595 + "tableFrom": "sandbox_ports", 596 + "tableTo": "sandboxes", 597 + "columnsFrom": [ 598 + "sandbox_id" 599 + ], 600 + "columnsTo": [ 601 + "id" 602 + ], 603 + "onDelete": "cascade", 604 + "onUpdate": "no action" 605 + }, 606 + "sandbox_ports_service_id_services_id_fk": { 607 + "name": "sandbox_ports_service_id_services_id_fk", 608 + "tableFrom": "sandbox_ports", 609 + "tableTo": "services", 610 + "columnsFrom": [ 611 + "service_id" 612 + ], 613 + "columnsTo": [ 614 + "id" 615 + ], 616 + "onDelete": "no action", 617 + "onUpdate": "no action" 618 + } 619 + }, 620 + "compositePrimaryKeys": {}, 621 + "uniqueConstraints": {}, 622 + "policies": {}, 623 + "checkConstraints": {}, 624 + "isRLSEnabled": false 625 + }, 626 + "public.sandbox_secrets": { 627 + "name": "sandbox_secrets", 628 + "schema": "", 629 + "columns": { 630 + "id": { 631 + "name": "id", 632 + "type": "text", 633 + "primaryKey": true, 634 + "notNull": true, 635 + "default": "xata_id()" 636 + }, 637 + "sandbox_id": { 638 + "name": "sandbox_id", 639 + "type": "text", 640 + "primaryKey": false, 641 + "notNull": true 642 + }, 643 + "secret_id": { 644 + "name": "secret_id", 645 + "type": "text", 646 + "primaryKey": false, 647 + "notNull": true 648 + }, 649 + "name": { 650 + "name": "name", 651 + "type": "text", 652 + "primaryKey": false, 653 + "notNull": false 654 + }, 655 + "created_at": { 656 + "name": "created_at", 657 + "type": "timestamp", 658 + "primaryKey": false, 659 + "notNull": true, 660 + "default": "now()" 661 + }, 662 + "updated_at": { 663 + "name": "updated_at", 664 + "type": "timestamp", 665 + "primaryKey": false, 666 + "notNull": true, 667 + "default": "now()" 668 + } 669 + }, 670 + "indexes": { 671 + "unique_sandbox_secret_by_name": { 672 + "name": "unique_sandbox_secret_by_name", 673 + "columns": [ 674 + { 675 + "expression": "sandbox_id", 676 + "isExpression": false, 677 + "asc": true, 678 + "nulls": "last" 679 + }, 680 + { 681 + "expression": "name", 682 + "isExpression": false, 683 + "asc": true, 684 + "nulls": "last" 685 + } 686 + ], 687 + "isUnique": true, 688 + "concurrently": false, 689 + "method": "btree", 690 + "with": {} 691 + } 692 + }, 693 + "foreignKeys": { 694 + "sandbox_secrets_sandbox_id_sandboxes_id_fk": { 695 + "name": "sandbox_secrets_sandbox_id_sandboxes_id_fk", 696 + "tableFrom": "sandbox_secrets", 697 + "tableTo": "sandboxes", 698 + "columnsFrom": [ 699 + "sandbox_id" 700 + ], 701 + "columnsTo": [ 702 + "id" 703 + ], 704 + "onDelete": "cascade", 705 + "onUpdate": "no action" 706 + }, 707 + "sandbox_secrets_secret_id_secrets_id_fk": { 708 + "name": "sandbox_secrets_secret_id_secrets_id_fk", 709 + "tableFrom": "sandbox_secrets", 710 + "tableTo": "secrets", 711 + "columnsFrom": [ 712 + "secret_id" 713 + ], 714 + "columnsTo": [ 715 + "id" 716 + ], 717 + "onDelete": "no action", 718 + "onUpdate": "no action" 719 + } 720 + }, 721 + "compositePrimaryKeys": {}, 722 + "uniqueConstraints": {}, 723 + "policies": {}, 724 + "checkConstraints": {}, 725 + "isRLSEnabled": false 726 + }, 727 + "public.sandbox_variables": { 728 + "name": "sandbox_variables", 729 + "schema": "", 730 + "columns": { 731 + "id": { 732 + "name": "id", 733 + "type": "text", 734 + "primaryKey": true, 735 + "notNull": true, 736 + "default": "xata_id()" 737 + }, 738 + "sandbox_id": { 739 + "name": "sandbox_id", 740 + "type": "text", 741 + "primaryKey": false, 742 + "notNull": true 743 + }, 744 + "variable_id": { 745 + "name": "variable_id", 746 + "type": "text", 747 + "primaryKey": false, 748 + "notNull": true 749 + }, 750 + "name": { 751 + "name": "name", 752 + "type": "text", 753 + "primaryKey": false, 754 + "notNull": true 755 + }, 756 + "created_at": { 757 + "name": "created_at", 758 + "type": "timestamp", 759 + "primaryKey": false, 760 + "notNull": true, 761 + "default": "now()" 762 + }, 763 + "updated_at": { 764 + "name": "updated_at", 765 + "type": "timestamp", 766 + "primaryKey": false, 767 + "notNull": true, 768 + "default": "now()" 769 + } 770 + }, 771 + "indexes": { 772 + "unique_sandbox_variables_by_name": { 773 + "name": "unique_sandbox_variables_by_name", 774 + "columns": [ 775 + { 776 + "expression": "sandbox_id", 777 + "isExpression": false, 778 + "asc": true, 779 + "nulls": "last" 780 + }, 781 + { 782 + "expression": "name", 783 + "isExpression": false, 784 + "asc": true, 785 + "nulls": "last" 786 + } 787 + ], 788 + "isUnique": true, 789 + "concurrently": false, 790 + "method": "btree", 791 + "with": {} 792 + } 793 + }, 794 + "foreignKeys": { 795 + "sandbox_variables_sandbox_id_sandboxes_id_fk": { 796 + "name": "sandbox_variables_sandbox_id_sandboxes_id_fk", 797 + "tableFrom": "sandbox_variables", 798 + "tableTo": "sandboxes", 799 + "columnsFrom": [ 800 + "sandbox_id" 801 + ], 802 + "columnsTo": [ 803 + "id" 804 + ], 805 + "onDelete": "cascade", 806 + "onUpdate": "no action" 807 + }, 808 + "sandbox_variables_variable_id_variables_id_fk": { 809 + "name": "sandbox_variables_variable_id_variables_id_fk", 810 + "tableFrom": "sandbox_variables", 811 + "tableTo": "variables", 812 + "columnsFrom": [ 813 + "variable_id" 814 + ], 815 + "columnsTo": [ 816 + "id" 817 + ], 818 + "onDelete": "no action", 819 + "onUpdate": "no action" 820 + } 821 + }, 822 + "compositePrimaryKeys": {}, 823 + "uniqueConstraints": {}, 824 + "policies": {}, 825 + "checkConstraints": {}, 826 + "isRLSEnabled": false 827 + }, 828 + "public.sandbox_volumes": { 829 + "name": "sandbox_volumes", 830 + "schema": "", 831 + "columns": { 832 + "id": { 833 + "name": "id", 834 + "type": "text", 835 + "primaryKey": true, 836 + "notNull": true, 837 + "default": "volume_id()" 838 + }, 839 + "sandbox_id": { 840 + "name": "sandbox_id", 841 + "type": "text", 842 + "primaryKey": false, 843 + "notNull": true 844 + }, 845 + "volume_id": { 846 + "name": "volume_id", 847 + "type": "text", 848 + "primaryKey": false, 849 + "notNull": true 850 + }, 851 + "name": { 852 + "name": "name", 853 + "type": "text", 854 + "primaryKey": false, 855 + "notNull": false 856 + }, 857 + "path": { 858 + "name": "path", 859 + "type": "text", 860 + "primaryKey": false, 861 + "notNull": true 862 + }, 863 + "created_at": { 864 + "name": "created_at", 865 + "type": "timestamp", 866 + "primaryKey": false, 867 + "notNull": true, 868 + "default": "now()" 869 + }, 870 + "updated_at": { 871 + "name": "updated_at", 872 + "type": "timestamp", 873 + "primaryKey": false, 874 + "notNull": true, 875 + "default": "now()" 876 + } 877 + }, 878 + "indexes": { 879 + "unique_sandbox_volume_path": { 880 + "name": "unique_sandbox_volume_path", 881 + "columns": [ 882 + { 883 + "expression": "sandbox_id", 884 + "isExpression": false, 885 + "asc": true, 886 + "nulls": "last" 887 + }, 888 + { 889 + "expression": "path", 890 + "isExpression": false, 891 + "asc": true, 892 + "nulls": "last" 893 + } 894 + ], 895 + "isUnique": true, 896 + "concurrently": false, 897 + "method": "btree", 898 + "with": {} 899 + } 900 + }, 901 + "foreignKeys": { 902 + "sandbox_volumes_sandbox_id_sandboxes_id_fk": { 903 + "name": "sandbox_volumes_sandbox_id_sandboxes_id_fk", 904 + "tableFrom": "sandbox_volumes", 905 + "tableTo": "sandboxes", 906 + "columnsFrom": [ 907 + "sandbox_id" 908 + ], 909 + "columnsTo": [ 910 + "id" 911 + ], 912 + "onDelete": "cascade", 913 + "onUpdate": "no action" 914 + }, 915 + "sandbox_volumes_volume_id_volumes_id_fk": { 916 + "name": "sandbox_volumes_volume_id_volumes_id_fk", 917 + "tableFrom": "sandbox_volumes", 918 + "tableTo": "volumes", 919 + "columnsFrom": [ 920 + "volume_id" 921 + ], 922 + "columnsTo": [ 923 + "id" 924 + ], 925 + "onDelete": "no action", 926 + "onUpdate": "no action" 927 + } 928 + }, 929 + "compositePrimaryKeys": {}, 930 + "uniqueConstraints": {}, 931 + "policies": {}, 932 + "checkConstraints": {}, 933 + "isRLSEnabled": false 934 + }, 935 + "public.sandboxes": { 936 + "name": "sandboxes", 937 + "schema": "", 938 + "columns": { 939 + "id": { 940 + "name": "id", 941 + "type": "text", 942 + "primaryKey": true, 943 + "notNull": true, 944 + "default": "sandbox_id()" 945 + }, 946 + "base": { 947 + "name": "base", 948 + "type": "text", 949 + "primaryKey": false, 950 + "notNull": false 951 + }, 952 + "name": { 953 + "name": "name", 954 + "type": "text", 955 + "primaryKey": false, 956 + "notNull": true 957 + }, 958 + "display_name": { 959 + "name": "display_name", 960 + "type": "text", 961 + "primaryKey": false, 962 + "notNull": false 963 + }, 964 + "uri": { 965 + "name": "uri", 966 + "type": "text", 967 + "primaryKey": false, 968 + "notNull": false 969 + }, 970 + "cid": { 971 + "name": "cid", 972 + "type": "text", 973 + "primaryKey": false, 974 + "notNull": false 975 + }, 976 + "repo": { 977 + "name": "repo", 978 + "type": "text", 979 + "primaryKey": false, 980 + "notNull": false 981 + }, 982 + "provider": { 983 + "name": "provider", 984 + "type": "text", 985 + "primaryKey": false, 986 + "notNull": true, 987 + "default": "'cloudflare'" 988 + }, 989 + "description": { 990 + "name": "description", 991 + "type": "text", 992 + "primaryKey": false, 993 + "notNull": false 994 + }, 995 + "topics": { 996 + "name": "topics", 997 + "type": "text[]", 998 + "primaryKey": false, 999 + "notNull": false 1000 + }, 1001 + "logo": { 1002 + "name": "logo", 1003 + "type": "text", 1004 + "primaryKey": false, 1005 + "notNull": false 1006 + }, 1007 + "readme": { 1008 + "name": "readme", 1009 + "type": "text", 1010 + "primaryKey": false, 1011 + "notNull": false 1012 + }, 1013 + "public_key": { 1014 + "name": "public_key", 1015 + "type": "text", 1016 + "primaryKey": false, 1017 + "notNull": true 1018 + }, 1019 + "user_id": { 1020 + "name": "user_id", 1021 + "type": "text", 1022 + "primaryKey": false, 1023 + "notNull": false 1024 + }, 1025 + "instance_type": { 1026 + "name": "instance_type", 1027 + "type": "text", 1028 + "primaryKey": false, 1029 + "notNull": false 1030 + }, 1031 + "vcpus": { 1032 + "name": "vcpus", 1033 + "type": "integer", 1034 + "primaryKey": false, 1035 + "notNull": false 1036 + }, 1037 + "memory": { 1038 + "name": "memory", 1039 + "type": "integer", 1040 + "primaryKey": false, 1041 + "notNull": false 1042 + }, 1043 + "disk": { 1044 + "name": "disk", 1045 + "type": "integer", 1046 + "primaryKey": false, 1047 + "notNull": false 1048 + }, 1049 + "status": { 1050 + "name": "status", 1051 + "type": "text", 1052 + "primaryKey": false, 1053 + "notNull": true 1054 + }, 1055 + "keep_alive": { 1056 + "name": "keep_alive", 1057 + "type": "boolean", 1058 + "primaryKey": false, 1059 + "notNull": true, 1060 + "default": false 1061 + }, 1062 + "sleep_after": { 1063 + "name": "sleep_after", 1064 + "type": "text", 1065 + "primaryKey": false, 1066 + "notNull": false 1067 + }, 1068 + "sandbox_id": { 1069 + "name": "sandbox_id", 1070 + "type": "text", 1071 + "primaryKey": false, 1072 + "notNull": false 1073 + }, 1074 + "installs": { 1075 + "name": "installs", 1076 + "type": "integer", 1077 + "primaryKey": false, 1078 + "notNull": true, 1079 + "default": 0 1080 + }, 1081 + "started_at": { 1082 + "name": "started_at", 1083 + "type": "timestamp", 1084 + "primaryKey": false, 1085 + "notNull": false 1086 + }, 1087 + "created_at": { 1088 + "name": "created_at", 1089 + "type": "timestamp", 1090 + "primaryKey": false, 1091 + "notNull": true, 1092 + "default": "now()" 1093 + }, 1094 + "updated_at": { 1095 + "name": "updated_at", 1096 + "type": "timestamp", 1097 + "primaryKey": false, 1098 + "notNull": true, 1099 + "default": "now()" 1100 + } 1101 + }, 1102 + "indexes": {}, 1103 + "foreignKeys": { 1104 + "sandboxes_user_id_users_id_fk": { 1105 + "name": "sandboxes_user_id_users_id_fk", 1106 + "tableFrom": "sandboxes", 1107 + "tableTo": "users", 1108 + "columnsFrom": [ 1109 + "user_id" 1110 + ], 1111 + "columnsTo": [ 1112 + "id" 1113 + ], 1114 + "onDelete": "no action", 1115 + "onUpdate": "no action" 1116 + } 1117 + }, 1118 + "compositePrimaryKeys": {}, 1119 + "uniqueConstraints": { 1120 + "sandboxes_name_unique": { 1121 + "name": "sandboxes_name_unique", 1122 + "nullsNotDistinct": false, 1123 + "columns": [ 1124 + "name" 1125 + ] 1126 + }, 1127 + "sandboxes_uri_unique": { 1128 + "name": "sandboxes_uri_unique", 1129 + "nullsNotDistinct": false, 1130 + "columns": [ 1131 + "uri" 1132 + ] 1133 + }, 1134 + "sandboxes_cid_unique": { 1135 + "name": "sandboxes_cid_unique", 1136 + "nullsNotDistinct": false, 1137 + "columns": [ 1138 + "cid" 1139 + ] 1140 + } 1141 + }, 1142 + "policies": {}, 1143 + "checkConstraints": {}, 1144 + "isRLSEnabled": false 1145 + }, 1146 + "public.secrets": { 1147 + "name": "secrets", 1148 + "schema": "", 1149 + "columns": { 1150 + "id": { 1151 + "name": "id", 1152 + "type": "text", 1153 + "primaryKey": true, 1154 + "notNull": true, 1155 + "default": "secret_id()" 1156 + }, 1157 + "name": { 1158 + "name": "name", 1159 + "type": "text", 1160 + "primaryKey": false, 1161 + "notNull": true 1162 + }, 1163 + "value": { 1164 + "name": "value", 1165 + "type": "text", 1166 + "primaryKey": false, 1167 + "notNull": true 1168 + }, 1169 + "redacted": { 1170 + "name": "redacted", 1171 + "type": "text", 1172 + "primaryKey": false, 1173 + "notNull": false 1174 + }, 1175 + "created_at": { 1176 + "name": "created_at", 1177 + "type": "timestamp", 1178 + "primaryKey": false, 1179 + "notNull": true, 1180 + "default": "now()" 1181 + } 1182 + }, 1183 + "indexes": {}, 1184 + "foreignKeys": {}, 1185 + "compositePrimaryKeys": {}, 1186 + "uniqueConstraints": {}, 1187 + "policies": {}, 1188 + "checkConstraints": {}, 1189 + "isRLSEnabled": false 1190 + }, 1191 + "public.services": { 1192 + "name": "services", 1193 + "schema": "", 1194 + "columns": { 1195 + "id": { 1196 + "name": "id", 1197 + "type": "text", 1198 + "primaryKey": true, 1199 + "notNull": true, 1200 + "default": "xata_id()" 1201 + }, 1202 + "sandbox_id": { 1203 + "name": "sandbox_id", 1204 + "type": "text", 1205 + "primaryKey": false, 1206 + "notNull": true 1207 + }, 1208 + "name": { 1209 + "name": "name", 1210 + "type": "text", 1211 + "primaryKey": false, 1212 + "notNull": true 1213 + }, 1214 + "command": { 1215 + "name": "command", 1216 + "type": "text", 1217 + "primaryKey": false, 1218 + "notNull": true 1219 + }, 1220 + "description": { 1221 + "name": "description", 1222 + "type": "text", 1223 + "primaryKey": false, 1224 + "notNull": false 1225 + }, 1226 + "service_id": { 1227 + "name": "service_id", 1228 + "type": "text", 1229 + "primaryKey": false, 1230 + "notNull": false 1231 + }, 1232 + "status": { 1233 + "name": "status", 1234 + "type": "text", 1235 + "primaryKey": false, 1236 + "notNull": true, 1237 + "default": "'STOPPED'" 1238 + }, 1239 + "created_at": { 1240 + "name": "created_at", 1241 + "type": "timestamp", 1242 + "primaryKey": false, 1243 + "notNull": true, 1244 + "default": "now()" 1245 + }, 1246 + "updated_at": { 1247 + "name": "updated_at", 1248 + "type": "timestamp", 1249 + "primaryKey": false, 1250 + "notNull": true, 1251 + "default": "now()" 1252 + } 1253 + }, 1254 + "indexes": { 1255 + "unique_sandbox_service": { 1256 + "name": "unique_sandbox_service", 1257 + "columns": [ 1258 + { 1259 + "expression": "name", 1260 + "isExpression": false, 1261 + "asc": true, 1262 + "nulls": "last" 1263 + }, 1264 + { 1265 + "expression": "sandbox_id", 1266 + "isExpression": false, 1267 + "asc": true, 1268 + "nulls": "last" 1269 + } 1270 + ], 1271 + "isUnique": true, 1272 + "concurrently": false, 1273 + "method": "btree", 1274 + "with": {} 1275 + } 1276 + }, 1277 + "foreignKeys": { 1278 + "services_sandbox_id_sandboxes_id_fk": { 1279 + "name": "services_sandbox_id_sandboxes_id_fk", 1280 + "tableFrom": "services", 1281 + "tableTo": "sandboxes", 1282 + "columnsFrom": [ 1283 + "sandbox_id" 1284 + ], 1285 + "columnsTo": [ 1286 + "id" 1287 + ], 1288 + "onDelete": "cascade", 1289 + "onUpdate": "no action" 1290 + } 1291 + }, 1292 + "compositePrimaryKeys": {}, 1293 + "uniqueConstraints": {}, 1294 + "policies": {}, 1295 + "checkConstraints": {}, 1296 + "isRLSEnabled": false 1297 + }, 1298 + "public.snapshots": { 1299 + "name": "snapshots", 1300 + "schema": "", 1301 + "columns": { 1302 + "id": { 1303 + "name": "id", 1304 + "type": "text", 1305 + "primaryKey": true, 1306 + "notNull": true, 1307 + "default": "snapshot_id()" 1308 + }, 1309 + "slug": { 1310 + "name": "slug", 1311 + "type": "text", 1312 + "primaryKey": false, 1313 + "notNull": true 1314 + }, 1315 + "created_at": { 1316 + "name": "created_at", 1317 + "type": "timestamp", 1318 + "primaryKey": false, 1319 + "notNull": true, 1320 + "default": "now()" 1321 + } 1322 + }, 1323 + "indexes": {}, 1324 + "foreignKeys": {}, 1325 + "compositePrimaryKeys": {}, 1326 + "uniqueConstraints": { 1327 + "snapshots_slug_unique": { 1328 + "name": "snapshots_slug_unique", 1329 + "nullsNotDistinct": false, 1330 + "columns": [ 1331 + "slug" 1332 + ] 1333 + } 1334 + }, 1335 + "policies": {}, 1336 + "checkConstraints": {}, 1337 + "isRLSEnabled": false 1338 + }, 1339 + "public.sprite_auth": { 1340 + "name": "sprite_auth", 1341 + "schema": "", 1342 + "columns": { 1343 + "id": { 1344 + "name": "id", 1345 + "type": "text", 1346 + "primaryKey": true, 1347 + "notNull": true, 1348 + "default": "xata_id()" 1349 + }, 1350 + "sandbox_id": { 1351 + "name": "sandbox_id", 1352 + "type": "text", 1353 + "primaryKey": false, 1354 + "notNull": true 1355 + }, 1356 + "user_id": { 1357 + "name": "user_id", 1358 + "type": "text", 1359 + "primaryKey": false, 1360 + "notNull": true 1361 + }, 1362 + "sprite_token": { 1363 + "name": "sprite_token", 1364 + "type": "text", 1365 + "primaryKey": false, 1366 + "notNull": true 1367 + }, 1368 + "redacted_sprite_token": { 1369 + "name": "redacted_sprite_token", 1370 + "type": "text", 1371 + "primaryKey": false, 1372 + "notNull": true 1373 + }, 1374 + "created_at": { 1375 + "name": "created_at", 1376 + "type": "timestamp", 1377 + "primaryKey": false, 1378 + "notNull": true, 1379 + "default": "now()" 1380 + } 1381 + }, 1382 + "indexes": { 1383 + "unique_sprite_auth": { 1384 + "name": "unique_sprite_auth", 1385 + "columns": [ 1386 + { 1387 + "expression": "sandbox_id", 1388 + "isExpression": false, 1389 + "asc": true, 1390 + "nulls": "last" 1391 + }, 1392 + { 1393 + "expression": "user_id", 1394 + "isExpression": false, 1395 + "asc": true, 1396 + "nulls": "last" 1397 + } 1398 + ], 1399 + "isUnique": true, 1400 + "concurrently": false, 1401 + "method": "btree", 1402 + "with": {} 1403 + } 1404 + }, 1405 + "foreignKeys": { 1406 + "sprite_auth_sandbox_id_sandboxes_id_fk": { 1407 + "name": "sprite_auth_sandbox_id_sandboxes_id_fk", 1408 + "tableFrom": "sprite_auth", 1409 + "tableTo": "sandboxes", 1410 + "columnsFrom": [ 1411 + "sandbox_id" 1412 + ], 1413 + "columnsTo": [ 1414 + "id" 1415 + ], 1416 + "onDelete": "cascade", 1417 + "onUpdate": "no action" 1418 + }, 1419 + "sprite_auth_user_id_users_id_fk": { 1420 + "name": "sprite_auth_user_id_users_id_fk", 1421 + "tableFrom": "sprite_auth", 1422 + "tableTo": "users", 1423 + "columnsFrom": [ 1424 + "user_id" 1425 + ], 1426 + "columnsTo": [ 1427 + "id" 1428 + ], 1429 + "onDelete": "no action", 1430 + "onUpdate": "no action" 1431 + } 1432 + }, 1433 + "compositePrimaryKeys": {}, 1434 + "uniqueConstraints": {}, 1435 + "policies": {}, 1436 + "checkConstraints": {}, 1437 + "isRLSEnabled": false 1438 + }, 1439 + "public.ssh_keys": { 1440 + "name": "ssh_keys", 1441 + "schema": "", 1442 + "columns": { 1443 + "id": { 1444 + "name": "id", 1445 + "type": "text", 1446 + "primaryKey": true, 1447 + "notNull": true, 1448 + "default": "xata_id()" 1449 + }, 1450 + "sandbox_id": { 1451 + "name": "sandbox_id", 1452 + "type": "text", 1453 + "primaryKey": false, 1454 + "notNull": true 1455 + }, 1456 + "public_key": { 1457 + "name": "public_key", 1458 + "type": "text", 1459 + "primaryKey": false, 1460 + "notNull": true 1461 + }, 1462 + "private_key": { 1463 + "name": "private_key", 1464 + "type": "text", 1465 + "primaryKey": false, 1466 + "notNull": true 1467 + }, 1468 + "redacted": { 1469 + "name": "redacted", 1470 + "type": "text", 1471 + "primaryKey": false, 1472 + "notNull": false 1473 + }, 1474 + "created_at": { 1475 + "name": "created_at", 1476 + "type": "timestamp", 1477 + "primaryKey": false, 1478 + "notNull": true, 1479 + "default": "now()" 1480 + } 1481 + }, 1482 + "indexes": { 1483 + "unique_sandbox_ssh_key": { 1484 + "name": "unique_sandbox_ssh_key", 1485 + "columns": [ 1486 + { 1487 + "expression": "public_key", 1488 + "isExpression": false, 1489 + "asc": true, 1490 + "nulls": "last" 1491 + }, 1492 + { 1493 + "expression": "sandbox_id", 1494 + "isExpression": false, 1495 + "asc": true, 1496 + "nulls": "last" 1497 + } 1498 + ], 1499 + "isUnique": true, 1500 + "concurrently": false, 1501 + "method": "btree", 1502 + "with": {} 1503 + } 1504 + }, 1505 + "foreignKeys": { 1506 + "ssh_keys_sandbox_id_sandboxes_id_fk": { 1507 + "name": "ssh_keys_sandbox_id_sandboxes_id_fk", 1508 + "tableFrom": "ssh_keys", 1509 + "tableTo": "sandboxes", 1510 + "columnsFrom": [ 1511 + "sandbox_id" 1512 + ], 1513 + "columnsTo": [ 1514 + "id" 1515 + ], 1516 + "onDelete": "cascade", 1517 + "onUpdate": "no action" 1518 + } 1519 + }, 1520 + "compositePrimaryKeys": {}, 1521 + "uniqueConstraints": {}, 1522 + "policies": {}, 1523 + "checkConstraints": {}, 1524 + "isRLSEnabled": false 1525 + }, 1526 + "public.tailscale_auth_keys": { 1527 + "name": "tailscale_auth_keys", 1528 + "schema": "", 1529 + "columns": { 1530 + "id": { 1531 + "name": "id", 1532 + "type": "text", 1533 + "primaryKey": true, 1534 + "notNull": true, 1535 + "default": "xata_id()" 1536 + }, 1537 + "sandbox_id": { 1538 + "name": "sandbox_id", 1539 + "type": "text", 1540 + "primaryKey": false, 1541 + "notNull": true 1542 + }, 1543 + "auth_key": { 1544 + "name": "auth_key", 1545 + "type": "text", 1546 + "primaryKey": false, 1547 + "notNull": true 1548 + }, 1549 + "redacted": { 1550 + "name": "redacted", 1551 + "type": "text", 1552 + "primaryKey": false, 1553 + "notNull": true 1554 + }, 1555 + "created_at": { 1556 + "name": "created_at", 1557 + "type": "timestamp", 1558 + "primaryKey": false, 1559 + "notNull": true, 1560 + "default": "now()" 1561 + } 1562 + }, 1563 + "indexes": {}, 1564 + "foreignKeys": { 1565 + "tailscale_auth_keys_sandbox_id_sandboxes_id_fk": { 1566 + "name": "tailscale_auth_keys_sandbox_id_sandboxes_id_fk", 1567 + "tableFrom": "tailscale_auth_keys", 1568 + "tableTo": "sandboxes", 1569 + "columnsFrom": [ 1570 + "sandbox_id" 1571 + ], 1572 + "columnsTo": [ 1573 + "id" 1574 + ], 1575 + "onDelete": "cascade", 1576 + "onUpdate": "no action" 1577 + } 1578 + }, 1579 + "compositePrimaryKeys": {}, 1580 + "uniqueConstraints": {}, 1581 + "policies": {}, 1582 + "checkConstraints": {}, 1583 + "isRLSEnabled": false 1584 + }, 1585 + "public.users": { 1586 + "name": "users", 1587 + "schema": "", 1588 + "columns": { 1589 + "id": { 1590 + "name": "id", 1591 + "type": "text", 1592 + "primaryKey": true, 1593 + "notNull": true, 1594 + "default": "xata_id()" 1595 + }, 1596 + "did": { 1597 + "name": "did", 1598 + "type": "text", 1599 + "primaryKey": false, 1600 + "notNull": true 1601 + }, 1602 + "display_name": { 1603 + "name": "display_name", 1604 + "type": "text", 1605 + "primaryKey": false, 1606 + "notNull": false 1607 + }, 1608 + "handle": { 1609 + "name": "handle", 1610 + "type": "text", 1611 + "primaryKey": false, 1612 + "notNull": true 1613 + }, 1614 + "avatar": { 1615 + "name": "avatar", 1616 + "type": "text", 1617 + "primaryKey": false, 1618 + "notNull": false 1619 + }, 1620 + "created_at": { 1621 + "name": "created_at", 1622 + "type": "timestamp", 1623 + "primaryKey": false, 1624 + "notNull": true, 1625 + "default": "now()" 1626 + }, 1627 + "updated_at": { 1628 + "name": "updated_at", 1629 + "type": "timestamp", 1630 + "primaryKey": false, 1631 + "notNull": true, 1632 + "default": "now()" 1633 + } 1634 + }, 1635 + "indexes": {}, 1636 + "foreignKeys": {}, 1637 + "compositePrimaryKeys": {}, 1638 + "uniqueConstraints": { 1639 + "users_did_unique": { 1640 + "name": "users_did_unique", 1641 + "nullsNotDistinct": false, 1642 + "columns": [ 1643 + "did" 1644 + ] 1645 + }, 1646 + "users_handle_unique": { 1647 + "name": "users_handle_unique", 1648 + "nullsNotDistinct": false, 1649 + "columns": [ 1650 + "handle" 1651 + ] 1652 + } 1653 + }, 1654 + "policies": {}, 1655 + "checkConstraints": {}, 1656 + "isRLSEnabled": false 1657 + }, 1658 + "public.variables": { 1659 + "name": "variables", 1660 + "schema": "", 1661 + "columns": { 1662 + "id": { 1663 + "name": "id", 1664 + "type": "text", 1665 + "primaryKey": true, 1666 + "notNull": true, 1667 + "default": "variable_id()" 1668 + }, 1669 + "name": { 1670 + "name": "name", 1671 + "type": "text", 1672 + "primaryKey": false, 1673 + "notNull": true 1674 + }, 1675 + "value": { 1676 + "name": "value", 1677 + "type": "text", 1678 + "primaryKey": false, 1679 + "notNull": true 1680 + }, 1681 + "created_at": { 1682 + "name": "created_at", 1683 + "type": "timestamp", 1684 + "primaryKey": false, 1685 + "notNull": true, 1686 + "default": "now()" 1687 + }, 1688 + "updated_at": { 1689 + "name": "updated_at", 1690 + "type": "timestamp", 1691 + "primaryKey": false, 1692 + "notNull": true, 1693 + "default": "now()" 1694 + } 1695 + }, 1696 + "indexes": {}, 1697 + "foreignKeys": {}, 1698 + "compositePrimaryKeys": {}, 1699 + "uniqueConstraints": {}, 1700 + "policies": {}, 1701 + "checkConstraints": {}, 1702 + "isRLSEnabled": false 1703 + }, 1704 + "public.vercel_auth": { 1705 + "name": "vercel_auth", 1706 + "schema": "", 1707 + "columns": { 1708 + "id": { 1709 + "name": "id", 1710 + "type": "text", 1711 + "primaryKey": true, 1712 + "notNull": true, 1713 + "default": "xata_id()" 1714 + }, 1715 + "sandbox_id": { 1716 + "name": "sandbox_id", 1717 + "type": "text", 1718 + "primaryKey": false, 1719 + "notNull": true 1720 + }, 1721 + "user_id": { 1722 + "name": "user_id", 1723 + "type": "text", 1724 + "primaryKey": false, 1725 + "notNull": true 1726 + }, 1727 + "vercel_token": { 1728 + "name": "vercel_token", 1729 + "type": "text", 1730 + "primaryKey": false, 1731 + "notNull": true 1732 + }, 1733 + "redacted_vercel_token": { 1734 + "name": "redacted_vercel_token", 1735 + "type": "text", 1736 + "primaryKey": false, 1737 + "notNull": true 1738 + }, 1739 + "project_id": { 1740 + "name": "project_id", 1741 + "type": "text", 1742 + "primaryKey": false, 1743 + "notNull": true 1744 + }, 1745 + "team_id": { 1746 + "name": "team_id", 1747 + "type": "text", 1748 + "primaryKey": false, 1749 + "notNull": true 1750 + }, 1751 + "created_at": { 1752 + "name": "created_at", 1753 + "type": "timestamp", 1754 + "primaryKey": false, 1755 + "notNull": true, 1756 + "default": "now()" 1757 + } 1758 + }, 1759 + "indexes": { 1760 + "unique_vercel_auth": { 1761 + "name": "unique_vercel_auth", 1762 + "columns": [ 1763 + { 1764 + "expression": "sandbox_id", 1765 + "isExpression": false, 1766 + "asc": true, 1767 + "nulls": "last" 1768 + }, 1769 + { 1770 + "expression": "user_id", 1771 + "isExpression": false, 1772 + "asc": true, 1773 + "nulls": "last" 1774 + } 1775 + ], 1776 + "isUnique": true, 1777 + "concurrently": false, 1778 + "method": "btree", 1779 + "with": {} 1780 + } 1781 + }, 1782 + "foreignKeys": { 1783 + "vercel_auth_sandbox_id_sandboxes_id_fk": { 1784 + "name": "vercel_auth_sandbox_id_sandboxes_id_fk", 1785 + "tableFrom": "vercel_auth", 1786 + "tableTo": "sandboxes", 1787 + "columnsFrom": [ 1788 + "sandbox_id" 1789 + ], 1790 + "columnsTo": [ 1791 + "id" 1792 + ], 1793 + "onDelete": "cascade", 1794 + "onUpdate": "no action" 1795 + }, 1796 + "vercel_auth_user_id_users_id_fk": { 1797 + "name": "vercel_auth_user_id_users_id_fk", 1798 + "tableFrom": "vercel_auth", 1799 + "tableTo": "users", 1800 + "columnsFrom": [ 1801 + "user_id" 1802 + ], 1803 + "columnsTo": [ 1804 + "id" 1805 + ], 1806 + "onDelete": "no action", 1807 + "onUpdate": "no action" 1808 + } 1809 + }, 1810 + "compositePrimaryKeys": {}, 1811 + "uniqueConstraints": {}, 1812 + "policies": {}, 1813 + "checkConstraints": {}, 1814 + "isRLSEnabled": false 1815 + }, 1816 + "public.volumes": { 1817 + "name": "volumes", 1818 + "schema": "", 1819 + "columns": { 1820 + "id": { 1821 + "name": "id", 1822 + "type": "text", 1823 + "primaryKey": true, 1824 + "notNull": true, 1825 + "default": "volume_id()" 1826 + }, 1827 + "slug": { 1828 + "name": "slug", 1829 + "type": "text", 1830 + "primaryKey": false, 1831 + "notNull": true 1832 + }, 1833 + "size": { 1834 + "name": "size", 1835 + "type": "integer", 1836 + "primaryKey": false, 1837 + "notNull": true 1838 + }, 1839 + "size_unit": { 1840 + "name": "size_unit", 1841 + "type": "text", 1842 + "primaryKey": false, 1843 + "notNull": true 1844 + }, 1845 + "created_at": { 1846 + "name": "created_at", 1847 + "type": "timestamp", 1848 + "primaryKey": false, 1849 + "notNull": true, 1850 + "default": "now()" 1851 + }, 1852 + "updated_at": { 1853 + "name": "updated_at", 1854 + "type": "timestamp", 1855 + "primaryKey": false, 1856 + "notNull": true, 1857 + "default": "now()" 1858 + } 1859 + }, 1860 + "indexes": {}, 1861 + "foreignKeys": {}, 1862 + "compositePrimaryKeys": {}, 1863 + "uniqueConstraints": { 1864 + "volumes_slug_unique": { 1865 + "name": "volumes_slug_unique", 1866 + "nullsNotDistinct": false, 1867 + "columns": [ 1868 + "slug" 1869 + ] 1870 + } 1871 + }, 1872 + "policies": {}, 1873 + "checkConstraints": {}, 1874 + "isRLSEnabled": false 1875 + }, 1876 + "public.integrations": { 1877 + "name": "integrations", 1878 + "schema": "", 1879 + "columns": { 1880 + "id": { 1881 + "name": "id", 1882 + "type": "text", 1883 + "primaryKey": true, 1884 + "notNull": true, 1885 + "default": "xata_id()" 1886 + }, 1887 + "sandbox_id": { 1888 + "name": "sandbox_id", 1889 + "type": "text", 1890 + "primaryKey": false, 1891 + "notNull": true 1892 + }, 1893 + "name": { 1894 + "name": "name", 1895 + "type": "text", 1896 + "primaryKey": false, 1897 + "notNull": true 1898 + }, 1899 + "description": { 1900 + "name": "description", 1901 + "type": "text", 1902 + "primaryKey": false, 1903 + "notNull": false 1904 + }, 1905 + "webhook_url": { 1906 + "name": "webhook_url", 1907 + "type": "text", 1908 + "primaryKey": false, 1909 + "notNull": true 1910 + }, 1911 + "created_at": { 1912 + "name": "created_at", 1913 + "type": "timestamp", 1914 + "primaryKey": false, 1915 + "notNull": true, 1916 + "default": "now()" 1917 + } 1918 + }, 1919 + "indexes": { 1920 + "unique_sandbox_integration": { 1921 + "name": "unique_sandbox_integration", 1922 + "columns": [ 1923 + { 1924 + "expression": "sandbox_id", 1925 + "isExpression": false, 1926 + "asc": true, 1927 + "nulls": "last" 1928 + }, 1929 + { 1930 + "expression": "name", 1931 + "isExpression": false, 1932 + "asc": true, 1933 + "nulls": "last" 1934 + } 1935 + ], 1936 + "isUnique": true, 1937 + "concurrently": false, 1938 + "method": "btree", 1939 + "with": {} 1940 + } 1941 + }, 1942 + "foreignKeys": { 1943 + "integrations_sandbox_id_sandboxes_id_fk": { 1944 + "name": "integrations_sandbox_id_sandboxes_id_fk", 1945 + "tableFrom": "integrations", 1946 + "tableTo": "sandboxes", 1947 + "columnsFrom": [ 1948 + "sandbox_id" 1949 + ], 1950 + "columnsTo": [ 1951 + "id" 1952 + ], 1953 + "onDelete": "cascade", 1954 + "onUpdate": "no action" 1955 + } 1956 + }, 1957 + "compositePrimaryKeys": {}, 1958 + "uniqueConstraints": {}, 1959 + "policies": {}, 1960 + "checkConstraints": {}, 1961 + "isRLSEnabled": false 1962 + } 1963 + }, 1964 + "enums": {}, 1965 + "schemas": {}, 1966 + "sequences": {}, 1967 + "roles": {}, 1968 + "policies": {}, 1969 + "views": {}, 1970 + "_meta": { 1971 + "columns": {}, 1972 + "schemas": {}, 1973 + "tables": {} 1974 + } 1975 + }
+1981
apps/cf-sandbox/drizzle/meta/0042_snapshot.json
··· 1 + { 2 + "id": "b8efac8c-de18-420c-8621-74850b2771ef", 3 + "prevId": "11b98563-4936-4b10-bef9-20d2f241bfb5", 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.backups": { 61 + "name": "backups", 62 + "schema": "", 63 + "columns": { 64 + "id": { 65 + "name": "id", 66 + "type": "text", 67 + "primaryKey": true, 68 + "notNull": true, 69 + "default": "xata_id()" 70 + }, 71 + "sandbox_id": { 72 + "name": "sandbox_id", 73 + "type": "text", 74 + "primaryKey": false, 75 + "notNull": true 76 + }, 77 + "backup_id": { 78 + "name": "backup_id", 79 + "type": "text", 80 + "primaryKey": false, 81 + "notNull": true 82 + }, 83 + "directory": { 84 + "name": "directory", 85 + "type": "text", 86 + "primaryKey": false, 87 + "notNull": true 88 + }, 89 + "description": { 90 + "name": "description", 91 + "type": "text", 92 + "primaryKey": false, 93 + "notNull": false 94 + }, 95 + "expires_at": { 96 + "name": "expires_at", 97 + "type": "timestamp", 98 + "primaryKey": false, 99 + "notNull": false 100 + }, 101 + "created_at": { 102 + "name": "created_at", 103 + "type": "timestamp", 104 + "primaryKey": false, 105 + "notNull": true, 106 + "default": "now()" 107 + } 108 + }, 109 + "indexes": {}, 110 + "foreignKeys": { 111 + "backups_sandbox_id_sandboxes_id_fk": { 112 + "name": "backups_sandbox_id_sandboxes_id_fk", 113 + "tableFrom": "backups", 114 + "tableTo": "sandboxes", 115 + "columnsFrom": [ 116 + "sandbox_id" 117 + ], 118 + "columnsTo": [ 119 + "id" 120 + ], 121 + "onDelete": "cascade", 122 + "onUpdate": "no action" 123 + } 124 + }, 125 + "compositePrimaryKeys": {}, 126 + "uniqueConstraints": {}, 127 + "policies": {}, 128 + "checkConstraints": {}, 129 + "isRLSEnabled": false 130 + }, 131 + "public.daytona_auth": { 132 + "name": "daytona_auth", 133 + "schema": "", 134 + "columns": { 135 + "id": { 136 + "name": "id", 137 + "type": "text", 138 + "primaryKey": true, 139 + "notNull": true, 140 + "default": "xata_id()" 141 + }, 142 + "sandbox_id": { 143 + "name": "sandbox_id", 144 + "type": "text", 145 + "primaryKey": false, 146 + "notNull": true 147 + }, 148 + "user_id": { 149 + "name": "user_id", 150 + "type": "text", 151 + "primaryKey": false, 152 + "notNull": true 153 + }, 154 + "api_key": { 155 + "name": "api_key", 156 + "type": "text", 157 + "primaryKey": false, 158 + "notNull": true 159 + }, 160 + "organization_id": { 161 + "name": "organization_id", 162 + "type": "text", 163 + "primaryKey": false, 164 + "notNull": true 165 + }, 166 + "redacted_api_key": { 167 + "name": "redacted_api_key", 168 + "type": "text", 169 + "primaryKey": false, 170 + "notNull": true 171 + }, 172 + "created_at": { 173 + "name": "created_at", 174 + "type": "timestamp", 175 + "primaryKey": false, 176 + "notNull": true, 177 + "default": "now()" 178 + } 179 + }, 180 + "indexes": { 181 + "unique_daytona_auth": { 182 + "name": "unique_daytona_auth", 183 + "columns": [ 184 + { 185 + "expression": "sandbox_id", 186 + "isExpression": false, 187 + "asc": true, 188 + "nulls": "last" 189 + }, 190 + { 191 + "expression": "user_id", 192 + "isExpression": false, 193 + "asc": true, 194 + "nulls": "last" 195 + } 196 + ], 197 + "isUnique": true, 198 + "concurrently": false, 199 + "method": "btree", 200 + "with": {} 201 + } 202 + }, 203 + "foreignKeys": { 204 + "daytona_auth_sandbox_id_sandboxes_id_fk": { 205 + "name": "daytona_auth_sandbox_id_sandboxes_id_fk", 206 + "tableFrom": "daytona_auth", 207 + "tableTo": "sandboxes", 208 + "columnsFrom": [ 209 + "sandbox_id" 210 + ], 211 + "columnsTo": [ 212 + "id" 213 + ], 214 + "onDelete": "cascade", 215 + "onUpdate": "no action" 216 + }, 217 + "daytona_auth_user_id_users_id_fk": { 218 + "name": "daytona_auth_user_id_users_id_fk", 219 + "tableFrom": "daytona_auth", 220 + "tableTo": "users", 221 + "columnsFrom": [ 222 + "user_id" 223 + ], 224 + "columnsTo": [ 225 + "id" 226 + ], 227 + "onDelete": "no action", 228 + "onUpdate": "no action" 229 + } 230 + }, 231 + "compositePrimaryKeys": {}, 232 + "uniqueConstraints": {}, 233 + "policies": {}, 234 + "checkConstraints": {}, 235 + "isRLSEnabled": false 236 + }, 237 + "public.deno_auth": { 238 + "name": "deno_auth", 239 + "schema": "", 240 + "columns": { 241 + "id": { 242 + "name": "id", 243 + "type": "text", 244 + "primaryKey": true, 245 + "notNull": true, 246 + "default": "xata_id()" 247 + }, 248 + "sandbox_id": { 249 + "name": "sandbox_id", 250 + "type": "text", 251 + "primaryKey": false, 252 + "notNull": true 253 + }, 254 + "deploy_token": { 255 + "name": "deploy_token", 256 + "type": "text", 257 + "primaryKey": false, 258 + "notNull": true 259 + }, 260 + "user_id": { 261 + "name": "user_id", 262 + "type": "text", 263 + "primaryKey": false, 264 + "notNull": true 265 + }, 266 + "redacted_deno_token": { 267 + "name": "redacted_deno_token", 268 + "type": "text", 269 + "primaryKey": false, 270 + "notNull": true 271 + }, 272 + "created_at": { 273 + "name": "created_at", 274 + "type": "timestamp", 275 + "primaryKey": false, 276 + "notNull": true, 277 + "default": "now()" 278 + } 279 + }, 280 + "indexes": { 281 + "unique_deno_auth": { 282 + "name": "unique_deno_auth", 283 + "columns": [ 284 + { 285 + "expression": "sandbox_id", 286 + "isExpression": false, 287 + "asc": true, 288 + "nulls": "last" 289 + }, 290 + { 291 + "expression": "user_id", 292 + "isExpression": false, 293 + "asc": true, 294 + "nulls": "last" 295 + } 296 + ], 297 + "isUnique": true, 298 + "concurrently": false, 299 + "method": "btree", 300 + "with": {} 301 + } 302 + }, 303 + "foreignKeys": { 304 + "deno_auth_sandbox_id_sandboxes_id_fk": { 305 + "name": "deno_auth_sandbox_id_sandboxes_id_fk", 306 + "tableFrom": "deno_auth", 307 + "tableTo": "sandboxes", 308 + "columnsFrom": [ 309 + "sandbox_id" 310 + ], 311 + "columnsTo": [ 312 + "id" 313 + ], 314 + "onDelete": "cascade", 315 + "onUpdate": "no action" 316 + }, 317 + "deno_auth_user_id_users_id_fk": { 318 + "name": "deno_auth_user_id_users_id_fk", 319 + "tableFrom": "deno_auth", 320 + "tableTo": "users", 321 + "columnsFrom": [ 322 + "user_id" 323 + ], 324 + "columnsTo": [ 325 + "id" 326 + ], 327 + "onDelete": "no action", 328 + "onUpdate": "no action" 329 + } 330 + }, 331 + "compositePrimaryKeys": {}, 332 + "uniqueConstraints": {}, 333 + "policies": {}, 334 + "checkConstraints": {}, 335 + "isRLSEnabled": false 336 + }, 337 + "public.files": { 338 + "name": "files", 339 + "schema": "", 340 + "columns": { 341 + "id": { 342 + "name": "id", 343 + "type": "text", 344 + "primaryKey": true, 345 + "notNull": true, 346 + "default": "xata_id()" 347 + }, 348 + "content": { 349 + "name": "content", 350 + "type": "text", 351 + "primaryKey": false, 352 + "notNull": true 353 + }, 354 + "created_at": { 355 + "name": "created_at", 356 + "type": "timestamp", 357 + "primaryKey": false, 358 + "notNull": true, 359 + "default": "now()" 360 + }, 361 + "updated_at": { 362 + "name": "updated_at", 363 + "type": "timestamp", 364 + "primaryKey": false, 365 + "notNull": true, 366 + "default": "now()" 367 + } 368 + }, 369 + "indexes": {}, 370 + "foreignKeys": {}, 371 + "compositePrimaryKeys": {}, 372 + "uniqueConstraints": {}, 373 + "policies": {}, 374 + "checkConstraints": {}, 375 + "isRLSEnabled": false 376 + }, 377 + "public.sandbox_cp": { 378 + "name": "sandbox_cp", 379 + "schema": "", 380 + "columns": { 381 + "id": { 382 + "name": "id", 383 + "type": "text", 384 + "primaryKey": true, 385 + "notNull": true, 386 + "default": "xata_id()" 387 + }, 388 + "copy_uuid": { 389 + "name": "copy_uuid", 390 + "type": "text", 391 + "primaryKey": false, 392 + "notNull": true 393 + }, 394 + "created_at": { 395 + "name": "created_at", 396 + "type": "timestamp", 397 + "primaryKey": false, 398 + "notNull": true, 399 + "default": "now()" 400 + } 401 + }, 402 + "indexes": {}, 403 + "foreignKeys": {}, 404 + "compositePrimaryKeys": {}, 405 + "uniqueConstraints": { 406 + "sandbox_cp_copy_uuid_unique": { 407 + "name": "sandbox_cp_copy_uuid_unique", 408 + "nullsNotDistinct": false, 409 + "columns": [ 410 + "copy_uuid" 411 + ] 412 + } 413 + }, 414 + "policies": {}, 415 + "checkConstraints": {}, 416 + "isRLSEnabled": false 417 + }, 418 + "public.sandbox_files": { 419 + "name": "sandbox_files", 420 + "schema": "", 421 + "columns": { 422 + "id": { 423 + "name": "id", 424 + "type": "text", 425 + "primaryKey": true, 426 + "notNull": true, 427 + "default": "file_id()" 428 + }, 429 + "sandbox_id": { 430 + "name": "sandbox_id", 431 + "type": "text", 432 + "primaryKey": false, 433 + "notNull": true 434 + }, 435 + "file_id": { 436 + "name": "file_id", 437 + "type": "text", 438 + "primaryKey": false, 439 + "notNull": true 440 + }, 441 + "path": { 442 + "name": "path", 443 + "type": "text", 444 + "primaryKey": false, 445 + "notNull": true 446 + }, 447 + "created_at": { 448 + "name": "created_at", 449 + "type": "timestamp", 450 + "primaryKey": false, 451 + "notNull": true, 452 + "default": "now()" 453 + }, 454 + "updated_at": { 455 + "name": "updated_at", 456 + "type": "timestamp", 457 + "primaryKey": false, 458 + "notNull": true, 459 + "default": "now()" 460 + } 461 + }, 462 + "indexes": { 463 + "unique_sandbox_file_path": { 464 + "name": "unique_sandbox_file_path", 465 + "columns": [ 466 + { 467 + "expression": "sandbox_id", 468 + "isExpression": false, 469 + "asc": true, 470 + "nulls": "last" 471 + }, 472 + { 473 + "expression": "path", 474 + "isExpression": false, 475 + "asc": true, 476 + "nulls": "last" 477 + } 478 + ], 479 + "isUnique": true, 480 + "concurrently": false, 481 + "method": "btree", 482 + "with": {} 483 + } 484 + }, 485 + "foreignKeys": { 486 + "sandbox_files_sandbox_id_sandboxes_id_fk": { 487 + "name": "sandbox_files_sandbox_id_sandboxes_id_fk", 488 + "tableFrom": "sandbox_files", 489 + "tableTo": "sandboxes", 490 + "columnsFrom": [ 491 + "sandbox_id" 492 + ], 493 + "columnsTo": [ 494 + "id" 495 + ], 496 + "onDelete": "cascade", 497 + "onUpdate": "no action" 498 + }, 499 + "sandbox_files_file_id_files_id_fk": { 500 + "name": "sandbox_files_file_id_files_id_fk", 501 + "tableFrom": "sandbox_files", 502 + "tableTo": "files", 503 + "columnsFrom": [ 504 + "file_id" 505 + ], 506 + "columnsTo": [ 507 + "id" 508 + ], 509 + "onDelete": "no action", 510 + "onUpdate": "no action" 511 + } 512 + }, 513 + "compositePrimaryKeys": {}, 514 + "uniqueConstraints": {}, 515 + "policies": {}, 516 + "checkConstraints": {}, 517 + "isRLSEnabled": false 518 + }, 519 + "public.sandbox_ports": { 520 + "name": "sandbox_ports", 521 + "schema": "", 522 + "columns": { 523 + "id": { 524 + "name": "id", 525 + "type": "text", 526 + "primaryKey": true, 527 + "notNull": true, 528 + "default": "xata_id()" 529 + }, 530 + "sandbox_id": { 531 + "name": "sandbox_id", 532 + "type": "text", 533 + "primaryKey": false, 534 + "notNull": true 535 + }, 536 + "exposed_port": { 537 + "name": "exposed_port", 538 + "type": "integer", 539 + "primaryKey": false, 540 + "notNull": true 541 + }, 542 + "preview_url": { 543 + "name": "preview_url", 544 + "type": "text", 545 + "primaryKey": false, 546 + "notNull": false 547 + }, 548 + "description": { 549 + "name": "description", 550 + "type": "text", 551 + "primaryKey": false, 552 + "notNull": false 553 + }, 554 + "service_id": { 555 + "name": "service_id", 556 + "type": "text", 557 + "primaryKey": false, 558 + "notNull": false 559 + }, 560 + "created_at": { 561 + "name": "created_at", 562 + "type": "timestamp", 563 + "primaryKey": false, 564 + "notNull": true, 565 + "default": "now()" 566 + }, 567 + "updated_at": { 568 + "name": "updated_at", 569 + "type": "timestamp", 570 + "primaryKey": false, 571 + "notNull": true, 572 + "default": "now()" 573 + } 574 + }, 575 + "indexes": { 576 + "unique_sandbox_port": { 577 + "name": "unique_sandbox_port", 578 + "columns": [ 579 + { 580 + "expression": "sandbox_id", 581 + "isExpression": false, 582 + "asc": true, 583 + "nulls": "last" 584 + }, 585 + { 586 + "expression": "exposed_port", 587 + "isExpression": false, 588 + "asc": true, 589 + "nulls": "last" 590 + } 591 + ], 592 + "isUnique": true, 593 + "concurrently": false, 594 + "method": "btree", 595 + "with": {} 596 + } 597 + }, 598 + "foreignKeys": { 599 + "sandbox_ports_sandbox_id_sandboxes_id_fk": { 600 + "name": "sandbox_ports_sandbox_id_sandboxes_id_fk", 601 + "tableFrom": "sandbox_ports", 602 + "tableTo": "sandboxes", 603 + "columnsFrom": [ 604 + "sandbox_id" 605 + ], 606 + "columnsTo": [ 607 + "id" 608 + ], 609 + "onDelete": "cascade", 610 + "onUpdate": "no action" 611 + }, 612 + "sandbox_ports_service_id_services_id_fk": { 613 + "name": "sandbox_ports_service_id_services_id_fk", 614 + "tableFrom": "sandbox_ports", 615 + "tableTo": "services", 616 + "columnsFrom": [ 617 + "service_id" 618 + ], 619 + "columnsTo": [ 620 + "id" 621 + ], 622 + "onDelete": "no action", 623 + "onUpdate": "no action" 624 + } 625 + }, 626 + "compositePrimaryKeys": {}, 627 + "uniqueConstraints": {}, 628 + "policies": {}, 629 + "checkConstraints": {}, 630 + "isRLSEnabled": false 631 + }, 632 + "public.sandbox_secrets": { 633 + "name": "sandbox_secrets", 634 + "schema": "", 635 + "columns": { 636 + "id": { 637 + "name": "id", 638 + "type": "text", 639 + "primaryKey": true, 640 + "notNull": true, 641 + "default": "xata_id()" 642 + }, 643 + "sandbox_id": { 644 + "name": "sandbox_id", 645 + "type": "text", 646 + "primaryKey": false, 647 + "notNull": true 648 + }, 649 + "secret_id": { 650 + "name": "secret_id", 651 + "type": "text", 652 + "primaryKey": false, 653 + "notNull": true 654 + }, 655 + "name": { 656 + "name": "name", 657 + "type": "text", 658 + "primaryKey": false, 659 + "notNull": false 660 + }, 661 + "created_at": { 662 + "name": "created_at", 663 + "type": "timestamp", 664 + "primaryKey": false, 665 + "notNull": true, 666 + "default": "now()" 667 + }, 668 + "updated_at": { 669 + "name": "updated_at", 670 + "type": "timestamp", 671 + "primaryKey": false, 672 + "notNull": true, 673 + "default": "now()" 674 + } 675 + }, 676 + "indexes": { 677 + "unique_sandbox_secret_by_name": { 678 + "name": "unique_sandbox_secret_by_name", 679 + "columns": [ 680 + { 681 + "expression": "sandbox_id", 682 + "isExpression": false, 683 + "asc": true, 684 + "nulls": "last" 685 + }, 686 + { 687 + "expression": "name", 688 + "isExpression": false, 689 + "asc": true, 690 + "nulls": "last" 691 + } 692 + ], 693 + "isUnique": true, 694 + "concurrently": false, 695 + "method": "btree", 696 + "with": {} 697 + } 698 + }, 699 + "foreignKeys": { 700 + "sandbox_secrets_sandbox_id_sandboxes_id_fk": { 701 + "name": "sandbox_secrets_sandbox_id_sandboxes_id_fk", 702 + "tableFrom": "sandbox_secrets", 703 + "tableTo": "sandboxes", 704 + "columnsFrom": [ 705 + "sandbox_id" 706 + ], 707 + "columnsTo": [ 708 + "id" 709 + ], 710 + "onDelete": "cascade", 711 + "onUpdate": "no action" 712 + }, 713 + "sandbox_secrets_secret_id_secrets_id_fk": { 714 + "name": "sandbox_secrets_secret_id_secrets_id_fk", 715 + "tableFrom": "sandbox_secrets", 716 + "tableTo": "secrets", 717 + "columnsFrom": [ 718 + "secret_id" 719 + ], 720 + "columnsTo": [ 721 + "id" 722 + ], 723 + "onDelete": "no action", 724 + "onUpdate": "no action" 725 + } 726 + }, 727 + "compositePrimaryKeys": {}, 728 + "uniqueConstraints": {}, 729 + "policies": {}, 730 + "checkConstraints": {}, 731 + "isRLSEnabled": false 732 + }, 733 + "public.sandbox_variables": { 734 + "name": "sandbox_variables", 735 + "schema": "", 736 + "columns": { 737 + "id": { 738 + "name": "id", 739 + "type": "text", 740 + "primaryKey": true, 741 + "notNull": true, 742 + "default": "xata_id()" 743 + }, 744 + "sandbox_id": { 745 + "name": "sandbox_id", 746 + "type": "text", 747 + "primaryKey": false, 748 + "notNull": true 749 + }, 750 + "variable_id": { 751 + "name": "variable_id", 752 + "type": "text", 753 + "primaryKey": false, 754 + "notNull": true 755 + }, 756 + "name": { 757 + "name": "name", 758 + "type": "text", 759 + "primaryKey": false, 760 + "notNull": true 761 + }, 762 + "created_at": { 763 + "name": "created_at", 764 + "type": "timestamp", 765 + "primaryKey": false, 766 + "notNull": true, 767 + "default": "now()" 768 + }, 769 + "updated_at": { 770 + "name": "updated_at", 771 + "type": "timestamp", 772 + "primaryKey": false, 773 + "notNull": true, 774 + "default": "now()" 775 + } 776 + }, 777 + "indexes": { 778 + "unique_sandbox_variables_by_name": { 779 + "name": "unique_sandbox_variables_by_name", 780 + "columns": [ 781 + { 782 + "expression": "sandbox_id", 783 + "isExpression": false, 784 + "asc": true, 785 + "nulls": "last" 786 + }, 787 + { 788 + "expression": "name", 789 + "isExpression": false, 790 + "asc": true, 791 + "nulls": "last" 792 + } 793 + ], 794 + "isUnique": true, 795 + "concurrently": false, 796 + "method": "btree", 797 + "with": {} 798 + } 799 + }, 800 + "foreignKeys": { 801 + "sandbox_variables_sandbox_id_sandboxes_id_fk": { 802 + "name": "sandbox_variables_sandbox_id_sandboxes_id_fk", 803 + "tableFrom": "sandbox_variables", 804 + "tableTo": "sandboxes", 805 + "columnsFrom": [ 806 + "sandbox_id" 807 + ], 808 + "columnsTo": [ 809 + "id" 810 + ], 811 + "onDelete": "cascade", 812 + "onUpdate": "no action" 813 + }, 814 + "sandbox_variables_variable_id_variables_id_fk": { 815 + "name": "sandbox_variables_variable_id_variables_id_fk", 816 + "tableFrom": "sandbox_variables", 817 + "tableTo": "variables", 818 + "columnsFrom": [ 819 + "variable_id" 820 + ], 821 + "columnsTo": [ 822 + "id" 823 + ], 824 + "onDelete": "no action", 825 + "onUpdate": "no action" 826 + } 827 + }, 828 + "compositePrimaryKeys": {}, 829 + "uniqueConstraints": {}, 830 + "policies": {}, 831 + "checkConstraints": {}, 832 + "isRLSEnabled": false 833 + }, 834 + "public.sandbox_volumes": { 835 + "name": "sandbox_volumes", 836 + "schema": "", 837 + "columns": { 838 + "id": { 839 + "name": "id", 840 + "type": "text", 841 + "primaryKey": true, 842 + "notNull": true, 843 + "default": "volume_id()" 844 + }, 845 + "sandbox_id": { 846 + "name": "sandbox_id", 847 + "type": "text", 848 + "primaryKey": false, 849 + "notNull": true 850 + }, 851 + "volume_id": { 852 + "name": "volume_id", 853 + "type": "text", 854 + "primaryKey": false, 855 + "notNull": true 856 + }, 857 + "name": { 858 + "name": "name", 859 + "type": "text", 860 + "primaryKey": false, 861 + "notNull": false 862 + }, 863 + "path": { 864 + "name": "path", 865 + "type": "text", 866 + "primaryKey": false, 867 + "notNull": true 868 + }, 869 + "created_at": { 870 + "name": "created_at", 871 + "type": "timestamp", 872 + "primaryKey": false, 873 + "notNull": true, 874 + "default": "now()" 875 + }, 876 + "updated_at": { 877 + "name": "updated_at", 878 + "type": "timestamp", 879 + "primaryKey": false, 880 + "notNull": true, 881 + "default": "now()" 882 + } 883 + }, 884 + "indexes": { 885 + "unique_sandbox_volume_path": { 886 + "name": "unique_sandbox_volume_path", 887 + "columns": [ 888 + { 889 + "expression": "sandbox_id", 890 + "isExpression": false, 891 + "asc": true, 892 + "nulls": "last" 893 + }, 894 + { 895 + "expression": "path", 896 + "isExpression": false, 897 + "asc": true, 898 + "nulls": "last" 899 + } 900 + ], 901 + "isUnique": true, 902 + "concurrently": false, 903 + "method": "btree", 904 + "with": {} 905 + } 906 + }, 907 + "foreignKeys": { 908 + "sandbox_volumes_sandbox_id_sandboxes_id_fk": { 909 + "name": "sandbox_volumes_sandbox_id_sandboxes_id_fk", 910 + "tableFrom": "sandbox_volumes", 911 + "tableTo": "sandboxes", 912 + "columnsFrom": [ 913 + "sandbox_id" 914 + ], 915 + "columnsTo": [ 916 + "id" 917 + ], 918 + "onDelete": "cascade", 919 + "onUpdate": "no action" 920 + }, 921 + "sandbox_volumes_volume_id_volumes_id_fk": { 922 + "name": "sandbox_volumes_volume_id_volumes_id_fk", 923 + "tableFrom": "sandbox_volumes", 924 + "tableTo": "volumes", 925 + "columnsFrom": [ 926 + "volume_id" 927 + ], 928 + "columnsTo": [ 929 + "id" 930 + ], 931 + "onDelete": "no action", 932 + "onUpdate": "no action" 933 + } 934 + }, 935 + "compositePrimaryKeys": {}, 936 + "uniqueConstraints": {}, 937 + "policies": {}, 938 + "checkConstraints": {}, 939 + "isRLSEnabled": false 940 + }, 941 + "public.sandboxes": { 942 + "name": "sandboxes", 943 + "schema": "", 944 + "columns": { 945 + "id": { 946 + "name": "id", 947 + "type": "text", 948 + "primaryKey": true, 949 + "notNull": true, 950 + "default": "sandbox_id()" 951 + }, 952 + "base": { 953 + "name": "base", 954 + "type": "text", 955 + "primaryKey": false, 956 + "notNull": false 957 + }, 958 + "name": { 959 + "name": "name", 960 + "type": "text", 961 + "primaryKey": false, 962 + "notNull": true 963 + }, 964 + "display_name": { 965 + "name": "display_name", 966 + "type": "text", 967 + "primaryKey": false, 968 + "notNull": false 969 + }, 970 + "uri": { 971 + "name": "uri", 972 + "type": "text", 973 + "primaryKey": false, 974 + "notNull": false 975 + }, 976 + "cid": { 977 + "name": "cid", 978 + "type": "text", 979 + "primaryKey": false, 980 + "notNull": false 981 + }, 982 + "repo": { 983 + "name": "repo", 984 + "type": "text", 985 + "primaryKey": false, 986 + "notNull": false 987 + }, 988 + "provider": { 989 + "name": "provider", 990 + "type": "text", 991 + "primaryKey": false, 992 + "notNull": true, 993 + "default": "'cloudflare'" 994 + }, 995 + "description": { 996 + "name": "description", 997 + "type": "text", 998 + "primaryKey": false, 999 + "notNull": false 1000 + }, 1001 + "topics": { 1002 + "name": "topics", 1003 + "type": "text[]", 1004 + "primaryKey": false, 1005 + "notNull": false 1006 + }, 1007 + "logo": { 1008 + "name": "logo", 1009 + "type": "text", 1010 + "primaryKey": false, 1011 + "notNull": false 1012 + }, 1013 + "readme": { 1014 + "name": "readme", 1015 + "type": "text", 1016 + "primaryKey": false, 1017 + "notNull": false 1018 + }, 1019 + "public_key": { 1020 + "name": "public_key", 1021 + "type": "text", 1022 + "primaryKey": false, 1023 + "notNull": true 1024 + }, 1025 + "user_id": { 1026 + "name": "user_id", 1027 + "type": "text", 1028 + "primaryKey": false, 1029 + "notNull": false 1030 + }, 1031 + "instance_type": { 1032 + "name": "instance_type", 1033 + "type": "text", 1034 + "primaryKey": false, 1035 + "notNull": false 1036 + }, 1037 + "vcpus": { 1038 + "name": "vcpus", 1039 + "type": "integer", 1040 + "primaryKey": false, 1041 + "notNull": false 1042 + }, 1043 + "memory": { 1044 + "name": "memory", 1045 + "type": "integer", 1046 + "primaryKey": false, 1047 + "notNull": false 1048 + }, 1049 + "disk": { 1050 + "name": "disk", 1051 + "type": "integer", 1052 + "primaryKey": false, 1053 + "notNull": false 1054 + }, 1055 + "status": { 1056 + "name": "status", 1057 + "type": "text", 1058 + "primaryKey": false, 1059 + "notNull": true 1060 + }, 1061 + "keep_alive": { 1062 + "name": "keep_alive", 1063 + "type": "boolean", 1064 + "primaryKey": false, 1065 + "notNull": true, 1066 + "default": false 1067 + }, 1068 + "sleep_after": { 1069 + "name": "sleep_after", 1070 + "type": "text", 1071 + "primaryKey": false, 1072 + "notNull": false 1073 + }, 1074 + "sandbox_id": { 1075 + "name": "sandbox_id", 1076 + "type": "text", 1077 + "primaryKey": false, 1078 + "notNull": false 1079 + }, 1080 + "installs": { 1081 + "name": "installs", 1082 + "type": "integer", 1083 + "primaryKey": false, 1084 + "notNull": true, 1085 + "default": 0 1086 + }, 1087 + "started_at": { 1088 + "name": "started_at", 1089 + "type": "timestamp", 1090 + "primaryKey": false, 1091 + "notNull": false 1092 + }, 1093 + "created_at": { 1094 + "name": "created_at", 1095 + "type": "timestamp", 1096 + "primaryKey": false, 1097 + "notNull": true, 1098 + "default": "now()" 1099 + }, 1100 + "updated_at": { 1101 + "name": "updated_at", 1102 + "type": "timestamp", 1103 + "primaryKey": false, 1104 + "notNull": true, 1105 + "default": "now()" 1106 + } 1107 + }, 1108 + "indexes": {}, 1109 + "foreignKeys": { 1110 + "sandboxes_user_id_users_id_fk": { 1111 + "name": "sandboxes_user_id_users_id_fk", 1112 + "tableFrom": "sandboxes", 1113 + "tableTo": "users", 1114 + "columnsFrom": [ 1115 + "user_id" 1116 + ], 1117 + "columnsTo": [ 1118 + "id" 1119 + ], 1120 + "onDelete": "no action", 1121 + "onUpdate": "no action" 1122 + } 1123 + }, 1124 + "compositePrimaryKeys": {}, 1125 + "uniqueConstraints": { 1126 + "sandboxes_name_unique": { 1127 + "name": "sandboxes_name_unique", 1128 + "nullsNotDistinct": false, 1129 + "columns": [ 1130 + "name" 1131 + ] 1132 + }, 1133 + "sandboxes_uri_unique": { 1134 + "name": "sandboxes_uri_unique", 1135 + "nullsNotDistinct": false, 1136 + "columns": [ 1137 + "uri" 1138 + ] 1139 + }, 1140 + "sandboxes_cid_unique": { 1141 + "name": "sandboxes_cid_unique", 1142 + "nullsNotDistinct": false, 1143 + "columns": [ 1144 + "cid" 1145 + ] 1146 + } 1147 + }, 1148 + "policies": {}, 1149 + "checkConstraints": {}, 1150 + "isRLSEnabled": false 1151 + }, 1152 + "public.secrets": { 1153 + "name": "secrets", 1154 + "schema": "", 1155 + "columns": { 1156 + "id": { 1157 + "name": "id", 1158 + "type": "text", 1159 + "primaryKey": true, 1160 + "notNull": true, 1161 + "default": "secret_id()" 1162 + }, 1163 + "name": { 1164 + "name": "name", 1165 + "type": "text", 1166 + "primaryKey": false, 1167 + "notNull": true 1168 + }, 1169 + "value": { 1170 + "name": "value", 1171 + "type": "text", 1172 + "primaryKey": false, 1173 + "notNull": true 1174 + }, 1175 + "redacted": { 1176 + "name": "redacted", 1177 + "type": "text", 1178 + "primaryKey": false, 1179 + "notNull": false 1180 + }, 1181 + "created_at": { 1182 + "name": "created_at", 1183 + "type": "timestamp", 1184 + "primaryKey": false, 1185 + "notNull": true, 1186 + "default": "now()" 1187 + } 1188 + }, 1189 + "indexes": {}, 1190 + "foreignKeys": {}, 1191 + "compositePrimaryKeys": {}, 1192 + "uniqueConstraints": {}, 1193 + "policies": {}, 1194 + "checkConstraints": {}, 1195 + "isRLSEnabled": false 1196 + }, 1197 + "public.services": { 1198 + "name": "services", 1199 + "schema": "", 1200 + "columns": { 1201 + "id": { 1202 + "name": "id", 1203 + "type": "text", 1204 + "primaryKey": true, 1205 + "notNull": true, 1206 + "default": "xata_id()" 1207 + }, 1208 + "sandbox_id": { 1209 + "name": "sandbox_id", 1210 + "type": "text", 1211 + "primaryKey": false, 1212 + "notNull": true 1213 + }, 1214 + "name": { 1215 + "name": "name", 1216 + "type": "text", 1217 + "primaryKey": false, 1218 + "notNull": true 1219 + }, 1220 + "command": { 1221 + "name": "command", 1222 + "type": "text", 1223 + "primaryKey": false, 1224 + "notNull": true 1225 + }, 1226 + "description": { 1227 + "name": "description", 1228 + "type": "text", 1229 + "primaryKey": false, 1230 + "notNull": false 1231 + }, 1232 + "service_id": { 1233 + "name": "service_id", 1234 + "type": "text", 1235 + "primaryKey": false, 1236 + "notNull": false 1237 + }, 1238 + "status": { 1239 + "name": "status", 1240 + "type": "text", 1241 + "primaryKey": false, 1242 + "notNull": true, 1243 + "default": "'STOPPED'" 1244 + }, 1245 + "created_at": { 1246 + "name": "created_at", 1247 + "type": "timestamp", 1248 + "primaryKey": false, 1249 + "notNull": true, 1250 + "default": "now()" 1251 + }, 1252 + "updated_at": { 1253 + "name": "updated_at", 1254 + "type": "timestamp", 1255 + "primaryKey": false, 1256 + "notNull": true, 1257 + "default": "now()" 1258 + } 1259 + }, 1260 + "indexes": { 1261 + "unique_sandbox_service": { 1262 + "name": "unique_sandbox_service", 1263 + "columns": [ 1264 + { 1265 + "expression": "name", 1266 + "isExpression": false, 1267 + "asc": true, 1268 + "nulls": "last" 1269 + }, 1270 + { 1271 + "expression": "sandbox_id", 1272 + "isExpression": false, 1273 + "asc": true, 1274 + "nulls": "last" 1275 + } 1276 + ], 1277 + "isUnique": true, 1278 + "concurrently": false, 1279 + "method": "btree", 1280 + "with": {} 1281 + } 1282 + }, 1283 + "foreignKeys": { 1284 + "services_sandbox_id_sandboxes_id_fk": { 1285 + "name": "services_sandbox_id_sandboxes_id_fk", 1286 + "tableFrom": "services", 1287 + "tableTo": "sandboxes", 1288 + "columnsFrom": [ 1289 + "sandbox_id" 1290 + ], 1291 + "columnsTo": [ 1292 + "id" 1293 + ], 1294 + "onDelete": "cascade", 1295 + "onUpdate": "no action" 1296 + } 1297 + }, 1298 + "compositePrimaryKeys": {}, 1299 + "uniqueConstraints": {}, 1300 + "policies": {}, 1301 + "checkConstraints": {}, 1302 + "isRLSEnabled": false 1303 + }, 1304 + "public.snapshots": { 1305 + "name": "snapshots", 1306 + "schema": "", 1307 + "columns": { 1308 + "id": { 1309 + "name": "id", 1310 + "type": "text", 1311 + "primaryKey": true, 1312 + "notNull": true, 1313 + "default": "snapshot_id()" 1314 + }, 1315 + "slug": { 1316 + "name": "slug", 1317 + "type": "text", 1318 + "primaryKey": false, 1319 + "notNull": true 1320 + }, 1321 + "created_at": { 1322 + "name": "created_at", 1323 + "type": "timestamp", 1324 + "primaryKey": false, 1325 + "notNull": true, 1326 + "default": "now()" 1327 + } 1328 + }, 1329 + "indexes": {}, 1330 + "foreignKeys": {}, 1331 + "compositePrimaryKeys": {}, 1332 + "uniqueConstraints": { 1333 + "snapshots_slug_unique": { 1334 + "name": "snapshots_slug_unique", 1335 + "nullsNotDistinct": false, 1336 + "columns": [ 1337 + "slug" 1338 + ] 1339 + } 1340 + }, 1341 + "policies": {}, 1342 + "checkConstraints": {}, 1343 + "isRLSEnabled": false 1344 + }, 1345 + "public.sprite_auth": { 1346 + "name": "sprite_auth", 1347 + "schema": "", 1348 + "columns": { 1349 + "id": { 1350 + "name": "id", 1351 + "type": "text", 1352 + "primaryKey": true, 1353 + "notNull": true, 1354 + "default": "xata_id()" 1355 + }, 1356 + "sandbox_id": { 1357 + "name": "sandbox_id", 1358 + "type": "text", 1359 + "primaryKey": false, 1360 + "notNull": true 1361 + }, 1362 + "user_id": { 1363 + "name": "user_id", 1364 + "type": "text", 1365 + "primaryKey": false, 1366 + "notNull": true 1367 + }, 1368 + "sprite_token": { 1369 + "name": "sprite_token", 1370 + "type": "text", 1371 + "primaryKey": false, 1372 + "notNull": true 1373 + }, 1374 + "redacted_sprite_token": { 1375 + "name": "redacted_sprite_token", 1376 + "type": "text", 1377 + "primaryKey": false, 1378 + "notNull": true 1379 + }, 1380 + "created_at": { 1381 + "name": "created_at", 1382 + "type": "timestamp", 1383 + "primaryKey": false, 1384 + "notNull": true, 1385 + "default": "now()" 1386 + } 1387 + }, 1388 + "indexes": { 1389 + "unique_sprite_auth": { 1390 + "name": "unique_sprite_auth", 1391 + "columns": [ 1392 + { 1393 + "expression": "sandbox_id", 1394 + "isExpression": false, 1395 + "asc": true, 1396 + "nulls": "last" 1397 + }, 1398 + { 1399 + "expression": "user_id", 1400 + "isExpression": false, 1401 + "asc": true, 1402 + "nulls": "last" 1403 + } 1404 + ], 1405 + "isUnique": true, 1406 + "concurrently": false, 1407 + "method": "btree", 1408 + "with": {} 1409 + } 1410 + }, 1411 + "foreignKeys": { 1412 + "sprite_auth_sandbox_id_sandboxes_id_fk": { 1413 + "name": "sprite_auth_sandbox_id_sandboxes_id_fk", 1414 + "tableFrom": "sprite_auth", 1415 + "tableTo": "sandboxes", 1416 + "columnsFrom": [ 1417 + "sandbox_id" 1418 + ], 1419 + "columnsTo": [ 1420 + "id" 1421 + ], 1422 + "onDelete": "cascade", 1423 + "onUpdate": "no action" 1424 + }, 1425 + "sprite_auth_user_id_users_id_fk": { 1426 + "name": "sprite_auth_user_id_users_id_fk", 1427 + "tableFrom": "sprite_auth", 1428 + "tableTo": "users", 1429 + "columnsFrom": [ 1430 + "user_id" 1431 + ], 1432 + "columnsTo": [ 1433 + "id" 1434 + ], 1435 + "onDelete": "no action", 1436 + "onUpdate": "no action" 1437 + } 1438 + }, 1439 + "compositePrimaryKeys": {}, 1440 + "uniqueConstraints": {}, 1441 + "policies": {}, 1442 + "checkConstraints": {}, 1443 + "isRLSEnabled": false 1444 + }, 1445 + "public.ssh_keys": { 1446 + "name": "ssh_keys", 1447 + "schema": "", 1448 + "columns": { 1449 + "id": { 1450 + "name": "id", 1451 + "type": "text", 1452 + "primaryKey": true, 1453 + "notNull": true, 1454 + "default": "xata_id()" 1455 + }, 1456 + "sandbox_id": { 1457 + "name": "sandbox_id", 1458 + "type": "text", 1459 + "primaryKey": false, 1460 + "notNull": true 1461 + }, 1462 + "public_key": { 1463 + "name": "public_key", 1464 + "type": "text", 1465 + "primaryKey": false, 1466 + "notNull": true 1467 + }, 1468 + "private_key": { 1469 + "name": "private_key", 1470 + "type": "text", 1471 + "primaryKey": false, 1472 + "notNull": true 1473 + }, 1474 + "redacted": { 1475 + "name": "redacted", 1476 + "type": "text", 1477 + "primaryKey": false, 1478 + "notNull": false 1479 + }, 1480 + "created_at": { 1481 + "name": "created_at", 1482 + "type": "timestamp", 1483 + "primaryKey": false, 1484 + "notNull": true, 1485 + "default": "now()" 1486 + } 1487 + }, 1488 + "indexes": { 1489 + "unique_sandbox_ssh_key": { 1490 + "name": "unique_sandbox_ssh_key", 1491 + "columns": [ 1492 + { 1493 + "expression": "public_key", 1494 + "isExpression": false, 1495 + "asc": true, 1496 + "nulls": "last" 1497 + }, 1498 + { 1499 + "expression": "sandbox_id", 1500 + "isExpression": false, 1501 + "asc": true, 1502 + "nulls": "last" 1503 + } 1504 + ], 1505 + "isUnique": true, 1506 + "concurrently": false, 1507 + "method": "btree", 1508 + "with": {} 1509 + } 1510 + }, 1511 + "foreignKeys": { 1512 + "ssh_keys_sandbox_id_sandboxes_id_fk": { 1513 + "name": "ssh_keys_sandbox_id_sandboxes_id_fk", 1514 + "tableFrom": "ssh_keys", 1515 + "tableTo": "sandboxes", 1516 + "columnsFrom": [ 1517 + "sandbox_id" 1518 + ], 1519 + "columnsTo": [ 1520 + "id" 1521 + ], 1522 + "onDelete": "cascade", 1523 + "onUpdate": "no action" 1524 + } 1525 + }, 1526 + "compositePrimaryKeys": {}, 1527 + "uniqueConstraints": {}, 1528 + "policies": {}, 1529 + "checkConstraints": {}, 1530 + "isRLSEnabled": false 1531 + }, 1532 + "public.tailscale_auth_keys": { 1533 + "name": "tailscale_auth_keys", 1534 + "schema": "", 1535 + "columns": { 1536 + "id": { 1537 + "name": "id", 1538 + "type": "text", 1539 + "primaryKey": true, 1540 + "notNull": true, 1541 + "default": "xata_id()" 1542 + }, 1543 + "sandbox_id": { 1544 + "name": "sandbox_id", 1545 + "type": "text", 1546 + "primaryKey": false, 1547 + "notNull": true 1548 + }, 1549 + "auth_key": { 1550 + "name": "auth_key", 1551 + "type": "text", 1552 + "primaryKey": false, 1553 + "notNull": true 1554 + }, 1555 + "redacted": { 1556 + "name": "redacted", 1557 + "type": "text", 1558 + "primaryKey": false, 1559 + "notNull": true 1560 + }, 1561 + "created_at": { 1562 + "name": "created_at", 1563 + "type": "timestamp", 1564 + "primaryKey": false, 1565 + "notNull": true, 1566 + "default": "now()" 1567 + } 1568 + }, 1569 + "indexes": {}, 1570 + "foreignKeys": { 1571 + "tailscale_auth_keys_sandbox_id_sandboxes_id_fk": { 1572 + "name": "tailscale_auth_keys_sandbox_id_sandboxes_id_fk", 1573 + "tableFrom": "tailscale_auth_keys", 1574 + "tableTo": "sandboxes", 1575 + "columnsFrom": [ 1576 + "sandbox_id" 1577 + ], 1578 + "columnsTo": [ 1579 + "id" 1580 + ], 1581 + "onDelete": "cascade", 1582 + "onUpdate": "no action" 1583 + } 1584 + }, 1585 + "compositePrimaryKeys": {}, 1586 + "uniqueConstraints": {}, 1587 + "policies": {}, 1588 + "checkConstraints": {}, 1589 + "isRLSEnabled": false 1590 + }, 1591 + "public.users": { 1592 + "name": "users", 1593 + "schema": "", 1594 + "columns": { 1595 + "id": { 1596 + "name": "id", 1597 + "type": "text", 1598 + "primaryKey": true, 1599 + "notNull": true, 1600 + "default": "xata_id()" 1601 + }, 1602 + "did": { 1603 + "name": "did", 1604 + "type": "text", 1605 + "primaryKey": false, 1606 + "notNull": true 1607 + }, 1608 + "display_name": { 1609 + "name": "display_name", 1610 + "type": "text", 1611 + "primaryKey": false, 1612 + "notNull": false 1613 + }, 1614 + "handle": { 1615 + "name": "handle", 1616 + "type": "text", 1617 + "primaryKey": false, 1618 + "notNull": true 1619 + }, 1620 + "avatar": { 1621 + "name": "avatar", 1622 + "type": "text", 1623 + "primaryKey": false, 1624 + "notNull": false 1625 + }, 1626 + "created_at": { 1627 + "name": "created_at", 1628 + "type": "timestamp", 1629 + "primaryKey": false, 1630 + "notNull": true, 1631 + "default": "now()" 1632 + }, 1633 + "updated_at": { 1634 + "name": "updated_at", 1635 + "type": "timestamp", 1636 + "primaryKey": false, 1637 + "notNull": true, 1638 + "default": "now()" 1639 + } 1640 + }, 1641 + "indexes": {}, 1642 + "foreignKeys": {}, 1643 + "compositePrimaryKeys": {}, 1644 + "uniqueConstraints": { 1645 + "users_did_unique": { 1646 + "name": "users_did_unique", 1647 + "nullsNotDistinct": false, 1648 + "columns": [ 1649 + "did" 1650 + ] 1651 + }, 1652 + "users_handle_unique": { 1653 + "name": "users_handle_unique", 1654 + "nullsNotDistinct": false, 1655 + "columns": [ 1656 + "handle" 1657 + ] 1658 + } 1659 + }, 1660 + "policies": {}, 1661 + "checkConstraints": {}, 1662 + "isRLSEnabled": false 1663 + }, 1664 + "public.variables": { 1665 + "name": "variables", 1666 + "schema": "", 1667 + "columns": { 1668 + "id": { 1669 + "name": "id", 1670 + "type": "text", 1671 + "primaryKey": true, 1672 + "notNull": true, 1673 + "default": "variable_id()" 1674 + }, 1675 + "name": { 1676 + "name": "name", 1677 + "type": "text", 1678 + "primaryKey": false, 1679 + "notNull": true 1680 + }, 1681 + "value": { 1682 + "name": "value", 1683 + "type": "text", 1684 + "primaryKey": false, 1685 + "notNull": true 1686 + }, 1687 + "created_at": { 1688 + "name": "created_at", 1689 + "type": "timestamp", 1690 + "primaryKey": false, 1691 + "notNull": true, 1692 + "default": "now()" 1693 + }, 1694 + "updated_at": { 1695 + "name": "updated_at", 1696 + "type": "timestamp", 1697 + "primaryKey": false, 1698 + "notNull": true, 1699 + "default": "now()" 1700 + } 1701 + }, 1702 + "indexes": {}, 1703 + "foreignKeys": {}, 1704 + "compositePrimaryKeys": {}, 1705 + "uniqueConstraints": {}, 1706 + "policies": {}, 1707 + "checkConstraints": {}, 1708 + "isRLSEnabled": false 1709 + }, 1710 + "public.vercel_auth": { 1711 + "name": "vercel_auth", 1712 + "schema": "", 1713 + "columns": { 1714 + "id": { 1715 + "name": "id", 1716 + "type": "text", 1717 + "primaryKey": true, 1718 + "notNull": true, 1719 + "default": "xata_id()" 1720 + }, 1721 + "sandbox_id": { 1722 + "name": "sandbox_id", 1723 + "type": "text", 1724 + "primaryKey": false, 1725 + "notNull": true 1726 + }, 1727 + "user_id": { 1728 + "name": "user_id", 1729 + "type": "text", 1730 + "primaryKey": false, 1731 + "notNull": true 1732 + }, 1733 + "vercel_token": { 1734 + "name": "vercel_token", 1735 + "type": "text", 1736 + "primaryKey": false, 1737 + "notNull": true 1738 + }, 1739 + "redacted_vercel_token": { 1740 + "name": "redacted_vercel_token", 1741 + "type": "text", 1742 + "primaryKey": false, 1743 + "notNull": true 1744 + }, 1745 + "project_id": { 1746 + "name": "project_id", 1747 + "type": "text", 1748 + "primaryKey": false, 1749 + "notNull": true 1750 + }, 1751 + "team_id": { 1752 + "name": "team_id", 1753 + "type": "text", 1754 + "primaryKey": false, 1755 + "notNull": true 1756 + }, 1757 + "created_at": { 1758 + "name": "created_at", 1759 + "type": "timestamp", 1760 + "primaryKey": false, 1761 + "notNull": true, 1762 + "default": "now()" 1763 + } 1764 + }, 1765 + "indexes": { 1766 + "unique_vercel_auth": { 1767 + "name": "unique_vercel_auth", 1768 + "columns": [ 1769 + { 1770 + "expression": "sandbox_id", 1771 + "isExpression": false, 1772 + "asc": true, 1773 + "nulls": "last" 1774 + }, 1775 + { 1776 + "expression": "user_id", 1777 + "isExpression": false, 1778 + "asc": true, 1779 + "nulls": "last" 1780 + } 1781 + ], 1782 + "isUnique": true, 1783 + "concurrently": false, 1784 + "method": "btree", 1785 + "with": {} 1786 + } 1787 + }, 1788 + "foreignKeys": { 1789 + "vercel_auth_sandbox_id_sandboxes_id_fk": { 1790 + "name": "vercel_auth_sandbox_id_sandboxes_id_fk", 1791 + "tableFrom": "vercel_auth", 1792 + "tableTo": "sandboxes", 1793 + "columnsFrom": [ 1794 + "sandbox_id" 1795 + ], 1796 + "columnsTo": [ 1797 + "id" 1798 + ], 1799 + "onDelete": "cascade", 1800 + "onUpdate": "no action" 1801 + }, 1802 + "vercel_auth_user_id_users_id_fk": { 1803 + "name": "vercel_auth_user_id_users_id_fk", 1804 + "tableFrom": "vercel_auth", 1805 + "tableTo": "users", 1806 + "columnsFrom": [ 1807 + "user_id" 1808 + ], 1809 + "columnsTo": [ 1810 + "id" 1811 + ], 1812 + "onDelete": "no action", 1813 + "onUpdate": "no action" 1814 + } 1815 + }, 1816 + "compositePrimaryKeys": {}, 1817 + "uniqueConstraints": {}, 1818 + "policies": {}, 1819 + "checkConstraints": {}, 1820 + "isRLSEnabled": false 1821 + }, 1822 + "public.volumes": { 1823 + "name": "volumes", 1824 + "schema": "", 1825 + "columns": { 1826 + "id": { 1827 + "name": "id", 1828 + "type": "text", 1829 + "primaryKey": true, 1830 + "notNull": true, 1831 + "default": "volume_id()" 1832 + }, 1833 + "slug": { 1834 + "name": "slug", 1835 + "type": "text", 1836 + "primaryKey": false, 1837 + "notNull": true 1838 + }, 1839 + "size": { 1840 + "name": "size", 1841 + "type": "integer", 1842 + "primaryKey": false, 1843 + "notNull": true 1844 + }, 1845 + "size_unit": { 1846 + "name": "size_unit", 1847 + "type": "text", 1848 + "primaryKey": false, 1849 + "notNull": true 1850 + }, 1851 + "created_at": { 1852 + "name": "created_at", 1853 + "type": "timestamp", 1854 + "primaryKey": false, 1855 + "notNull": true, 1856 + "default": "now()" 1857 + }, 1858 + "updated_at": { 1859 + "name": "updated_at", 1860 + "type": "timestamp", 1861 + "primaryKey": false, 1862 + "notNull": true, 1863 + "default": "now()" 1864 + } 1865 + }, 1866 + "indexes": {}, 1867 + "foreignKeys": {}, 1868 + "compositePrimaryKeys": {}, 1869 + "uniqueConstraints": { 1870 + "volumes_slug_unique": { 1871 + "name": "volumes_slug_unique", 1872 + "nullsNotDistinct": false, 1873 + "columns": [ 1874 + "slug" 1875 + ] 1876 + } 1877 + }, 1878 + "policies": {}, 1879 + "checkConstraints": {}, 1880 + "isRLSEnabled": false 1881 + }, 1882 + "public.integrations": { 1883 + "name": "integrations", 1884 + "schema": "", 1885 + "columns": { 1886 + "id": { 1887 + "name": "id", 1888 + "type": "text", 1889 + "primaryKey": true, 1890 + "notNull": true, 1891 + "default": "xata_id()" 1892 + }, 1893 + "sandbox_id": { 1894 + "name": "sandbox_id", 1895 + "type": "text", 1896 + "primaryKey": false, 1897 + "notNull": true 1898 + }, 1899 + "name": { 1900 + "name": "name", 1901 + "type": "text", 1902 + "primaryKey": false, 1903 + "notNull": true 1904 + }, 1905 + "description": { 1906 + "name": "description", 1907 + "type": "text", 1908 + "primaryKey": false, 1909 + "notNull": false 1910 + }, 1911 + "webhook_url": { 1912 + "name": "webhook_url", 1913 + "type": "text", 1914 + "primaryKey": false, 1915 + "notNull": true 1916 + }, 1917 + "created_at": { 1918 + "name": "created_at", 1919 + "type": "timestamp", 1920 + "primaryKey": false, 1921 + "notNull": true, 1922 + "default": "now()" 1923 + } 1924 + }, 1925 + "indexes": { 1926 + "unique_sandbox_integration": { 1927 + "name": "unique_sandbox_integration", 1928 + "columns": [ 1929 + { 1930 + "expression": "sandbox_id", 1931 + "isExpression": false, 1932 + "asc": true, 1933 + "nulls": "last" 1934 + }, 1935 + { 1936 + "expression": "name", 1937 + "isExpression": false, 1938 + "asc": true, 1939 + "nulls": "last" 1940 + } 1941 + ], 1942 + "isUnique": true, 1943 + "concurrently": false, 1944 + "method": "btree", 1945 + "with": {} 1946 + } 1947 + }, 1948 + "foreignKeys": { 1949 + "integrations_sandbox_id_sandboxes_id_fk": { 1950 + "name": "integrations_sandbox_id_sandboxes_id_fk", 1951 + "tableFrom": "integrations", 1952 + "tableTo": "sandboxes", 1953 + "columnsFrom": [ 1954 + "sandbox_id" 1955 + ], 1956 + "columnsTo": [ 1957 + "id" 1958 + ], 1959 + "onDelete": "cascade", 1960 + "onUpdate": "no action" 1961 + } 1962 + }, 1963 + "compositePrimaryKeys": {}, 1964 + "uniqueConstraints": {}, 1965 + "policies": {}, 1966 + "checkConstraints": {}, 1967 + "isRLSEnabled": false 1968 + } 1969 + }, 1970 + "enums": {}, 1971 + "schemas": {}, 1972 + "sequences": {}, 1973 + "roles": {}, 1974 + "policies": {}, 1975 + "views": {}, 1976 + "_meta": { 1977 + "columns": {}, 1978 + "schemas": {}, 1979 + "tables": {} 1980 + } 1981 + }
+14
apps/cf-sandbox/drizzle/meta/_journal.json
··· 288 288 "when": 1775247751981, 289 289 "tag": "0040_silky_betty_brant", 290 290 "breakpoints": true 291 + }, 292 + { 293 + "idx": 41, 294 + "version": "7", 295 + "when": 1775496781360, 296 + "tag": "0041_slippery_sunspot", 297 + "breakpoints": true 298 + }, 299 + { 300 + "idx": 42, 301 + "version": "7", 302 + "when": 1775497153309, 303 + "tag": "0042_awesome_havok", 304 + "breakpoints": true 291 305 } 292 306 ] 293 307 }
+10
apps/cf-sandbox/src/routes/sandboxes.ts
··· 526 526 527 527 return c.json({ uuid }); 528 528 }); 529 + 530 + sandboxRoutes.post("/v1/sandboxes/:sandboxId/backup", async (c) => { 531 + const result = await getSandboxRecord(c.var.db, c.req.param("sandboxId")); 532 + const record = result?.sandbox; 533 + }); 534 + 535 + sandboxRoutes.post("/v1/sandboxes/:sandboxId/restore", async (c) => { 536 + const result = await getSandboxRecord(c.var.db, c.req.param("sandboxId")); 537 + const record = result?.sandbox; 538 + });
+22
apps/cf-sandbox/src/schema/backups.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 backups = pgTable("backups", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id") 10 + .notNull() 11 + .references(() => sandboxes.id, { onDelete: "cascade" }), 12 + backupId: text("backup_id").notNull(), 13 + directory: text("directory").notNull(), 14 + description: text("description"), 15 + expiresAt: timestamp("expires_at"), 16 + createdAt: timestamp("created_at").defaultNow().notNull(), 17 + }); 18 + 19 + export type SelectBakcup = InferSelectModel<typeof backups>; 20 + export type InsertBackup = InferInsertModel<typeof backups>; 21 + 22 + export default backups;
+2
apps/cf-sandbox/src/schema/index.ts
··· 18 18 import spriteAuth from "./sprite-auth"; 19 19 import vercelAuth from "./vercel-auth"; 20 20 import sandboxCp from "./sandbox-cp"; 21 + import backups from "./backups"; 21 22 22 23 export { 23 24 sandboxes, ··· 40 41 spriteAuth, 41 42 vercelAuth, 42 43 sandboxCp, 44 + backups, 43 45 };
+22
apps/sandbox/src/schema/backups.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 backups = pgTable("backups", { 6 + id: text("id") 7 + .primaryKey() 8 + .default(sql`xata_id()`), 9 + sandboxId: text("sandbox_id") 10 + .notNull() 11 + .references(() => sandboxes.id, { onDelete: "cascade" }), 12 + backupId: text("backup_id").notNull(), 13 + directory: text("directory").notNull(), 14 + description: text("description"), 15 + expiresAt: timestamp("expires_at"), 16 + createdAt: timestamp("created_at").defaultNow().notNull(), 17 + }); 18 + 19 + export type SelectBakcup = InferSelectModel<typeof backups>; 20 + export type InsertBackup = InferInsertModel<typeof backups>; 21 + 22 + export default backups;
+2
apps/sandbox/src/schema/mod.ts
··· 18 18 import spriteAuth from "./sprite-auth.ts"; 19 19 import vercelAuth from "./vercel-auth.ts"; 20 20 import sandboxCp from "./sandbox-cp.ts"; 21 + import backups from "./backups.ts"; 21 22 22 23 export { 23 24 sandboxes, ··· 40 41 spriteAuth, 41 42 vercelAuth, 42 43 sandboxCp, 44 + backups 43 45 };