a homebrewed DnD campaign based in the Honkai: Star Rail universe
hsr honkaistarrail dnd
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add constraint to faction_relationship table

+6 -2
+6 -2
app/src/lib/server/db/schemas/dnd/faction.ts
··· 1 - import { index, integer, pgEnum, pgTable, text, timestamp } from 'drizzle-orm/pg-core' 1 + import { ne } from 'drizzle-orm' 2 + import { check, index, integer, pgEnum, pgTable, text, timestamp } from 'drizzle-orm/pg-core' 2 3 import { sourcebook } from './sourcebook' 3 4 4 5 export const faction = pgTable( ··· 35 36 reason: text('reason').notNull(), 36 37 createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(), 37 38 }, 38 - (table) => [index().on(table.factionId1, table.factionId2)], 39 + (table) => [ 40 + index().on(table.factionId1, table.factionId2), 41 + check('factions_are_different', ne(table.factionId1, table.factionId2)), 42 + ], 39 43 )