mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
22 lines
599 B
TypeScript
22 lines
599 B
TypeScript
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
|
import {games} from './games';
|
|
import {externalIds} from './externalIds';
|
|
|
|
export const gamesToExternalIds = pgTable(
|
|
'games_to_external_ids',
|
|
{
|
|
gameId: uuid('game_id')
|
|
.notNull()
|
|
.references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
|
externalId: uuid('external_id')
|
|
.notNull()
|
|
.references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
|
},
|
|
(table) => {
|
|
return {
|
|
gamesToExternalIdsPkey: primaryKey({
|
|
columns: [table.gameId, table.externalId],
|
|
}),
|
|
};
|
|
},
|
|
);
|