From e21934a2a1740c00512cd1eca13b2904e04fbb2c Mon Sep 17 00:00:00 2001 From: farhadham Date: Wed, 11 Dec 2024 16:21:54 +0100 Subject: [PATCH] fixed documentation, fixed test file import --- src/content/docs/indexes-constraints.mdx | 10 +++++----- tests/snake.test.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/indexes-constraints.mdx b/src/content/docs/indexes-constraints.mdx index 3ebd1b8f1..4ee1fa0f6 100644 --- a/src/content/docs/indexes-constraints.mdx +++ b/src/content/docs/indexes-constraints.mdx @@ -629,10 +629,10 @@ Drizzle ORM provides a standalone `primaryKey` operator for that: authorId: integer("author_id"), bookId: integer("book_id"), }, (table) => { - return [{ - pk: primaryKey({ columns: [table.bookId, table.authorId] }), - pkWithCustomName: primaryKey({ name: 'custom_name', columns: [table.bookId, table.authorId] }), - }]; + return [ + primaryKey({ columns: [table.bookId, table.authorId] }), + primaryKey({ name: 'custom_name', columns: [table.bookId, table.authorId] }), + ]; }); ``` @@ -642,7 +642,7 @@ Drizzle ORM provides a standalone `primaryKey` operator for that: CREATE TABLE IF NOT EXISTS "books_to_authors" ( "author_id" integer, "book_id" integer, - PRIMARY KEY("book_id","author_id"), + CONSTRAINT "books_to_authors_book_id_author_id_pk" PRIMARY KEY("book_id","author_id"), ); ALTER TABLE "books_to_authors" ADD CONSTRAINT "custom_name" PRIMARY KEY("book_id","author_id"); diff --git a/tests/snake.test.ts b/tests/snake.test.ts index e816c7459..da2e49091 100644 --- a/tests/snake.test.ts +++ b/tests/snake.test.ts @@ -3,7 +3,7 @@ import { describe, expect, test } from "vitest"; import { gameSegments, mapSnake, -} from "../components/landing/header/snake/mapSnake"; +} from "../src/ui/components/landing/snake/mapSnake"; const gridHeight = 10; const gridWidth = 19;