export const dungeon = pgTable('dungeon', {
id: serial('id').primaryKey(),
image: json('image'),
name: varchar('name', { length: 256 }),
gameId: integer('game_id').notNull().references(() => game.id, { onDelete: 'cascade' }),
bossId: integer('boss_id').references(() => boss.id, { onDelete: 'cascade' }),
});
export const boss = pgTable('boss', {
id: serial('id').primaryKey(),
hp: integer('hp'),
name: varchar('name', { length: 256 }),
image: json('image'),
});
export const dungeonRelations = relations(dungeon, ({ many, one }) => ({
monsters: many(monster),
gameId: one(game, { fields: [dungeon.gameId], references: [game.id] }),
boss: one(boss, { fields: [dungeon.bossId], references: [boss.id] }),
}));
export const dungeon = pgTable('dungeon', {
id: serial('id').primaryKey(),
image: json('image'),
name: varchar('name', { length: 256 }),
gameId: integer('game_id').notNull().references(() => game.id, { onDelete: 'cascade' }),
bossId: integer('boss_id').references(() => boss.id, { onDelete: 'cascade' }),
});
export const boss = pgTable('boss', {
id: serial('id').primaryKey(),
hp: integer('hp'),
name: varchar('name', { length: 256 }),
image: json('image'),
});
export const dungeonRelations = relations(dungeon, ({ many, one }) => ({
monsters: many(monster),
gameId: one(game, { fields: [dungeon.gameId], references: [game.id] }),
boss: one(boss, { fields: [dungeon.bossId], references: [boss.id] }),
}));