Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/content/docs/indexes-constraints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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] }),
];
});
```

Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion tests/snake.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down