@@ -169,3 +169,40 @@ export type InsertEventTalk = typeof eventTalksTable.$inferInsert;
169169export type SelectEventTalk = typeof eventTalksTable . $inferSelect ;
170170export type InsertEventImage = typeof eventImagesTable . $inferInsert ;
171171export type SelectEventImage = typeof eventImagesTable . $inferSelect ;
172+
173+ export const hacksTable = pgTable ( "hacks" , {
174+ id : uuid ( "id" ) . primaryKey ( ) . defaultRandom ( ) ,
175+ eventId : uuid ( "event_id" )
176+ . notNull ( )
177+ . references ( ( ) => eventsTable . id , { onDelete : "cascade" } ) ,
178+ name : text ( "name" ) . notNull ( ) ,
179+ project : text ( "description" ) ,
180+ createdAt,
181+ updatedAt,
182+ } ) ;
183+
184+ export const hackUsersTable = pgTable ( "hack_users" , {
185+ hackId : uuid ( "hack_id" )
186+ . notNull ( )
187+ . references ( ( ) => hacksTable . id , { onDelete : "cascade" } ) ,
188+ clerkUserId : text ( "clerk_user_id" ) . notNull ( ) ,
189+ createdAt,
190+ updatedAt,
191+ } ) ;
192+
193+ export const hackVotesTable = pgTable ( "hack_votes" , {
194+ id : uuid ( "id" ) . primaryKey ( ) . defaultRandom ( ) ,
195+ hackId : uuid ( "hack_id" )
196+ . notNull ( )
197+ . references ( ( ) => hacksTable . id , { onDelete : "cascade" } ) ,
198+ clerkUserId : text ( "clerk_user_id" ) . notNull ( ) ,
199+ createdAt,
200+ updatedAt,
201+ } ) ;
202+
203+ export type InsertHack = typeof hacksTable . $inferInsert ;
204+ export type SelectHack = typeof hacksTable . $inferSelect ;
205+ export type InsertHackUser = typeof hackUsersTable . $inferInsert ;
206+ export type SelectHackUser = typeof hackUsersTable . $inferSelect ;
207+ export type InsertHackVote = typeof hackVotesTable . $inferInsert ;
208+ export type SelectHackVote = typeof hackVotesTable . $inferSelect ;
0 commit comments