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.

Remove redundant unique indexes on sandboxes

Drop unique composite indexes that enforced uniqueness by resource
id for sandbox_files, sandbox_secrets, sandbox_variables and
sandbox_volumes. Keep uniqueness constraints based on path/name where
applicable. Add a Drizzle migration to drop the unique_sandbox_volume
index and update the migration snapshot. Also apply minor formatting
adjustments to API schema id declarations

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