···99import postgres from "postgres";
1010import { Doc } from "./[doc_id]/Doc";
1111import { UpdateURL } from "components/UpdateURL";
1212+import { v7 } from "uuid";
1213const client = postgres(process.env.DB_URL as string);
1314const db = drizzle(client);
1415···2627 let [entity] = await tx
2728 .insert(entities)
2829 // And add it to that permission set
2929- .values({ set: entity_set.id })
3030+ .values({ set: entity_set.id, id: v7() })
3031 .returning();
3132 //Create a new permission token
3233 let [permissionToken] = await tx
···66import { Fact } from ".";
77import { MutationContext } from "./mutations";
88import { supabaseBrowserClient } from "supabase/browserClient";
99+import { v7 } from "uuid";
9101011export function clientMutationContext(tx: WriteTransaction) {
1112 let ctx: MutationContext = {
···3233 async assertFact(f) {
3334 let attribute = Attributes[f.attribute as keyof typeof Attributes];
3435 if (!attribute) return;
3535- let id = f.id || crypto.randomUUID();
3636+ let id = f.id || v7();
3637 let data = { ...f.data };
3738 if (attribute.cardinality === "one") {
3839 let existingFact = await tx
+2-1
src/replicache/serverMutationContext.ts
···99import { DeepReadonly } from "replicache";
1010import { createClient } from "@supabase/supabase-js";
1111import { Database } from "supabase/database.types";
1212+import { v7 } from "uuid";
1213export function serverMutationContext(
1314 tx: PgTransaction<any, any, any>,
1415 token_rights: PermissionToken["permission_token_rights"],
···7778 async assertFact(f) {
7879 let attribute = Attributes[f.attribute as keyof typeof Attributes];
7980 if (!attribute) return;
8080- let id = f.id || crypto.randomUUID();
8181+ let id = f.id || v7();
8182 let data = { ...f.data };
8283 let [permission_set] = await tx
8384 .select({ entity_set: entities.set })
+2-1
src/utils/addImage.ts
···33import { supabaseBrowserClient } from "supabase/browserClient";
44import { FilterAttributes } from "src/replicache/attributes";
55import { rgbaToDataURL, rgbaToThumbHash, thumbHashToDataURL } from "thumbhash";
66+import { v7 } from "uuid";
6778export async function addImage(
89 file: File,
···1415) {
1516 let client = supabaseBrowserClient();
1617 let cache = await caches.open("minilink-user-assets");
1717- let fileID = crypto.randomUUID();
1818+ let fileID = v7();
1819 let url = client.storage.from("minilink-user-assets").getPublicUrl(fileID)
1920 .data.publicUrl;
2021 let dimensions = await getImageDimensions(file);