Β© 2026 Hedgehog Software, LLC
export const weeklyFinalRankings = pgTable( 'weekly_final_rankings', { id: serial('id').primaryKey(), division: varchar('division', { length: 10 }).notNull(), week: integer('week').notNull(), year: integer('year').notNull(), rankings: jsonb('rankings').notNull(), }, (table) => ({ isUniqueVote: unique().on(table.year, table.week), }), )
await db .insert(weeklyFinalRankings) .values({ division, year: 2024, week: 0, rankings: rankedTeams, }) .onConflictDoUpdate({ target: weeklyFinalRankings.week, set: { rankings: rankedTeams }, })
PostgresError: there is no unique or exclusion constraint matching the ON CONFLICT specification