From 9d85a7dccf1c59e0397f4633c40813f447dbdaa2 Mon Sep 17 00:00:00 2001 From: "ryota.sasazawa" Date: Thu, 14 Nov 2024 11:51:59 +0900 Subject: [PATCH] improve for efficient search --- frontend/packages/db-structure/src/schema/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/packages/db-structure/src/schema/index.ts b/frontend/packages/db-structure/src/schema/index.ts index e8ff5ac4f..34bb0e335 100644 --- a/frontend/packages/db-structure/src/schema/index.ts +++ b/frontend/packages/db-structure/src/schema/index.ts @@ -43,9 +43,13 @@ const relationshipSchema = v.object({ deleteConstraint: v.string(), }) +const tablesSchema = v.record(v.string(), tableSchema) + +const relationshipsSchema = v.record(v.string(), relationshipSchema) + export const dbStructureSchema = v.object({ - tables: v.array(tableSchema), - relationships: v.array(relationshipSchema), + tables: tablesSchema, + relationships: relationshipsSchema, }) export type DBStructure = v.InferOutput