@compfest-18/oppenheimer-schema 0.0.2-develop.abfb770
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +540 -0
- package/dist/index.d.mts +9848 -0
- package/dist/index.mjs +1803 -0
- package/package.json +33 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1803 @@
|
|
|
1
|
+
// enums.ts
|
|
2
|
+
import { pgEnum } from "drizzle-orm/pg-core";
|
|
3
|
+
var eventEnum = pgEnum("event", [
|
|
4
|
+
"GRAND_LAUNCHING",
|
|
5
|
+
"XCELERATE_SEMINAR",
|
|
6
|
+
"XCELERATE_WORKSHOP",
|
|
7
|
+
"XCELERATE_FOUNDATION",
|
|
8
|
+
"COMPFEST_TALKS",
|
|
9
|
+
"MAIN_EVENT_PLAYGROUND",
|
|
10
|
+
"MAIN_EVENT_SEMINAR",
|
|
11
|
+
"MAIN_EVENT_STAGE"
|
|
12
|
+
]);
|
|
13
|
+
var programCodeEnum = pgEnum("program_code", [
|
|
14
|
+
"LANDING",
|
|
15
|
+
"SEA",
|
|
16
|
+
"UXA",
|
|
17
|
+
"DSA",
|
|
18
|
+
"PMA",
|
|
19
|
+
"IGI",
|
|
20
|
+
"SCPC",
|
|
21
|
+
"JCPC",
|
|
22
|
+
"AIC",
|
|
23
|
+
"BIZZIT",
|
|
24
|
+
"CTF",
|
|
25
|
+
"DAD",
|
|
26
|
+
"GAMEJAM",
|
|
27
|
+
"MINICASE"
|
|
28
|
+
]);
|
|
29
|
+
var programTypeEnum = pgEnum("program_type", ["ACADEMY", "COMPETITION"]);
|
|
30
|
+
var programTaskTypeEnum = pgEnum("program_task_type", ["TEAM", "PERSONAL"]);
|
|
31
|
+
var fileTypeEnum = pgEnum("file_type", [
|
|
32
|
+
"PDF",
|
|
33
|
+
"DOCX",
|
|
34
|
+
"PPTX",
|
|
35
|
+
"ZIP",
|
|
36
|
+
"RAR",
|
|
37
|
+
"IMAGE",
|
|
38
|
+
"VIDEO"
|
|
39
|
+
]);
|
|
40
|
+
var teamStatusEnum = pgEnum("team_status", [
|
|
41
|
+
"WAITING_FOR_VERIFICATION",
|
|
42
|
+
"VERIFIED",
|
|
43
|
+
"VERIFICATION_FAILED"
|
|
44
|
+
]);
|
|
45
|
+
var submissionStatusEnum = pgEnum("submission_status", [
|
|
46
|
+
"PENDING",
|
|
47
|
+
"REJECTED",
|
|
48
|
+
"ACCEPTED"
|
|
49
|
+
]);
|
|
50
|
+
var knowEventSourceEnum = pgEnum("know_event_source", [
|
|
51
|
+
"INSTAGRAM",
|
|
52
|
+
"WEBSITE",
|
|
53
|
+
"FRIENDS",
|
|
54
|
+
"TIKTOK",
|
|
55
|
+
"LINKEDIN",
|
|
56
|
+
"OTHERS"
|
|
57
|
+
]);
|
|
58
|
+
var questionTypeEnum = pgEnum("question_type", ["STRING", "BOOLEAN", "NUMBER"]);
|
|
59
|
+
var mainEventOccupationTypeEnum = pgEnum("main_event_occupation_type", [
|
|
60
|
+
"STUDENT",
|
|
61
|
+
"WORKING_PROFESSIONAL"
|
|
62
|
+
]);
|
|
63
|
+
var detentionStateEnum = pgEnum("detention_state", ["FIRST", "SECOND", "THIRD"]);
|
|
64
|
+
var gameOrientationEnum = pgEnum("game_orientation", ["VERTICAL", "HORIZONTAL"]);
|
|
65
|
+
var tokenTypeEnum = pgEnum("token_type", ["WHEEL", "GAME"]);
|
|
66
|
+
var rewardTypeEnum = pgEnum("reward_type", ["TOKEN", "POINT"]);
|
|
67
|
+
var vacancyJobTypeEnum = pgEnum("vacancy_job_type", [
|
|
68
|
+
"INTERNSHIP",
|
|
69
|
+
"FULLTIME",
|
|
70
|
+
"PARTTIME"
|
|
71
|
+
]);
|
|
72
|
+
var interviewApplicantStatusEnum = pgEnum("interview_applicant_status", [
|
|
73
|
+
"PENDING",
|
|
74
|
+
"ACCEPTED",
|
|
75
|
+
"REJECTED",
|
|
76
|
+
"CANCELLED",
|
|
77
|
+
"FINISHED"
|
|
78
|
+
]);
|
|
79
|
+
var nomineeTypeEnum = pgEnum("nominee_type", ["IGI", "AIC"]);
|
|
80
|
+
var boothRewardTypeEnum = pgEnum("booth_reward_type", ["REWARD", "DEDUCT"]);
|
|
81
|
+
var cartStatusEnum = pgEnum("cart_status", [
|
|
82
|
+
"PENDING",
|
|
83
|
+
"CHECKED_OUT",
|
|
84
|
+
"CANCELLED",
|
|
85
|
+
"COMPLETED"
|
|
86
|
+
]);
|
|
87
|
+
|
|
88
|
+
// auth/user.schema.ts
|
|
89
|
+
import { sql } from "drizzle-orm";
|
|
90
|
+
import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
91
|
+
var users = pgTable("users", {
|
|
92
|
+
id: text("id").primaryKey(),
|
|
93
|
+
email: text("email").notNull().unique(),
|
|
94
|
+
name: text("name").notNull(),
|
|
95
|
+
image: text("image"),
|
|
96
|
+
referralCode: text("referral_code").notNull().unique().default(sql`substring(replace(gen_random_uuid()::text, '-', ''), 1, 8)`),
|
|
97
|
+
createdAt: timestamp("createdAt").notNull().defaultNow(),
|
|
98
|
+
updatedAt: timestamp("updatedAt").notNull().defaultNow()
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// auth/user-profile.schema.ts
|
|
102
|
+
import { relations } from "drizzle-orm";
|
|
103
|
+
import { pgTable as pgTable2, text as text2, timestamp as timestamp2 } from "drizzle-orm/pg-core";
|
|
104
|
+
var userProfiles = pgTable2("user_profiles", {
|
|
105
|
+
userId: text2("user_id").primaryKey().references(() => users.id, { onDelete: "cascade" }),
|
|
106
|
+
lineId: text2("line_id"),
|
|
107
|
+
institution: text2("institution"),
|
|
108
|
+
whatsappNo: text2("whatsapp_no"),
|
|
109
|
+
job: text2("job"),
|
|
110
|
+
yearOfBirth: text2("year_of_birth"),
|
|
111
|
+
lastEducation: text2("last_education"),
|
|
112
|
+
domicile: text2("domicile"),
|
|
113
|
+
createdAt: timestamp2("created_at").notNull().defaultNow(),
|
|
114
|
+
updatedAt: timestamp2("updated_at").notNull().defaultNow()
|
|
115
|
+
});
|
|
116
|
+
var userProfilesRelations = relations(userProfiles, ({ one }) => ({
|
|
117
|
+
user: one(users, {
|
|
118
|
+
fields: [userProfiles.userId],
|
|
119
|
+
references: [users.id]
|
|
120
|
+
})
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
// events/event.schema.ts
|
|
124
|
+
import { relations as relations7 } from "drizzle-orm";
|
|
125
|
+
import { index as index6, pgTable as pgTable8, text as text8, timestamp as timestamp8 } from "drizzle-orm/pg-core";
|
|
126
|
+
|
|
127
|
+
// events/event-date.schema.ts
|
|
128
|
+
import { relations as relations2 } from "drizzle-orm";
|
|
129
|
+
import { index, pgTable as pgTable3, text as text3, timestamp as timestamp3 } from "drizzle-orm/pg-core";
|
|
130
|
+
var eventDates = pgTable3(
|
|
131
|
+
"event_dates",
|
|
132
|
+
{
|
|
133
|
+
id: text3("id").primaryKey(),
|
|
134
|
+
eventId: text3("event_id").notNull().references(() => events.id, { onDelete: "cascade" }),
|
|
135
|
+
name: text3("name").notNull(),
|
|
136
|
+
startDate: timestamp3("start_date").notNull(),
|
|
137
|
+
endDate: timestamp3("end_date").notNull(),
|
|
138
|
+
description: text3("description"),
|
|
139
|
+
deletedAt: timestamp3("deleted_at"),
|
|
140
|
+
createdAt: timestamp3("created_at").notNull().defaultNow(),
|
|
141
|
+
updatedAt: timestamp3("updated_at").notNull().defaultNow()
|
|
142
|
+
},
|
|
143
|
+
(table) => [index("event_dates_event_id_idx").on(table.eventId)]
|
|
144
|
+
);
|
|
145
|
+
var eventDatesRelations = relations2(eventDates, ({ one }) => ({
|
|
146
|
+
event: one(events, {
|
|
147
|
+
fields: [eventDates.eventId],
|
|
148
|
+
references: [events.id]
|
|
149
|
+
})
|
|
150
|
+
}));
|
|
151
|
+
|
|
152
|
+
// events/event-registration.schema.ts
|
|
153
|
+
import { relations as relations6 } from "drizzle-orm";
|
|
154
|
+
import { index as index5, pgTable as pgTable7, text as text7, timestamp as timestamp7 } from "drizzle-orm/pg-core";
|
|
155
|
+
|
|
156
|
+
// events/grand-launching-registration.schema.ts
|
|
157
|
+
import { relations as relations3 } from "drizzle-orm";
|
|
158
|
+
import { index as index2, pgTable as pgTable4, text as text4, timestamp as timestamp4 } from "drizzle-orm/pg-core";
|
|
159
|
+
var grandLaunchingRegistrations = pgTable4(
|
|
160
|
+
"grand_launching_registrations",
|
|
161
|
+
{
|
|
162
|
+
id: text4("id").primaryKey(),
|
|
163
|
+
eventRegistrationId: text4("event_registration_id").notNull().unique().references(() => eventRegistrations.id, { onDelete: "cascade" }),
|
|
164
|
+
knowEventSource: knowEventSourceEnum("know_event_source"),
|
|
165
|
+
deletedAt: timestamp4("deleted_at"),
|
|
166
|
+
createdAt: timestamp4("created_at").notNull().defaultNow(),
|
|
167
|
+
updatedAt: timestamp4("updated_at").notNull().defaultNow()
|
|
168
|
+
},
|
|
169
|
+
(table) => [
|
|
170
|
+
index2("grand_launching_registrations_event_registration_id_idx").on(
|
|
171
|
+
table.eventRegistrationId
|
|
172
|
+
)
|
|
173
|
+
]
|
|
174
|
+
);
|
|
175
|
+
var grandLaunchingRegistrationsRelations = relations3(
|
|
176
|
+
grandLaunchingRegistrations,
|
|
177
|
+
({ one }) => ({
|
|
178
|
+
eventRegistration: one(eventRegistrations, {
|
|
179
|
+
fields: [grandLaunchingRegistrations.eventRegistrationId],
|
|
180
|
+
references: [eventRegistrations.id]
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
// events/main-event-registration.schema.ts
|
|
186
|
+
import { relations as relations4 } from "drizzle-orm";
|
|
187
|
+
import { index as index3, pgTable as pgTable5, text as text5, timestamp as timestamp5 } from "drizzle-orm/pg-core";
|
|
188
|
+
var mainEventRegistrations = pgTable5(
|
|
189
|
+
"main_event_registrations",
|
|
190
|
+
{
|
|
191
|
+
id: text5("id").primaryKey(),
|
|
192
|
+
eventRegistrationId: text5("event_registration_id").notNull().unique().references(() => eventRegistrations.id, { onDelete: "cascade" }),
|
|
193
|
+
salutation: text5("salutation"),
|
|
194
|
+
occupation: text5("occupation"),
|
|
195
|
+
occupationType: mainEventOccupationTypeEnum("occupation_type"),
|
|
196
|
+
domicile: text5("domicile"),
|
|
197
|
+
yearOfBirth: text5("year_of_birth"),
|
|
198
|
+
schoolName: text5("school_name"),
|
|
199
|
+
courseOfStudy: text5("course_of_study"),
|
|
200
|
+
qualification: text5("qualification"),
|
|
201
|
+
yearOfGraduation: text5("year_of_graduation"),
|
|
202
|
+
industry: text5("industry"),
|
|
203
|
+
jobLevel: text5("job_level"),
|
|
204
|
+
highestQualification: text5("highest_qualification"),
|
|
205
|
+
yearOfMostRecentGraduation: text5("year_of_most_recent_graduation"),
|
|
206
|
+
jobFunction: text5("job_function"),
|
|
207
|
+
companyName: text5("company_name"),
|
|
208
|
+
deletedAt: timestamp5("deleted_at"),
|
|
209
|
+
createdAt: timestamp5("created_at").notNull().defaultNow(),
|
|
210
|
+
updatedAt: timestamp5("updated_at").notNull().defaultNow()
|
|
211
|
+
},
|
|
212
|
+
(table) => [
|
|
213
|
+
index3("main_event_registrations_event_registration_id_idx").on(table.eventRegistrationId)
|
|
214
|
+
]
|
|
215
|
+
);
|
|
216
|
+
var mainEventRegistrationsRelations = relations4(mainEventRegistrations, ({ one }) => ({
|
|
217
|
+
eventRegistration: one(eventRegistrations, {
|
|
218
|
+
fields: [mainEventRegistrations.eventRegistrationId],
|
|
219
|
+
references: [eventRegistrations.id]
|
|
220
|
+
})
|
|
221
|
+
}));
|
|
222
|
+
|
|
223
|
+
// events/xcelerate-registration.schema.ts
|
|
224
|
+
import { relations as relations5 } from "drizzle-orm";
|
|
225
|
+
import { index as index4, pgTable as pgTable6, text as text6, timestamp as timestamp6 } from "drizzle-orm/pg-core";
|
|
226
|
+
var xcelerateRegistrations = pgTable6(
|
|
227
|
+
"xcelerate_registrations",
|
|
228
|
+
{
|
|
229
|
+
id: text6("id").primaryKey(),
|
|
230
|
+
eventRegistrationId: text6("event_registration_id").notNull().unique().references(() => eventRegistrations.id, { onDelete: "cascade" }),
|
|
231
|
+
jobCategory: text6("job_category"),
|
|
232
|
+
knowEventSource: knowEventSourceEnum("know_event_source"),
|
|
233
|
+
batch: text6("batch"),
|
|
234
|
+
deletedAt: timestamp6("deleted_at"),
|
|
235
|
+
createdAt: timestamp6("created_at").notNull().defaultNow(),
|
|
236
|
+
updatedAt: timestamp6("updated_at").notNull().defaultNow()
|
|
237
|
+
},
|
|
238
|
+
(table) => [
|
|
239
|
+
index4("xcelerate_registrations_event_registration_id_idx").on(table.eventRegistrationId)
|
|
240
|
+
]
|
|
241
|
+
);
|
|
242
|
+
var xcelerateRegistrationsRelations = relations5(xcelerateRegistrations, ({ one }) => ({
|
|
243
|
+
eventRegistration: one(eventRegistrations, {
|
|
244
|
+
fields: [xcelerateRegistrations.eventRegistrationId],
|
|
245
|
+
references: [eventRegistrations.id]
|
|
246
|
+
})
|
|
247
|
+
}));
|
|
248
|
+
|
|
249
|
+
// events/event-registration.schema.ts
|
|
250
|
+
var eventRegistrations = pgTable7(
|
|
251
|
+
"event_registrations",
|
|
252
|
+
{
|
|
253
|
+
id: text7("id").primaryKey(),
|
|
254
|
+
eventId: text7("event_id").notNull().references(() => events.id, { onDelete: "cascade" }),
|
|
255
|
+
userId: text7("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
256
|
+
deletedAt: timestamp7("deleted_at"),
|
|
257
|
+
createdAt: timestamp7("created_at").notNull().defaultNow(),
|
|
258
|
+
updatedAt: timestamp7("updated_at").notNull().defaultNow()
|
|
259
|
+
},
|
|
260
|
+
(table) => [
|
|
261
|
+
index5("event_registrations_event_id_idx").on(table.eventId),
|
|
262
|
+
index5("event_registrations_user_id_idx").on(table.userId)
|
|
263
|
+
]
|
|
264
|
+
);
|
|
265
|
+
var eventRegistrationsRelations = relations6(eventRegistrations, ({ one, many }) => ({
|
|
266
|
+
event: one(events, {
|
|
267
|
+
fields: [eventRegistrations.eventId],
|
|
268
|
+
references: [events.id]
|
|
269
|
+
}),
|
|
270
|
+
user: one(users, {
|
|
271
|
+
fields: [eventRegistrations.userId],
|
|
272
|
+
references: [users.id]
|
|
273
|
+
}),
|
|
274
|
+
grandLaunchingRegistrations: many(grandLaunchingRegistrations),
|
|
275
|
+
xcelerateRegistrations: many(xcelerateRegistrations),
|
|
276
|
+
mainEventRegistrations: many(mainEventRegistrations)
|
|
277
|
+
}));
|
|
278
|
+
|
|
279
|
+
// events/event.schema.ts
|
|
280
|
+
var events = pgTable8(
|
|
281
|
+
"events",
|
|
282
|
+
{
|
|
283
|
+
id: text8("id").primaryKey(),
|
|
284
|
+
name: text8("name").notNull().unique(),
|
|
285
|
+
eventType: eventEnum("event_type").notNull(),
|
|
286
|
+
description: text8("description"),
|
|
287
|
+
bookletUrl: text8("booklet_url"),
|
|
288
|
+
whatsappGroupUrl: text8("whatsapp_group_url"),
|
|
289
|
+
accessLink: text8("access_link"),
|
|
290
|
+
deletedAt: timestamp8("deleted_at"),
|
|
291
|
+
// Soft delete for master data
|
|
292
|
+
createdAt: timestamp8("created_at").notNull().defaultNow(),
|
|
293
|
+
updatedAt: timestamp8("updated_at").notNull().defaultNow()
|
|
294
|
+
},
|
|
295
|
+
(table) => [index6("events_name_idx").on(table.name)]
|
|
296
|
+
);
|
|
297
|
+
var eventsRelations = relations7(events, ({ many }) => ({
|
|
298
|
+
eventDates: many(eventDates),
|
|
299
|
+
eventRegistrations: many(eventRegistrations)
|
|
300
|
+
}));
|
|
301
|
+
|
|
302
|
+
// feedback/feedback.schema.ts
|
|
303
|
+
import { relations as relations11 } from "drizzle-orm";
|
|
304
|
+
import { boolean, index as index10, pgTable as pgTable12, text as text12, timestamp as timestamp12 } from "drizzle-orm/pg-core";
|
|
305
|
+
|
|
306
|
+
// feedback/feedback-question.schema.ts
|
|
307
|
+
import { relations as relations9 } from "drizzle-orm";
|
|
308
|
+
import { index as index8, pgTable as pgTable10, text as text10, timestamp as timestamp10 } from "drizzle-orm/pg-core";
|
|
309
|
+
|
|
310
|
+
// feedback/feedback-option.schema.ts
|
|
311
|
+
import { relations as relations8 } from "drizzle-orm";
|
|
312
|
+
import { index as index7, pgTable as pgTable9, text as text9, timestamp as timestamp9 } from "drizzle-orm/pg-core";
|
|
313
|
+
var feedbackOptions = pgTable9(
|
|
314
|
+
"feedback_options",
|
|
315
|
+
{
|
|
316
|
+
id: text9("id").primaryKey(),
|
|
317
|
+
questionId: text9("question_id").notNull().references(() => feedbackQuestions.id, { onDelete: "cascade" }),
|
|
318
|
+
stringAnswer: text9("string_answer").notNull(),
|
|
319
|
+
deletedAt: timestamp9("deleted_at"),
|
|
320
|
+
createdAt: timestamp9("created_at").notNull().defaultNow(),
|
|
321
|
+
updatedAt: timestamp9("updated_at").notNull().defaultNow()
|
|
322
|
+
},
|
|
323
|
+
(table) => [index7("feedback_options_question_id_idx").on(table.questionId)]
|
|
324
|
+
);
|
|
325
|
+
var feedbackOptionsRelations = relations8(feedbackOptions, ({ one }) => ({
|
|
326
|
+
question: one(feedbackQuestions, {
|
|
327
|
+
fields: [feedbackOptions.questionId],
|
|
328
|
+
references: [feedbackQuestions.id]
|
|
329
|
+
})
|
|
330
|
+
}));
|
|
331
|
+
|
|
332
|
+
// feedback/feedback-question.schema.ts
|
|
333
|
+
var feedbackQuestions = pgTable10(
|
|
334
|
+
"feedback_questions",
|
|
335
|
+
{
|
|
336
|
+
id: text10("id").primaryKey(),
|
|
337
|
+
feedbackId: text10("feedback_id").notNull().references(() => feedbacks.id, { onDelete: "cascade" }),
|
|
338
|
+
question: text10("question").notNull(),
|
|
339
|
+
questionType: questionTypeEnum("question_type").notNull(),
|
|
340
|
+
deletedAt: timestamp10("deleted_at"),
|
|
341
|
+
createdAt: timestamp10("created_at").notNull().defaultNow(),
|
|
342
|
+
updatedAt: timestamp10("updated_at").notNull().defaultNow()
|
|
343
|
+
},
|
|
344
|
+
(table) => [index8("feedback_questions_feedback_id_idx").on(table.feedbackId)]
|
|
345
|
+
);
|
|
346
|
+
var feedbackQuestionsRelations = relations9(feedbackQuestions, ({ many }) => ({
|
|
347
|
+
feedbackOptions: many(feedbackOptions)
|
|
348
|
+
}));
|
|
349
|
+
|
|
350
|
+
// feedback/feedback-submission.schema.ts
|
|
351
|
+
import { relations as relations10 } from "drizzle-orm";
|
|
352
|
+
import { index as index9, pgTable as pgTable11, text as text11, timestamp as timestamp11 } from "drizzle-orm/pg-core";
|
|
353
|
+
var feedbackSubmissions = pgTable11(
|
|
354
|
+
"feedback_submissions",
|
|
355
|
+
{
|
|
356
|
+
id: text11("id").primaryKey(),
|
|
357
|
+
feedbackId: text11("feedback_id").notNull().references(() => feedbacks.id, { onDelete: "cascade" }),
|
|
358
|
+
userId: text11("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
359
|
+
answerJson: text11("answer_json").notNull(),
|
|
360
|
+
deletedAt: timestamp11("deleted_at"),
|
|
361
|
+
createdAt: timestamp11("created_at").notNull().defaultNow(),
|
|
362
|
+
updatedAt: timestamp11("updated_at").notNull().defaultNow()
|
|
363
|
+
},
|
|
364
|
+
(table) => [
|
|
365
|
+
index9("feedback_submissions_feedback_id_idx").on(table.feedbackId),
|
|
366
|
+
index9("feedback_submissions_user_id_idx").on(table.userId)
|
|
367
|
+
]
|
|
368
|
+
);
|
|
369
|
+
var feedbackSubmissionsRelations = relations10(feedbackSubmissions, ({ one }) => ({
|
|
370
|
+
feedback: one(feedbacks, {
|
|
371
|
+
fields: [feedbackSubmissions.feedbackId],
|
|
372
|
+
references: [feedbacks.id]
|
|
373
|
+
}),
|
|
374
|
+
user: one(users, {
|
|
375
|
+
fields: [feedbackSubmissions.userId],
|
|
376
|
+
references: [users.id]
|
|
377
|
+
})
|
|
378
|
+
}));
|
|
379
|
+
|
|
380
|
+
// feedback/feedback.schema.ts
|
|
381
|
+
var feedbacks = pgTable12(
|
|
382
|
+
"feedbacks",
|
|
383
|
+
{
|
|
384
|
+
id: text12("id").primaryKey(),
|
|
385
|
+
eventId: text12("event_id").notNull().unique().references(() => events.id, { onDelete: "cascade" }),
|
|
386
|
+
isOpen: boolean("is_open").notNull().default(true),
|
|
387
|
+
deletedAt: timestamp12("deleted_at"),
|
|
388
|
+
createdAt: timestamp12("created_at").notNull().defaultNow(),
|
|
389
|
+
updatedAt: timestamp12("updated_at").notNull().defaultNow()
|
|
390
|
+
},
|
|
391
|
+
(table) => [index10("feedbacks_event_id_idx").on(table.eventId)]
|
|
392
|
+
);
|
|
393
|
+
var feedbacksRelations = relations11(feedbacks, ({ many }) => ({
|
|
394
|
+
feedbackQuestions: many(feedbackQuestions),
|
|
395
|
+
feedbackSubmissions: many(feedbackSubmissions)
|
|
396
|
+
}));
|
|
397
|
+
|
|
398
|
+
// programs/member.schema.ts
|
|
399
|
+
import { relations as relations16 } from "drizzle-orm";
|
|
400
|
+
import { boolean as boolean3, index as index15, pgTable as pgTable17, text as text17, timestamp as timestamp17 } from "drizzle-orm/pg-core";
|
|
401
|
+
|
|
402
|
+
// programs/team.schema.ts
|
|
403
|
+
import { relations as relations15 } from "drizzle-orm";
|
|
404
|
+
import { index as index14, pgTable as pgTable16, text as text16, timestamp as timestamp16 } from "drizzle-orm/pg-core";
|
|
405
|
+
|
|
406
|
+
// programs/program.schema.ts
|
|
407
|
+
import { relations as relations14 } from "drizzle-orm";
|
|
408
|
+
import { boolean as boolean2, index as index13, integer, jsonb, pgTable as pgTable15, text as text15, timestamp as timestamp15 } from "drizzle-orm/pg-core";
|
|
409
|
+
|
|
410
|
+
// programs/program-registration.schema.ts
|
|
411
|
+
import { relations as relations12 } from "drizzle-orm";
|
|
412
|
+
import { index as index11, pgTable as pgTable13, text as text13, timestamp as timestamp13 } from "drizzle-orm/pg-core";
|
|
413
|
+
var programRegistrations = pgTable13(
|
|
414
|
+
"program_registrations",
|
|
415
|
+
{
|
|
416
|
+
id: text13("id").primaryKey(),
|
|
417
|
+
programId: text13("program_id").notNull().references(() => programs.id, { onDelete: "cascade" }),
|
|
418
|
+
userId: text13("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
419
|
+
deletedAt: timestamp13("deleted_at"),
|
|
420
|
+
createdAt: timestamp13("created_at").notNull().defaultNow(),
|
|
421
|
+
updatedAt: timestamp13("updated_at").notNull().defaultNow()
|
|
422
|
+
},
|
|
423
|
+
(table) => [
|
|
424
|
+
index11("program_registrations_program_id_idx").on(table.programId),
|
|
425
|
+
index11("program_registrations_user_id_idx").on(table.userId)
|
|
426
|
+
]
|
|
427
|
+
);
|
|
428
|
+
var programRegistrationsRelations = relations12(programRegistrations, ({ one }) => ({
|
|
429
|
+
program: one(programs, {
|
|
430
|
+
fields: [programRegistrations.programId],
|
|
431
|
+
references: [programs.id]
|
|
432
|
+
}),
|
|
433
|
+
user: one(users, {
|
|
434
|
+
fields: [programRegistrations.userId],
|
|
435
|
+
references: [users.id]
|
|
436
|
+
})
|
|
437
|
+
}));
|
|
438
|
+
|
|
439
|
+
// programs/single-participant.schema.ts
|
|
440
|
+
import { relations as relations13 } from "drizzle-orm";
|
|
441
|
+
import { index as index12, pgTable as pgTable14, text as text14, timestamp as timestamp14 } from "drizzle-orm/pg-core";
|
|
442
|
+
var singleParticipants = pgTable14(
|
|
443
|
+
"single_participants",
|
|
444
|
+
{
|
|
445
|
+
id: text14("id").primaryKey(),
|
|
446
|
+
userId: text14("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
447
|
+
programId: text14("program_id").notNull().references(() => programs.id, { onDelete: "cascade" }),
|
|
448
|
+
deletedAt: timestamp14("deleted_at"),
|
|
449
|
+
createdAt: timestamp14("created_at").notNull().defaultNow(),
|
|
450
|
+
updatedAt: timestamp14("updated_at").notNull().defaultNow()
|
|
451
|
+
},
|
|
452
|
+
(table) => [
|
|
453
|
+
index12("single_participants_user_id_idx").on(table.userId),
|
|
454
|
+
index12("single_participants_program_id_idx").on(table.programId)
|
|
455
|
+
]
|
|
456
|
+
);
|
|
457
|
+
var singleParticipantsRelations = relations13(singleParticipants, ({ one }) => ({
|
|
458
|
+
user: one(users, {
|
|
459
|
+
fields: [singleParticipants.userId],
|
|
460
|
+
references: [users.id]
|
|
461
|
+
}),
|
|
462
|
+
program: one(programs, {
|
|
463
|
+
fields: [singleParticipants.programId],
|
|
464
|
+
references: [programs.id]
|
|
465
|
+
})
|
|
466
|
+
}));
|
|
467
|
+
|
|
468
|
+
// programs/program.schema.ts
|
|
469
|
+
var programs = pgTable15(
|
|
470
|
+
"programs",
|
|
471
|
+
{
|
|
472
|
+
id: text15("id").primaryKey(),
|
|
473
|
+
code: programCodeEnum("code").notNull().unique(),
|
|
474
|
+
type: programTypeEnum("type").notNull(),
|
|
475
|
+
name: text15("name").notNull(),
|
|
476
|
+
logoUrl: text15("logo_url"),
|
|
477
|
+
about: text15("about"),
|
|
478
|
+
minAge: integer("min_age"),
|
|
479
|
+
maxAge: integer("max_age"),
|
|
480
|
+
allowedEducationLevel: text15("allowed_education_level"),
|
|
481
|
+
minMember: integer("min_member"),
|
|
482
|
+
maxMember: integer("max_member"),
|
|
483
|
+
isAbleToRegisterAsTeam: boolean2("is_able_to_register_as_team").notNull().default(false),
|
|
484
|
+
paymentBills: jsonb("payment_bills"),
|
|
485
|
+
startDate: timestamp15("start_date"),
|
|
486
|
+
extendStartDate: timestamp15("extend_start_date"),
|
|
487
|
+
endDate: timestamp15("end_date"),
|
|
488
|
+
guideBookUrl: text15("guide_book_url"),
|
|
489
|
+
assignmentUrl: text15("assignment_url"),
|
|
490
|
+
coordinationGroupUrl: text15("coordination_group_url"),
|
|
491
|
+
timeline: jsonb("timeline"),
|
|
492
|
+
testimony: jsonb("testimony"),
|
|
493
|
+
faq: jsonb("faq"),
|
|
494
|
+
contactPerson: jsonb("contact_person"),
|
|
495
|
+
content: jsonb("content"),
|
|
496
|
+
deletedAt: timestamp15("deleted_at"),
|
|
497
|
+
createdAt: timestamp15("created_at").notNull().defaultNow(),
|
|
498
|
+
updatedAt: timestamp15("updated_at").notNull().defaultNow()
|
|
499
|
+
},
|
|
500
|
+
(table) => [
|
|
501
|
+
index13("programs_code_idx").on(table.code),
|
|
502
|
+
index13("programs_name_idx").on(table.name)
|
|
503
|
+
]
|
|
504
|
+
);
|
|
505
|
+
var programsRelations = relations14(programs, ({ many }) => ({
|
|
506
|
+
programRegistrations: many(programRegistrations),
|
|
507
|
+
singleParticipants: many(singleParticipants),
|
|
508
|
+
teams: many(teams)
|
|
509
|
+
}));
|
|
510
|
+
|
|
511
|
+
// programs/team.schema.ts
|
|
512
|
+
var teams = pgTable16(
|
|
513
|
+
"teams",
|
|
514
|
+
{
|
|
515
|
+
id: text16("id").primaryKey(),
|
|
516
|
+
programId: text16("program_id").notNull().references(() => programs.id, { onDelete: "cascade" }),
|
|
517
|
+
name: text16("name").notNull(),
|
|
518
|
+
code: text16("code").notNull().unique(),
|
|
519
|
+
status: teamStatusEnum("status").notNull().default("WAITING_FOR_VERIFICATION"),
|
|
520
|
+
notes: text16("notes"),
|
|
521
|
+
deletedAt: timestamp16("deleted_at"),
|
|
522
|
+
createdAt: timestamp16("created_at").notNull().defaultNow(),
|
|
523
|
+
updatedAt: timestamp16("updated_at").notNull().defaultNow()
|
|
524
|
+
},
|
|
525
|
+
(table) => [
|
|
526
|
+
index14("teams_program_id_idx").on(table.programId),
|
|
527
|
+
index14("teams_code_idx").on(table.code),
|
|
528
|
+
index14("teams_name_idx").on(table.name)
|
|
529
|
+
]
|
|
530
|
+
);
|
|
531
|
+
var teamsRelations = relations15(teams, ({ one, many }) => ({
|
|
532
|
+
program: one(programs, {
|
|
533
|
+
fields: [teams.programId],
|
|
534
|
+
references: [programs.id]
|
|
535
|
+
}),
|
|
536
|
+
members: many(members)
|
|
537
|
+
}));
|
|
538
|
+
|
|
539
|
+
// programs/member.schema.ts
|
|
540
|
+
var members = pgTable17(
|
|
541
|
+
"members",
|
|
542
|
+
{
|
|
543
|
+
id: text17("id").primaryKey(),
|
|
544
|
+
userId: text17("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
545
|
+
teamId: text17("team_id").notNull().references(() => teams.id, { onDelete: "cascade" }),
|
|
546
|
+
isLeader: boolean3("is_leader").notNull().default(false),
|
|
547
|
+
deletedAt: timestamp17("deleted_at"),
|
|
548
|
+
createdAt: timestamp17("created_at").notNull().defaultNow(),
|
|
549
|
+
updatedAt: timestamp17("updated_at").notNull().defaultNow()
|
|
550
|
+
},
|
|
551
|
+
(table) => [
|
|
552
|
+
index15("members_user_id_idx").on(table.userId),
|
|
553
|
+
index15("members_team_id_idx").on(table.teamId)
|
|
554
|
+
]
|
|
555
|
+
);
|
|
556
|
+
var membersRelations = relations16(members, ({ one }) => ({
|
|
557
|
+
user: one(users, {
|
|
558
|
+
fields: [members.userId],
|
|
559
|
+
references: [users.id]
|
|
560
|
+
}),
|
|
561
|
+
team: one(teams, {
|
|
562
|
+
fields: [members.teamId],
|
|
563
|
+
references: [teams.id]
|
|
564
|
+
})
|
|
565
|
+
}));
|
|
566
|
+
|
|
567
|
+
// tasks/program-task.schema.ts
|
|
568
|
+
import { relations as relations17 } from "drizzle-orm";
|
|
569
|
+
import { index as index16, pgTable as pgTable18, text as text18, timestamp as timestamp18 } from "drizzle-orm/pg-core";
|
|
570
|
+
var programTasks = pgTable18(
|
|
571
|
+
"program_tasks",
|
|
572
|
+
{
|
|
573
|
+
id: text18("id").primaryKey(),
|
|
574
|
+
programId: text18("program_id").notNull().references(() => programs.id, { onDelete: "cascade" }),
|
|
575
|
+
title: text18("title").notNull(),
|
|
576
|
+
deadline: timestamp18("deadline"),
|
|
577
|
+
description: text18("description"),
|
|
578
|
+
guideBookUrl: text18("guide_book_url"),
|
|
579
|
+
type: programTaskTypeEnum("type").notNull(),
|
|
580
|
+
acceptedFileTypes: fileTypeEnum("accepted_file_types").array(),
|
|
581
|
+
deletedAt: timestamp18("deleted_at"),
|
|
582
|
+
createdAt: timestamp18("created_at").notNull().defaultNow(),
|
|
583
|
+
updatedAt: timestamp18("updated_at").notNull().defaultNow()
|
|
584
|
+
},
|
|
585
|
+
(table) => [index16("program_tasks_program_id_idx").on(table.programId)]
|
|
586
|
+
);
|
|
587
|
+
var programTasksRelations = relations17(programTasks, ({ one }) => ({
|
|
588
|
+
program: one(programs, {
|
|
589
|
+
fields: [programTasks.programId],
|
|
590
|
+
references: [programs.id]
|
|
591
|
+
})
|
|
592
|
+
}));
|
|
593
|
+
|
|
594
|
+
// tasks/program-task-extra-description.schema.ts
|
|
595
|
+
import { relations as relations18 } from "drizzle-orm";
|
|
596
|
+
import { boolean as boolean4, index as index17, pgTable as pgTable19, text as text19, timestamp as timestamp19 } from "drizzle-orm/pg-core";
|
|
597
|
+
var programTaskExtraDescriptions = pgTable19(
|
|
598
|
+
"program_task_extra_descriptions",
|
|
599
|
+
{
|
|
600
|
+
id: text19("id").primaryKey(),
|
|
601
|
+
taskId: text19("task_id").notNull().references(() => programTasks.id, { onDelete: "cascade" }),
|
|
602
|
+
description: text19("description").notNull(),
|
|
603
|
+
forProgram: boolean4("for_program").notNull().default(true),
|
|
604
|
+
deletedAt: timestamp19("deleted_at"),
|
|
605
|
+
createdAt: timestamp19("created_at").notNull().defaultNow(),
|
|
606
|
+
updatedAt: timestamp19("updated_at").notNull().defaultNow()
|
|
607
|
+
},
|
|
608
|
+
(table) => [index17("program_task_extra_descriptions_task_id_idx").on(table.taskId)]
|
|
609
|
+
);
|
|
610
|
+
var programTaskExtraDescriptionsRelations = relations18(
|
|
611
|
+
programTaskExtraDescriptions,
|
|
612
|
+
({ one }) => ({
|
|
613
|
+
task: one(programTasks, {
|
|
614
|
+
fields: [programTaskExtraDescriptions.taskId],
|
|
615
|
+
references: [programTasks.id]
|
|
616
|
+
})
|
|
617
|
+
})
|
|
618
|
+
);
|
|
619
|
+
|
|
620
|
+
// tasks/program-task-submission.schema.ts
|
|
621
|
+
import { relations as relations19 } from "drizzle-orm";
|
|
622
|
+
import { index as index18, pgEnum as pgEnum2, pgTable as pgTable20, text as text20, timestamp as timestamp20 } from "drizzle-orm/pg-core";
|
|
623
|
+
var submissionStatusEnumLocal = pgEnum2("submission_status", [
|
|
624
|
+
"PENDING",
|
|
625
|
+
"REJECTED",
|
|
626
|
+
"ACCEPTED"
|
|
627
|
+
]);
|
|
628
|
+
var programTaskSubmissions = pgTable20(
|
|
629
|
+
"programTaskSubmissions",
|
|
630
|
+
{
|
|
631
|
+
id: text20("id").primaryKey(),
|
|
632
|
+
taskId: text20("taskId").references(() => programTasks.id, {
|
|
633
|
+
onDelete: "cascade"
|
|
634
|
+
}),
|
|
635
|
+
teamId: text20("teamId").references(() => teams.id, {
|
|
636
|
+
onDelete: "cascade"
|
|
637
|
+
}),
|
|
638
|
+
userId: text20("userId").references(() => users.id, {
|
|
639
|
+
onDelete: "cascade"
|
|
640
|
+
}),
|
|
641
|
+
fileUrl: text20("fileUrl"),
|
|
642
|
+
fileName: text20("fileName"),
|
|
643
|
+
status: submissionStatusEnumLocal("status").notNull().default("PENDING"),
|
|
644
|
+
feedback: text20("feedback"),
|
|
645
|
+
submissionForProgram: programCodeEnum("submissionForProgram"),
|
|
646
|
+
createdAt: timestamp20("createdAt").notNull().defaultNow(),
|
|
647
|
+
updatedAt: timestamp20("updatedAt").notNull().defaultNow()
|
|
648
|
+
},
|
|
649
|
+
(table) => [
|
|
650
|
+
index18("program_task_submissions_task_id_idx").on(table.taskId),
|
|
651
|
+
index18("program_task_submissions_team_id_idx").on(table.teamId),
|
|
652
|
+
index18("program_task_submissions_user_id_idx").on(table.userId),
|
|
653
|
+
index18("program_task_submissions_task_team_program_idx").on(
|
|
654
|
+
table.taskId,
|
|
655
|
+
table.teamId,
|
|
656
|
+
table.submissionForProgram
|
|
657
|
+
),
|
|
658
|
+
index18("program_task_submissions_task_user_program_idx").on(
|
|
659
|
+
table.taskId,
|
|
660
|
+
table.userId,
|
|
661
|
+
table.submissionForProgram
|
|
662
|
+
)
|
|
663
|
+
]
|
|
664
|
+
);
|
|
665
|
+
var programTaskSubmissionsRelations = relations19(programTaskSubmissions, ({ one }) => ({
|
|
666
|
+
task: one(programTasks, {
|
|
667
|
+
fields: [programTaskSubmissions.taskId],
|
|
668
|
+
references: [programTasks.id]
|
|
669
|
+
}),
|
|
670
|
+
team: one(teams, {
|
|
671
|
+
fields: [programTaskSubmissions.teamId],
|
|
672
|
+
references: [teams.id]
|
|
673
|
+
}),
|
|
674
|
+
user: one(users, {
|
|
675
|
+
fields: [programTaskSubmissions.userId],
|
|
676
|
+
references: [users.id]
|
|
677
|
+
})
|
|
678
|
+
}));
|
|
679
|
+
|
|
680
|
+
// tasks/xcelerate-workshop-task.schema.ts
|
|
681
|
+
import { index as index19, integer as integer2, pgTable as pgTable21, text as text21, timestamp as timestamp21 } from "drizzle-orm/pg-core";
|
|
682
|
+
var xcelerateWorkshopTasks = pgTable21(
|
|
683
|
+
"xcelerateWorkshopTasks",
|
|
684
|
+
{
|
|
685
|
+
id: text21("id").primaryKey(),
|
|
686
|
+
title: text21("title").notNull(),
|
|
687
|
+
description: text21("description"),
|
|
688
|
+
deadline: timestamp21("deadline"),
|
|
689
|
+
batch: integer2("batch"),
|
|
690
|
+
taskUrl: text21("taskUrl"),
|
|
691
|
+
createdAt: timestamp21("createdAt").notNull().defaultNow(),
|
|
692
|
+
updatedAt: timestamp21("updatedAt").notNull().defaultNow()
|
|
693
|
+
},
|
|
694
|
+
(table) => [
|
|
695
|
+
index19("xcelerate_workshop_tasks_batch_idx").on(table.batch),
|
|
696
|
+
index19("xcelerate_workshop_tasks_deadline_idx").on(table.deadline)
|
|
697
|
+
]
|
|
698
|
+
);
|
|
699
|
+
|
|
700
|
+
// tasks/xcelerate-workshop-task-submission.schema.ts
|
|
701
|
+
import { relations as relations20 } from "drizzle-orm";
|
|
702
|
+
import { index as index20, pgTable as pgTable22, text as text22, timestamp as timestamp22, uniqueIndex } from "drizzle-orm/pg-core";
|
|
703
|
+
var xcelerateWorkshopTaskSubmissions = pgTable22(
|
|
704
|
+
"xcelerateWorkshopTaskSubmissions",
|
|
705
|
+
{
|
|
706
|
+
id: text22("id").primaryKey(),
|
|
707
|
+
taskId: text22("taskId").references(() => xcelerateWorkshopTasks.id, {
|
|
708
|
+
onDelete: "cascade"
|
|
709
|
+
}),
|
|
710
|
+
userId: text22("userId").references(() => users.id, {
|
|
711
|
+
onDelete: "cascade"
|
|
712
|
+
}),
|
|
713
|
+
fileUrl: text22("fileUrl"),
|
|
714
|
+
status: submissionStatusEnum("status").notNull().default("PENDING"),
|
|
715
|
+
feedback: text22("feedback"),
|
|
716
|
+
createdAt: timestamp22("createdAt").notNull().defaultNow(),
|
|
717
|
+
updatedAt: timestamp22("updatedAt").notNull().defaultNow()
|
|
718
|
+
},
|
|
719
|
+
(table) => [
|
|
720
|
+
index20("xcelerate_workshop_task_submissions_task_id_idx").on(table.taskId),
|
|
721
|
+
index20("xcelerate_workshop_task_submissions_user_id_idx").on(table.userId),
|
|
722
|
+
uniqueIndex("xcelerate_workshop_task_submissions_task_user_idx").on(
|
|
723
|
+
table.taskId,
|
|
724
|
+
table.userId
|
|
725
|
+
)
|
|
726
|
+
]
|
|
727
|
+
);
|
|
728
|
+
var xcelerateWorkshopTaskSubmissionsRelations = relations20(
|
|
729
|
+
xcelerateWorkshopTaskSubmissions,
|
|
730
|
+
({ one }) => ({
|
|
731
|
+
task: one(xcelerateWorkshopTasks, {
|
|
732
|
+
fields: [xcelerateWorkshopTaskSubmissions.taskId],
|
|
733
|
+
references: [xcelerateWorkshopTasks.id]
|
|
734
|
+
}),
|
|
735
|
+
user: one(users, {
|
|
736
|
+
fields: [xcelerateWorkshopTaskSubmissions.userId],
|
|
737
|
+
references: [users.id]
|
|
738
|
+
})
|
|
739
|
+
})
|
|
740
|
+
);
|
|
741
|
+
|
|
742
|
+
// announcements/announcement.schema.ts
|
|
743
|
+
import { relations as relations21 } from "drizzle-orm";
|
|
744
|
+
import { index as index21, pgTable as pgTable23, text as text23, timestamp as timestamp23 } from "drizzle-orm/pg-core";
|
|
745
|
+
var announcements = pgTable23(
|
|
746
|
+
"announcements",
|
|
747
|
+
{
|
|
748
|
+
id: text23("id").primaryKey(),
|
|
749
|
+
programId: text23("program_id").notNull().references(() => programs.id, { onDelete: "cascade" }),
|
|
750
|
+
title: text23("title").notNull(),
|
|
751
|
+
description: text23("description"),
|
|
752
|
+
deletedAt: timestamp23("deleted_at"),
|
|
753
|
+
createdAt: timestamp23("created_at").notNull().defaultNow(),
|
|
754
|
+
updatedAt: timestamp23("updated_at").notNull().defaultNow()
|
|
755
|
+
},
|
|
756
|
+
(table) => [index21("announcements_program_id_idx").on(table.programId)]
|
|
757
|
+
);
|
|
758
|
+
var announcementsRelations = relations21(announcements, ({ one }) => ({
|
|
759
|
+
program: one(programs, {
|
|
760
|
+
fields: [announcements.programId],
|
|
761
|
+
references: [programs.id]
|
|
762
|
+
})
|
|
763
|
+
}));
|
|
764
|
+
|
|
765
|
+
// playground/leaderboard-history.schema.ts
|
|
766
|
+
import { pgTable as pgTable24, timestamp as timestamp24, uuid } from "drizzle-orm/pg-core";
|
|
767
|
+
import { jsonb as jsonb2 } from "drizzle-orm/pg-core";
|
|
768
|
+
var leaderboardHistories = pgTable24("leaderboardHistories", {
|
|
769
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
770
|
+
jsonData: jsonb2("json_data").notNull(),
|
|
771
|
+
createdAt: timestamp24("created_at").notNull().defaultNow(),
|
|
772
|
+
updatedAt: timestamp24("updated_at").notNull().defaultNow()
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
// playground/user-playground.schema.ts
|
|
776
|
+
import { index as index22, pgTable as pgTable25, text as text24, timestamp as timestamp25, uuid as uuid2 } from "drizzle-orm/pg-core";
|
|
777
|
+
var userPlaygrounds = pgTable25(
|
|
778
|
+
"userPlaygrounds",
|
|
779
|
+
{
|
|
780
|
+
id: uuid2("id").primaryKey().defaultRandom(),
|
|
781
|
+
userId: text24("user_id").notNull().unique().references(() => users.id, { onDelete: "cascade" }),
|
|
782
|
+
username: text24("username").notNull(),
|
|
783
|
+
virtualPoint: text24("virtual_point").notNull().default("0"),
|
|
784
|
+
mainEventCurrency: text24("main_event_currency").notNull().default("0"),
|
|
785
|
+
deletedAt: timestamp25("deleted_at"),
|
|
786
|
+
createdAt: timestamp25("created_at").notNull().defaultNow(),
|
|
787
|
+
updatedAt: timestamp25("updated_at").notNull().defaultNow()
|
|
788
|
+
},
|
|
789
|
+
(table) => [index22("userPlaygrounds_userId_idx").on(table.userId)]
|
|
790
|
+
);
|
|
791
|
+
|
|
792
|
+
// playground/user-playground-detention.schema.ts
|
|
793
|
+
import { boolean as boolean5, index as index23, pgTable as pgTable26, text as text25, timestamp as timestamp26, uuid as uuid3 } from "drizzle-orm/pg-core";
|
|
794
|
+
var userPlaygroundDetentions = pgTable26(
|
|
795
|
+
"userPlaygroundDetentions",
|
|
796
|
+
{
|
|
797
|
+
id: uuid3("id").primaryKey().defaultRandom(),
|
|
798
|
+
userPlaygroundId: uuid3("user_playground_id").notNull().unique().references(() => userPlaygrounds.id, { onDelete: "cascade" }),
|
|
799
|
+
description: text25("description").notNull(),
|
|
800
|
+
penaltyPoint: text25("penalty_point").notNull(),
|
|
801
|
+
state: detentionStateEnum("state").notNull(),
|
|
802
|
+
isRead: boolean5("is_read").notNull().default(false),
|
|
803
|
+
deletedAt: timestamp26("deleted_at"),
|
|
804
|
+
createdAt: timestamp26("created_at").notNull().defaultNow(),
|
|
805
|
+
updatedAt: timestamp26("updated_at").notNull().defaultNow()
|
|
806
|
+
},
|
|
807
|
+
(table) => [index23("userPlaygroundDetentions_userPlaygroundId_idx").on(table.userPlaygroundId)]
|
|
808
|
+
);
|
|
809
|
+
|
|
810
|
+
// games/game.schema.ts
|
|
811
|
+
import { relations as relations26 } from "drizzle-orm";
|
|
812
|
+
import { boolean as boolean8, pgTable as pgTable31, text as text29, timestamp as timestamp31 } from "drizzle-orm/pg-core";
|
|
813
|
+
|
|
814
|
+
// games/game-developer.schema.ts
|
|
815
|
+
import { relations as relations22 } from "drizzle-orm";
|
|
816
|
+
import { pgTable as pgTable27, text as text26, timestamp as timestamp27 } from "drizzle-orm/pg-core";
|
|
817
|
+
var gameDevelopers = pgTable27("gameDevelopers", {
|
|
818
|
+
id: text26("id").primaryKey(),
|
|
819
|
+
gameId: text26("gameId").references(() => games.id, { onDelete: "cascade" }).notNull(),
|
|
820
|
+
name: text26("name").notNull(),
|
|
821
|
+
description: text26("description"),
|
|
822
|
+
imageUrl: text26("imageUrl"),
|
|
823
|
+
instagramUrl: text26("instagramUrl"),
|
|
824
|
+
linkedInUrl: text26("linkedInUrl"),
|
|
825
|
+
createdAt: timestamp27("createdAt").notNull().defaultNow(),
|
|
826
|
+
updatedAt: timestamp27("updatedAt").notNull().defaultNow()
|
|
827
|
+
});
|
|
828
|
+
var gameDevelopersRelations = relations22(gameDevelopers, ({ one }) => ({
|
|
829
|
+
game: one(games, {
|
|
830
|
+
fields: [gameDevelopers.gameId],
|
|
831
|
+
references: [games.id]
|
|
832
|
+
})
|
|
833
|
+
}));
|
|
834
|
+
|
|
835
|
+
// games/game-rule.schema.ts
|
|
836
|
+
import { relations as relations23 } from "drizzle-orm";
|
|
837
|
+
import { pgTable as pgTable28, text as text27, timestamp as timestamp28 } from "drizzle-orm/pg-core";
|
|
838
|
+
var gameRules = pgTable28("gameRules", {
|
|
839
|
+
id: text27("id").primaryKey(),
|
|
840
|
+
gameId: text27("gameId").references(() => games.id, { onDelete: "cascade" }).notNull(),
|
|
841
|
+
title: text27("title").notNull(),
|
|
842
|
+
rule: text27("rule").notNull(),
|
|
843
|
+
createdAt: timestamp28("createdAt").notNull().defaultNow(),
|
|
844
|
+
updatedAt: timestamp28("updatedAt").notNull().defaultNow()
|
|
845
|
+
});
|
|
846
|
+
var gameRulesRelations = relations23(gameRules, ({ one }) => ({
|
|
847
|
+
game: one(games, {
|
|
848
|
+
fields: [gameRules.gameId],
|
|
849
|
+
references: [games.id]
|
|
850
|
+
})
|
|
851
|
+
}));
|
|
852
|
+
|
|
853
|
+
// games/user-play-game-history.schema.ts
|
|
854
|
+
import { relations as relations25 } from "drizzle-orm";
|
|
855
|
+
import { boolean as boolean7, pgTable as pgTable30, text as text28, timestamp as timestamp30, uuid as uuid5 } from "drizzle-orm/pg-core";
|
|
856
|
+
|
|
857
|
+
// tokens/playground-token.schema.ts
|
|
858
|
+
import { relations as relations24 } from "drizzle-orm";
|
|
859
|
+
import { boolean as boolean6, pgTable as pgTable29, timestamp as timestamp29, uuid as uuid4, varchar } from "drizzle-orm/pg-core";
|
|
860
|
+
var playgroundTokens = pgTable29("playgroundTokens", {
|
|
861
|
+
id: uuid4("id").primaryKey().defaultRandom(),
|
|
862
|
+
userPlaygroundId: uuid4("userPlaygroundId").references(() => userPlaygrounds.id, { onDelete: "cascade" }).notNull(),
|
|
863
|
+
code: varchar("code", { length: 6 }).notNull().unique(),
|
|
864
|
+
tokenType: tokenTypeEnum("tokenType").notNull(),
|
|
865
|
+
isUsed: boolean6("isUsed").notNull().default(false),
|
|
866
|
+
usedAt: timestamp29("usedAt"),
|
|
867
|
+
deletedAt: timestamp29("deletedAt"),
|
|
868
|
+
createdAt: timestamp29("createdAt").notNull().defaultNow(),
|
|
869
|
+
updatedAt: timestamp29("updatedAt").notNull().defaultNow()
|
|
870
|
+
});
|
|
871
|
+
var playgroundTokensRelations = relations24(playgroundTokens, ({ one }) => ({
|
|
872
|
+
userPlayground: one(userPlaygrounds, {
|
|
873
|
+
fields: [playgroundTokens.userPlaygroundId],
|
|
874
|
+
references: [userPlaygrounds.id]
|
|
875
|
+
})
|
|
876
|
+
}));
|
|
877
|
+
|
|
878
|
+
// games/user-play-game-history.schema.ts
|
|
879
|
+
var userPlayGameHistories = pgTable30("userPlayGameHistories", {
|
|
880
|
+
id: text28("id").primaryKey(),
|
|
881
|
+
userPlaygroundId: uuid5("userPlaygroundId").references(() => userPlaygrounds.id, { onDelete: "cascade" }).notNull(),
|
|
882
|
+
gameId: text28("gameId").references(() => games.id, { onDelete: "cascade" }).notNull(),
|
|
883
|
+
tokenUsedId: uuid5("tokenUsedId").references(() => playgroundTokens.id, {
|
|
884
|
+
onDelete: "set null"
|
|
885
|
+
}),
|
|
886
|
+
isFinished: boolean7("isFinished").notNull().default(false),
|
|
887
|
+
finishedAt: timestamp30("finishedAt"),
|
|
888
|
+
createdAt: timestamp30("createdAt").notNull().defaultNow(),
|
|
889
|
+
updatedAt: timestamp30("updatedAt").notNull().defaultNow()
|
|
890
|
+
});
|
|
891
|
+
var userPlayGameHistoriesRelations = relations25(userPlayGameHistories, ({ one }) => ({
|
|
892
|
+
userPlayground: one(userPlaygrounds, {
|
|
893
|
+
fields: [userPlayGameHistories.userPlaygroundId],
|
|
894
|
+
references: [userPlaygrounds.id]
|
|
895
|
+
}),
|
|
896
|
+
game: one(games, {
|
|
897
|
+
fields: [userPlayGameHistories.gameId],
|
|
898
|
+
references: [games.id]
|
|
899
|
+
}),
|
|
900
|
+
tokenUsed: one(playgroundTokens, {
|
|
901
|
+
fields: [userPlayGameHistories.tokenUsedId],
|
|
902
|
+
references: [playgroundTokens.id]
|
|
903
|
+
})
|
|
904
|
+
}));
|
|
905
|
+
|
|
906
|
+
// games/game.schema.ts
|
|
907
|
+
var games = pgTable31("games", {
|
|
908
|
+
id: text29("id").primaryKey(),
|
|
909
|
+
name: text29("name").notNull(),
|
|
910
|
+
arcadeCode: text29("arcadeCode").notNull().unique(),
|
|
911
|
+
arcadeUrl: text29("arcadeUrl"),
|
|
912
|
+
description: text29("description"),
|
|
913
|
+
rules: text29("rules").array(),
|
|
914
|
+
isGetPoint: boolean8("isGetPoint").notNull().default(false),
|
|
915
|
+
orientation: gameOrientationEnum("orientation").notNull().default("VERTICAL"),
|
|
916
|
+
createdAt: timestamp31("createdAt").notNull().defaultNow(),
|
|
917
|
+
updatedAt: timestamp31("updatedAt").notNull().defaultNow()
|
|
918
|
+
});
|
|
919
|
+
var gamesRelations = relations26(games, ({ many }) => ({
|
|
920
|
+
gameRules: many(gameRules),
|
|
921
|
+
gameDevelopers: many(gameDevelopers),
|
|
922
|
+
userPlayGameHistories: many(userPlayGameHistories)
|
|
923
|
+
}));
|
|
924
|
+
|
|
925
|
+
// tokens/playground-expense-history.schema.ts
|
|
926
|
+
import { relations as relations27 } from "drizzle-orm";
|
|
927
|
+
import { index as index24, integer as integer3, pgTable as pgTable32, text as text30, timestamp as timestamp32, uuid as uuid6 } from "drizzle-orm/pg-core";
|
|
928
|
+
var playgroundExpenseHistories = pgTable32(
|
|
929
|
+
"playgroundExpenseHistories",
|
|
930
|
+
{
|
|
931
|
+
id: text30("id").primaryKey(),
|
|
932
|
+
userPlaygroundId: uuid6("userPlaygroundId").references(() => userPlaygrounds.id, {
|
|
933
|
+
onDelete: "cascade"
|
|
934
|
+
}),
|
|
935
|
+
description: text30("description"),
|
|
936
|
+
amount: integer3("amount").notNull(),
|
|
937
|
+
createdAt: timestamp32("createdAt").notNull().defaultNow(),
|
|
938
|
+
updatedAt: timestamp32("updatedAt").notNull().defaultNow()
|
|
939
|
+
},
|
|
940
|
+
(table) => [
|
|
941
|
+
index24("playgroundExpenseHistories_userPlaygroundId_idx").on(table.userPlaygroundId)
|
|
942
|
+
]
|
|
943
|
+
);
|
|
944
|
+
var playgroundExpenseHistoriesRelations = relations27(
|
|
945
|
+
playgroundExpenseHistories,
|
|
946
|
+
({ one }) => ({
|
|
947
|
+
userPlayground: one(userPlaygrounds, {
|
|
948
|
+
fields: [playgroundExpenseHistories.userPlaygroundId],
|
|
949
|
+
references: [userPlaygrounds.id]
|
|
950
|
+
})
|
|
951
|
+
})
|
|
952
|
+
);
|
|
953
|
+
|
|
954
|
+
// tokens/playground-reward-history.schema.ts
|
|
955
|
+
import { relations as relations28 } from "drizzle-orm";
|
|
956
|
+
import { index as index25, integer as integer4, pgTable as pgTable33, text as text31, timestamp as timestamp33, uuid as uuid7 } from "drizzle-orm/pg-core";
|
|
957
|
+
var playgroundRewardHistories = pgTable33(
|
|
958
|
+
"playgroundRewardHistories",
|
|
959
|
+
{
|
|
960
|
+
id: text31("id").primaryKey(),
|
|
961
|
+
userPlaygroundId: uuid7("userPlaygroundId").references(() => userPlaygrounds.id, {
|
|
962
|
+
onDelete: "cascade"
|
|
963
|
+
}),
|
|
964
|
+
description: text31("description"),
|
|
965
|
+
rewardType: rewardTypeEnum("rewardType").notNull(),
|
|
966
|
+
amount: integer4("amount").notNull(),
|
|
967
|
+
createdAt: timestamp33("createdAt").notNull().defaultNow(),
|
|
968
|
+
updatedAt: timestamp33("updatedAt").notNull().defaultNow()
|
|
969
|
+
},
|
|
970
|
+
(table) => [index25("playgroundRewardHistories_userPlaygroundId_idx").on(table.userPlaygroundId)]
|
|
971
|
+
);
|
|
972
|
+
var playgroundRewardHistoriesRelations = relations28(
|
|
973
|
+
playgroundRewardHistories,
|
|
974
|
+
({ one }) => ({
|
|
975
|
+
userPlayground: one(userPlaygrounds, {
|
|
976
|
+
fields: [playgroundRewardHistories.userPlaygroundId],
|
|
977
|
+
references: [userPlaygrounds.id]
|
|
978
|
+
})
|
|
979
|
+
})
|
|
980
|
+
);
|
|
981
|
+
|
|
982
|
+
// ads/ad-watch-history.schema.ts
|
|
983
|
+
import { relations as relations29 } from "drizzle-orm";
|
|
984
|
+
import { pgTable as pgTable35, text as text33, timestamp as timestamp35, uuid as uuid8 } from "drizzle-orm/pg-core";
|
|
985
|
+
|
|
986
|
+
// ads/advertisement.schema.ts
|
|
987
|
+
import { boolean as boolean9, integer as integer5, pgTable as pgTable34, text as text32, timestamp as timestamp34 } from "drizzle-orm/pg-core";
|
|
988
|
+
var advertisements = pgTable34("advertisements", {
|
|
989
|
+
id: text32("id").primaryKey(),
|
|
990
|
+
contentUrl: text32("contentUrl").notNull(),
|
|
991
|
+
isVideo: boolean9("isVideo").notNull().default(false),
|
|
992
|
+
contentLength: integer5("contentLength"),
|
|
993
|
+
createdAt: timestamp34("createdAt").notNull().defaultNow(),
|
|
994
|
+
updatedAt: timestamp34("updatedAt").notNull().defaultNow()
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
// ads/ad-watch-history.schema.ts
|
|
998
|
+
var adWatchHistories = pgTable35("adWatchHistories", {
|
|
999
|
+
id: text33("id").primaryKey(),
|
|
1000
|
+
userPlaygroundId: uuid8("userPlaygroundId").references(() => userPlaygrounds.id, {
|
|
1001
|
+
onDelete: "cascade"
|
|
1002
|
+
}),
|
|
1003
|
+
adId: text33("adId").references(() => advertisements.id, { onDelete: "cascade" }),
|
|
1004
|
+
referer: text33("referer"),
|
|
1005
|
+
watchedAt: timestamp35("watchedAt").notNull(),
|
|
1006
|
+
createdAt: timestamp35("createdAt").notNull().defaultNow(),
|
|
1007
|
+
updatedAt: timestamp35("updatedAt").notNull().defaultNow()
|
|
1008
|
+
});
|
|
1009
|
+
var adWatchHistoriesRelations = relations29(adWatchHistories, ({ one }) => ({
|
|
1010
|
+
userPlayground: one(userPlaygrounds, {
|
|
1011
|
+
fields: [adWatchHistories.userPlaygroundId],
|
|
1012
|
+
references: [userPlaygrounds.id]
|
|
1013
|
+
}),
|
|
1014
|
+
advertisement: one(advertisements, {
|
|
1015
|
+
fields: [adWatchHistories.adId],
|
|
1016
|
+
references: [advertisements.id]
|
|
1017
|
+
})
|
|
1018
|
+
}));
|
|
1019
|
+
|
|
1020
|
+
// ads/ad-watch-session.schema.ts
|
|
1021
|
+
import { relations as relations30 } from "drizzle-orm";
|
|
1022
|
+
import { integer as integer6, pgTable as pgTable36, text as text34, timestamp as timestamp36, uuid as uuid9 } from "drizzle-orm/pg-core";
|
|
1023
|
+
var adWatchSessions = pgTable36("adWatchSessions", {
|
|
1024
|
+
id: text34("id").primaryKey(),
|
|
1025
|
+
userPlaygroundId: uuid9("userPlaygroundId").references(() => userPlaygrounds.id, {
|
|
1026
|
+
onDelete: "cascade"
|
|
1027
|
+
}),
|
|
1028
|
+
adId: text34("adId").references(() => advertisements.id, { onDelete: "cascade" }),
|
|
1029
|
+
adLength: integer6("adLength"),
|
|
1030
|
+
startTimeUnix: integer6("startTimeUnix").notNull(),
|
|
1031
|
+
lockUntil: integer6("lockUntil"),
|
|
1032
|
+
finishedAt: timestamp36("finishedAt"),
|
|
1033
|
+
createdAt: timestamp36("createdAt").notNull().defaultNow(),
|
|
1034
|
+
updatedAt: timestamp36("updatedAt").notNull().defaultNow()
|
|
1035
|
+
});
|
|
1036
|
+
var adWatchSessionsRelations = relations30(adWatchSessions, ({ one }) => ({
|
|
1037
|
+
userPlayground: one(userPlaygrounds, {
|
|
1038
|
+
fields: [adWatchSessions.userPlaygroundId],
|
|
1039
|
+
references: [userPlaygrounds.id]
|
|
1040
|
+
}),
|
|
1041
|
+
advertisement: one(advertisements, {
|
|
1042
|
+
fields: [adWatchSessions.adId],
|
|
1043
|
+
references: [advertisements.id]
|
|
1044
|
+
})
|
|
1045
|
+
}));
|
|
1046
|
+
|
|
1047
|
+
// quiz/main-event-mini-quiz.schema.ts
|
|
1048
|
+
import { relations as relations34 } from "drizzle-orm";
|
|
1049
|
+
import { index as index29, pgTable as pgTable40, text as text38, timestamp as timestamp40 } from "drizzle-orm/pg-core";
|
|
1050
|
+
|
|
1051
|
+
// quiz/main-event-mini-quiz-attempt.schema.ts
|
|
1052
|
+
import { relations as relations31 } from "drizzle-orm";
|
|
1053
|
+
import { index as index26, json, pgTable as pgTable37, text as text35, timestamp as timestamp37 } from "drizzle-orm/pg-core";
|
|
1054
|
+
var mainEventMiniQuizAttempts = pgTable37(
|
|
1055
|
+
"mainEventMiniQuizAttempts",
|
|
1056
|
+
{
|
|
1057
|
+
id: text35("id").primaryKey(),
|
|
1058
|
+
quizId: text35("quizId").references(() => mainEventMiniQuizzes.id, { onDelete: "cascade" }),
|
|
1059
|
+
userId: text35("userId").references(() => users.id, { onDelete: "cascade" }),
|
|
1060
|
+
answerJson: json("answerJson"),
|
|
1061
|
+
attemptedAt: timestamp37("attemptedAt"),
|
|
1062
|
+
createdAt: timestamp37("createdAt").notNull().defaultNow(),
|
|
1063
|
+
updatedAt: timestamp37("updatedAt").notNull().defaultNow()
|
|
1064
|
+
},
|
|
1065
|
+
(table) => [
|
|
1066
|
+
index26("mainEventMiniQuizAttempts_quizId_idx").on(table.quizId),
|
|
1067
|
+
index26("mainEventMiniQuizAttempts_userId_idx").on(table.userId)
|
|
1068
|
+
]
|
|
1069
|
+
);
|
|
1070
|
+
var mainEventMiniQuizAttemptsRelations = relations31(
|
|
1071
|
+
mainEventMiniQuizAttempts,
|
|
1072
|
+
({ one }) => ({
|
|
1073
|
+
quiz: one(mainEventMiniQuizzes, {
|
|
1074
|
+
fields: [mainEventMiniQuizAttempts.quizId],
|
|
1075
|
+
references: [mainEventMiniQuizzes.id]
|
|
1076
|
+
}),
|
|
1077
|
+
user: one(users, {
|
|
1078
|
+
fields: [mainEventMiniQuizAttempts.userId],
|
|
1079
|
+
references: [users.id]
|
|
1080
|
+
})
|
|
1081
|
+
})
|
|
1082
|
+
);
|
|
1083
|
+
|
|
1084
|
+
// quiz/main-event-mini-quiz-question.schema.ts
|
|
1085
|
+
import { relations as relations33 } from "drizzle-orm";
|
|
1086
|
+
import { index as index28, pgTable as pgTable39, text as text37, timestamp as timestamp39 } from "drizzle-orm/pg-core";
|
|
1087
|
+
|
|
1088
|
+
// quiz/main-event-mini-quiz-question-option.schema.ts
|
|
1089
|
+
import { relations as relations32 } from "drizzle-orm";
|
|
1090
|
+
import { boolean as boolean10, index as index27, pgTable as pgTable38, text as text36, timestamp as timestamp38 } from "drizzle-orm/pg-core";
|
|
1091
|
+
var mainEventMiniQuizQuestionOptions = pgTable38(
|
|
1092
|
+
"mainEventMiniQuizQuestionOptions",
|
|
1093
|
+
{
|
|
1094
|
+
id: text36("id").primaryKey(),
|
|
1095
|
+
questionId: text36("questionId").references(() => mainEventMiniQuizQuestions.id, {
|
|
1096
|
+
onDelete: "cascade"
|
|
1097
|
+
}),
|
|
1098
|
+
option: text36("option").notNull(),
|
|
1099
|
+
isAnswer: boolean10("isAnswer").notNull().default(false),
|
|
1100
|
+
createdAt: timestamp38("createdAt").notNull().defaultNow(),
|
|
1101
|
+
updatedAt: timestamp38("updatedAt").notNull().defaultNow()
|
|
1102
|
+
},
|
|
1103
|
+
(table) => [index27("mainEventMiniQuizQuestionOptions_questionId_idx").on(table.questionId)]
|
|
1104
|
+
);
|
|
1105
|
+
var mainEventMiniQuizQuestionOptionsRelations = relations32(
|
|
1106
|
+
mainEventMiniQuizQuestionOptions,
|
|
1107
|
+
({ one }) => ({
|
|
1108
|
+
question: one(mainEventMiniQuizQuestions, {
|
|
1109
|
+
fields: [mainEventMiniQuizQuestionOptions.questionId],
|
|
1110
|
+
references: [mainEventMiniQuizQuestions.id]
|
|
1111
|
+
})
|
|
1112
|
+
})
|
|
1113
|
+
);
|
|
1114
|
+
|
|
1115
|
+
// quiz/main-event-mini-quiz-question.schema.ts
|
|
1116
|
+
var mainEventMiniQuizQuestions = pgTable39(
|
|
1117
|
+
"mainEventMiniQuizQuestions",
|
|
1118
|
+
{
|
|
1119
|
+
id: text37("id").primaryKey(),
|
|
1120
|
+
quizId: text37("quizId").references(() => mainEventMiniQuizzes.id, { onDelete: "cascade" }),
|
|
1121
|
+
question: text37("question").notNull(),
|
|
1122
|
+
createdAt: timestamp39("createdAt").notNull().defaultNow(),
|
|
1123
|
+
updatedAt: timestamp39("updatedAt").notNull().defaultNow()
|
|
1124
|
+
},
|
|
1125
|
+
(table) => [index28("mainEventMiniQuizQuestions_quizId_idx").on(table.quizId)]
|
|
1126
|
+
);
|
|
1127
|
+
var mainEventMiniQuizQuestionsRelations = relations33(
|
|
1128
|
+
mainEventMiniQuizQuestions,
|
|
1129
|
+
({ one, many }) => ({
|
|
1130
|
+
quiz: one(mainEventMiniQuizzes, {
|
|
1131
|
+
fields: [mainEventMiniQuizQuestions.quizId],
|
|
1132
|
+
references: [mainEventMiniQuizzes.id]
|
|
1133
|
+
}),
|
|
1134
|
+
options: many(mainEventMiniQuizQuestionOptions)
|
|
1135
|
+
})
|
|
1136
|
+
);
|
|
1137
|
+
|
|
1138
|
+
// quiz/main-event-mini-quiz.schema.ts
|
|
1139
|
+
var mainEventMiniQuizzes = pgTable40(
|
|
1140
|
+
"mainEventMiniQuizzes",
|
|
1141
|
+
{
|
|
1142
|
+
id: text38("id").primaryKey(),
|
|
1143
|
+
quizName: text38("quizName").notNull(),
|
|
1144
|
+
createdAt: timestamp40("createdAt").notNull().defaultNow(),
|
|
1145
|
+
updatedAt: timestamp40("updatedAt").notNull().defaultNow()
|
|
1146
|
+
},
|
|
1147
|
+
(table) => [index29("mainEventMiniQuizzes_quizName_idx").on(table.quizName)]
|
|
1148
|
+
);
|
|
1149
|
+
var mainEventMiniQuizzesRelations = relations34(mainEventMiniQuizzes, ({ many }) => ({
|
|
1150
|
+
questions: many(mainEventMiniQuizQuestions),
|
|
1151
|
+
attempts: many(mainEventMiniQuizAttempts)
|
|
1152
|
+
}));
|
|
1153
|
+
|
|
1154
|
+
// quiz/mini-quiz.schema.ts
|
|
1155
|
+
import { relations as relations37 } from "drizzle-orm";
|
|
1156
|
+
import { index as index32, pgTable as pgTable43, text as text41, timestamp as timestamp43 } from "drizzle-orm/pg-core";
|
|
1157
|
+
|
|
1158
|
+
// quiz/mini-quiz-attempt.schema.ts
|
|
1159
|
+
import { relations as relations35 } from "drizzle-orm";
|
|
1160
|
+
import { index as index30, json as json2, pgTable as pgTable41, text as text39, timestamp as timestamp41 } from "drizzle-orm/pg-core";
|
|
1161
|
+
var miniQuizAttempts = pgTable41(
|
|
1162
|
+
"miniQuizAttempts",
|
|
1163
|
+
{
|
|
1164
|
+
id: text39("id").primaryKey(),
|
|
1165
|
+
quizId: text39("quizId").references(() => miniQuizzes.id, { onDelete: "cascade" }),
|
|
1166
|
+
userId: text39("userId").references(() => users.id, { onDelete: "cascade" }),
|
|
1167
|
+
answerJson: json2("answerJson"),
|
|
1168
|
+
attemptedAt: timestamp41("attemptedAt"),
|
|
1169
|
+
createdAt: timestamp41("createdAt").notNull().defaultNow(),
|
|
1170
|
+
updatedAt: timestamp41("updatedAt").notNull().defaultNow()
|
|
1171
|
+
},
|
|
1172
|
+
(table) => [
|
|
1173
|
+
index30("miniQuizAttempts_quizId_idx").on(table.quizId),
|
|
1174
|
+
index30("miniQuizAttempts_userId_idx").on(table.userId)
|
|
1175
|
+
]
|
|
1176
|
+
);
|
|
1177
|
+
var miniQuizAttemptsRelations = relations35(miniQuizAttempts, ({ one }) => ({
|
|
1178
|
+
quiz: one(miniQuizzes, {
|
|
1179
|
+
fields: [miniQuizAttempts.quizId],
|
|
1180
|
+
references: [miniQuizzes.id]
|
|
1181
|
+
}),
|
|
1182
|
+
user: one(users, {
|
|
1183
|
+
fields: [miniQuizAttempts.userId],
|
|
1184
|
+
references: [users.id]
|
|
1185
|
+
})
|
|
1186
|
+
}));
|
|
1187
|
+
|
|
1188
|
+
// quiz/mini-quiz-question.schema.ts
|
|
1189
|
+
import { relations as relations36 } from "drizzle-orm";
|
|
1190
|
+
import { boolean as boolean11, index as index31, pgTable as pgTable42, text as text40, timestamp as timestamp42 } from "drizzle-orm/pg-core";
|
|
1191
|
+
var miniQuizQuestions = pgTable42(
|
|
1192
|
+
"miniQuizQuestions",
|
|
1193
|
+
{
|
|
1194
|
+
id: text40("id").primaryKey(),
|
|
1195
|
+
quizId: text40("quizId").references(() => miniQuizzes.id, { onDelete: "cascade" }),
|
|
1196
|
+
question: text40("question").notNull(),
|
|
1197
|
+
isTrue: boolean11("isTrue"),
|
|
1198
|
+
createdAt: timestamp42("createdAt").notNull().defaultNow(),
|
|
1199
|
+
updatedAt: timestamp42("updatedAt").notNull().defaultNow()
|
|
1200
|
+
},
|
|
1201
|
+
(table) => [index31("miniQuizQuestions_quizId_idx").on(table.quizId)]
|
|
1202
|
+
);
|
|
1203
|
+
var miniQuizQuestionsRelations = relations36(miniQuizQuestions, ({ one }) => ({
|
|
1204
|
+
quiz: one(miniQuizzes, {
|
|
1205
|
+
fields: [miniQuizQuestions.quizId],
|
|
1206
|
+
references: [miniQuizzes.id]
|
|
1207
|
+
})
|
|
1208
|
+
}));
|
|
1209
|
+
|
|
1210
|
+
// quiz/mini-quiz.schema.ts
|
|
1211
|
+
var miniQuizzes = pgTable43(
|
|
1212
|
+
"miniQuizzes",
|
|
1213
|
+
{
|
|
1214
|
+
id: text41("id").primaryKey(),
|
|
1215
|
+
quizName: text41("quizName").notNull(),
|
|
1216
|
+
createdAt: timestamp43("createdAt").notNull().defaultNow(),
|
|
1217
|
+
updatedAt: timestamp43("updatedAt").notNull().defaultNow()
|
|
1218
|
+
},
|
|
1219
|
+
(table) => [index32("miniQuizzes_quizName_idx").on(table.quizName)]
|
|
1220
|
+
);
|
|
1221
|
+
var miniQuizzesRelations = relations37(miniQuizzes, ({ many }) => ({
|
|
1222
|
+
questions: many(miniQuizQuestions),
|
|
1223
|
+
attempts: many(miniQuizAttempts)
|
|
1224
|
+
}));
|
|
1225
|
+
|
|
1226
|
+
// exhibition/company-exhibition.schema.ts
|
|
1227
|
+
import { pgTable as pgTable44, text as text42, timestamp as timestamp44 } from "drizzle-orm/pg-core";
|
|
1228
|
+
var companyExhibitions = pgTable44("companyExhibitions", {
|
|
1229
|
+
id: text42("id").primaryKey(),
|
|
1230
|
+
name: text42("name").notNull(),
|
|
1231
|
+
location: text42("location"),
|
|
1232
|
+
iconUrl: text42("iconUrl"),
|
|
1233
|
+
description: text42("description"),
|
|
1234
|
+
tags: text42("tags"),
|
|
1235
|
+
benefits: text42("benefits"),
|
|
1236
|
+
vision: text42("vision"),
|
|
1237
|
+
mission: text42("mission"),
|
|
1238
|
+
documentationLinks: text42("documentationLinks"),
|
|
1239
|
+
websiteLink: text42("websiteLink"),
|
|
1240
|
+
createdAt: timestamp44("createdAt").notNull().defaultNow(),
|
|
1241
|
+
updatedAt: timestamp44("updatedAt").notNull().defaultNow()
|
|
1242
|
+
});
|
|
1243
|
+
|
|
1244
|
+
// exhibition/company-exhibition-vacancies.schema.ts
|
|
1245
|
+
import { relations as relations38 } from "drizzle-orm";
|
|
1246
|
+
import { boolean as boolean12, index as index33, pgTable as pgTable45, text as text43, timestamp as timestamp45 } from "drizzle-orm/pg-core";
|
|
1247
|
+
var companyExhibitionVacancies = pgTable45(
|
|
1248
|
+
"companyExhibitionVacancies",
|
|
1249
|
+
{
|
|
1250
|
+
id: text43("id").primaryKey(),
|
|
1251
|
+
companyExhibitionId: text43("companyExhibitionId").references(() => companyExhibitions.id, {
|
|
1252
|
+
onDelete: "cascade"
|
|
1253
|
+
}),
|
|
1254
|
+
position: text43("position").notNull(),
|
|
1255
|
+
tags: text43("tags"),
|
|
1256
|
+
description: text43("description"),
|
|
1257
|
+
benefits: text43("benefits"),
|
|
1258
|
+
jobType: vacancyJobTypeEnum("jobType"),
|
|
1259
|
+
salary: text43("salary"),
|
|
1260
|
+
deadline: timestamp45("deadline"),
|
|
1261
|
+
responsibilities: text43("responsibilities"),
|
|
1262
|
+
requirements: text43("requirements"),
|
|
1263
|
+
vacancyUrl: text43("vacancyUrl"),
|
|
1264
|
+
isOpen: boolean12("isOpen").notNull().default(true),
|
|
1265
|
+
createdAt: timestamp45("createdAt").notNull().defaultNow(),
|
|
1266
|
+
updatedAt: timestamp45("updatedAt").notNull().defaultNow()
|
|
1267
|
+
},
|
|
1268
|
+
(table) => [
|
|
1269
|
+
index33("companyExhibitionVacancies_companyExhibitionId_idx").on(table.companyExhibitionId),
|
|
1270
|
+
index33("companyExhibitionVacancies_isOpen_idx").on(table.isOpen)
|
|
1271
|
+
]
|
|
1272
|
+
);
|
|
1273
|
+
var companyExhibitionVacanciesRelations = relations38(
|
|
1274
|
+
companyExhibitionVacancies,
|
|
1275
|
+
({ one }) => ({
|
|
1276
|
+
companyExhibition: one(companyExhibitions, {
|
|
1277
|
+
fields: [companyExhibitionVacancies.companyExhibitionId],
|
|
1278
|
+
references: [companyExhibitions.id]
|
|
1279
|
+
})
|
|
1280
|
+
})
|
|
1281
|
+
);
|
|
1282
|
+
|
|
1283
|
+
// jobfair/walk-in-interview-applicant.schema.ts
|
|
1284
|
+
import { relations as relations41 } from "drizzle-orm";
|
|
1285
|
+
import { index as index35, pgTable as pgTable48, text as text46, timestamp as timestamp48, uniqueIndex as uniqueIndex2 } from "drizzle-orm/pg-core";
|
|
1286
|
+
|
|
1287
|
+
// jobfair/walk-in-interview-company-slot.schema.ts
|
|
1288
|
+
import { relations as relations40 } from "drizzle-orm";
|
|
1289
|
+
import { boolean as boolean13, index as index34, pgTable as pgTable47, text as text45, timestamp as timestamp47 } from "drizzle-orm/pg-core";
|
|
1290
|
+
|
|
1291
|
+
// jobfair/walk-in-interview-company.schema.ts
|
|
1292
|
+
import { relations as relations39 } from "drizzle-orm";
|
|
1293
|
+
import { integer as integer7, pgTable as pgTable46, text as text44, timestamp as timestamp46 } from "drizzle-orm/pg-core";
|
|
1294
|
+
var walkInInterviewCompanies = pgTable46("walkInInterviewCompanies", {
|
|
1295
|
+
id: text44("id").primaryKey(),
|
|
1296
|
+
name: text44("name").notNull(),
|
|
1297
|
+
description: text44("description"),
|
|
1298
|
+
iconUrl: text44("iconUrl"),
|
|
1299
|
+
slots: integer7("slots"),
|
|
1300
|
+
session: text44("session"),
|
|
1301
|
+
roles: text44("roles"),
|
|
1302
|
+
tags: text44("tags"),
|
|
1303
|
+
benefits: text44("benefits"),
|
|
1304
|
+
criteria: text44("criteria"),
|
|
1305
|
+
currentApplicants: integer7("currentApplicants"),
|
|
1306
|
+
boothLocation: text44("boothLocation"),
|
|
1307
|
+
createdAt: timestamp46("createdAt").notNull().defaultNow(),
|
|
1308
|
+
updatedAt: timestamp46("updatedAt").notNull().defaultNow()
|
|
1309
|
+
});
|
|
1310
|
+
var walkInInterviewCompaniesRelations = relations39(
|
|
1311
|
+
walkInInterviewCompanies,
|
|
1312
|
+
({ many }) => ({
|
|
1313
|
+
slots: many(walkInInterviewCompanySlots)
|
|
1314
|
+
})
|
|
1315
|
+
);
|
|
1316
|
+
|
|
1317
|
+
// jobfair/walk-in-interview-company-slot.schema.ts
|
|
1318
|
+
var walkInInterviewCompanySlots = pgTable47(
|
|
1319
|
+
"walkInInterviewCompanySlots",
|
|
1320
|
+
{
|
|
1321
|
+
id: text45("id").primaryKey(),
|
|
1322
|
+
companyId: text45("companyId").references(() => walkInInterviewCompanies.id, {
|
|
1323
|
+
onDelete: "cascade"
|
|
1324
|
+
}),
|
|
1325
|
+
startTime: timestamp47("startTime").notNull(),
|
|
1326
|
+
endTime: timestamp47("endTime").notNull(),
|
|
1327
|
+
isAvailable: boolean13("isAvailable").notNull().default(true),
|
|
1328
|
+
createdAt: timestamp47("createdAt").notNull().defaultNow(),
|
|
1329
|
+
updatedAt: timestamp47("updatedAt").notNull().defaultNow()
|
|
1330
|
+
},
|
|
1331
|
+
(table) => [index34("walkInInterviewCompanySlots_companyId_idx").on(table.companyId)]
|
|
1332
|
+
);
|
|
1333
|
+
var walkInInterviewCompanySlotsRelations = relations40(
|
|
1334
|
+
walkInInterviewCompanySlots,
|
|
1335
|
+
({ one, many }) => ({
|
|
1336
|
+
company: one(walkInInterviewCompanies, {
|
|
1337
|
+
fields: [walkInInterviewCompanySlots.companyId],
|
|
1338
|
+
references: [walkInInterviewCompanies.id]
|
|
1339
|
+
}),
|
|
1340
|
+
applicants: many(walkInInterviewApplicants)
|
|
1341
|
+
})
|
|
1342
|
+
);
|
|
1343
|
+
|
|
1344
|
+
// jobfair/walk-in-interview-applicant.schema.ts
|
|
1345
|
+
var walkInInterviewApplicants = pgTable48(
|
|
1346
|
+
"walkInInterviewApplicants",
|
|
1347
|
+
{
|
|
1348
|
+
id: text46("id").primaryKey(),
|
|
1349
|
+
userId: text46("userId").references(() => users.id, { onDelete: "cascade" }),
|
|
1350
|
+
resumeUrl: text46("resumeUrl"),
|
|
1351
|
+
status: interviewApplicantStatusEnum("status").notNull().default("PENDING"),
|
|
1352
|
+
referralCode: text46("referralCode"),
|
|
1353
|
+
appliedSessionId: text46("appliedSessionId").references(
|
|
1354
|
+
() => walkInInterviewCompanySlots.id,
|
|
1355
|
+
{ onDelete: "cascade" }
|
|
1356
|
+
),
|
|
1357
|
+
appliedAt: timestamp48("appliedAt"),
|
|
1358
|
+
createdAt: timestamp48("createdAt").notNull().defaultNow(),
|
|
1359
|
+
updatedAt: timestamp48("updatedAt").notNull().defaultNow()
|
|
1360
|
+
},
|
|
1361
|
+
(table) => [
|
|
1362
|
+
index35("walkInInterviewApplicants_userId_idx").on(table.userId),
|
|
1363
|
+
uniqueIndex2("walkInInterviewApplicants_appliedSessionId_unique_idx").on(
|
|
1364
|
+
table.appliedSessionId
|
|
1365
|
+
)
|
|
1366
|
+
]
|
|
1367
|
+
);
|
|
1368
|
+
var walkInInterviewApplicantsRelations = relations41(
|
|
1369
|
+
walkInInterviewApplicants,
|
|
1370
|
+
({ one }) => ({
|
|
1371
|
+
user: one(users, {
|
|
1372
|
+
fields: [walkInInterviewApplicants.userId],
|
|
1373
|
+
references: [users.id]
|
|
1374
|
+
}),
|
|
1375
|
+
appliedSession: one(walkInInterviewCompanySlots, {
|
|
1376
|
+
fields: [walkInInterviewApplicants.appliedSessionId],
|
|
1377
|
+
references: [walkInInterviewCompanySlots.id]
|
|
1378
|
+
})
|
|
1379
|
+
})
|
|
1380
|
+
);
|
|
1381
|
+
|
|
1382
|
+
// cvclinic/cv-clinic-claim.schema.ts
|
|
1383
|
+
import { pgTable as pgTable50, text as text48, timestamp as timestamp49 } from "drizzle-orm/pg-core";
|
|
1384
|
+
|
|
1385
|
+
// cvclinic/cv-clinic-vouchers.schema.ts
|
|
1386
|
+
import { pgTable as pgTable49, text as text47 } from "drizzle-orm/pg-core";
|
|
1387
|
+
var cvClinicVouchers = pgTable49("cv_clinic_vouchers", {
|
|
1388
|
+
code: text47("code").primaryKey()
|
|
1389
|
+
});
|
|
1390
|
+
|
|
1391
|
+
// cvclinic/cv-clinic-claim.schema.ts
|
|
1392
|
+
var cvClinicClaims = pgTable50("cv_clinic_claims", {
|
|
1393
|
+
id: text48("id").primaryKey(),
|
|
1394
|
+
userId: text48("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
1395
|
+
usedVoucherCode: text48("used_voucher_code").references(() => cvClinicVouchers.code, {
|
|
1396
|
+
onDelete: "set null"
|
|
1397
|
+
}),
|
|
1398
|
+
createdAt: timestamp49("created_at").notNull().defaultNow(),
|
|
1399
|
+
updatedAt: timestamp49("updated_at").notNull().defaultNow()
|
|
1400
|
+
});
|
|
1401
|
+
|
|
1402
|
+
// voting/nominee.schema.ts
|
|
1403
|
+
import { boolean as boolean14, integer as integer8, pgTable as pgTable51, text as text49, timestamp as timestamp50 } from "drizzle-orm/pg-core";
|
|
1404
|
+
var nominees = pgTable51("nominees", {
|
|
1405
|
+
id: text49("id").primaryKey(),
|
|
1406
|
+
type: nomineeTypeEnum("type").notNull(),
|
|
1407
|
+
name: text49("name").notNull(),
|
|
1408
|
+
developer: text49("developer").notNull(),
|
|
1409
|
+
description: text49("description"),
|
|
1410
|
+
thumbnailUrl: text49("thumbnail_url"),
|
|
1411
|
+
url: text49("url"),
|
|
1412
|
+
isActive: boolean14("is_active").notNull().default(true),
|
|
1413
|
+
point: integer8("point").notNull().default(0),
|
|
1414
|
+
deletedAt: timestamp50("deleted_at"),
|
|
1415
|
+
createdAt: timestamp50("created_at").notNull().defaultNow(),
|
|
1416
|
+
updatedAt: timestamp50("updated_at").notNull().defaultNow()
|
|
1417
|
+
});
|
|
1418
|
+
|
|
1419
|
+
// voting/nominee-vote.schema.ts
|
|
1420
|
+
import { pgTable as pgTable52, text as text50, timestamp as timestamp51 } from "drizzle-orm/pg-core";
|
|
1421
|
+
var nomineeVotes = pgTable52("nominee_votes", {
|
|
1422
|
+
id: text50("id").primaryKey(),
|
|
1423
|
+
userId: text50("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
1424
|
+
type: nomineeTypeEnum("type").notNull(),
|
|
1425
|
+
firstChoiceNomineeId: text50("first_choice_nominee_id").notNull().references(() => nominees.id, { onDelete: "cascade" }),
|
|
1426
|
+
secondChoiceNomineeId: text50("second_choice_nominee_id").notNull().references(() => nominees.id, { onDelete: "cascade" }),
|
|
1427
|
+
thirdChoiceNomineeId: text50("third_choice_nominee_id").notNull().references(() => nominees.id, { onDelete: "cascade" }),
|
|
1428
|
+
createdAt: timestamp51("created_at").notNull().defaultNow(),
|
|
1429
|
+
updatedAt: timestamp51("updated_at").notNull().defaultNow()
|
|
1430
|
+
});
|
|
1431
|
+
|
|
1432
|
+
// voting/project.schema.ts
|
|
1433
|
+
import { integer as integer9, pgTable as pgTable53, text as text51, timestamp as timestamp52 } from "drizzle-orm/pg-core";
|
|
1434
|
+
var projects = pgTable53("projects", {
|
|
1435
|
+
id: text51("id").primaryKey(),
|
|
1436
|
+
name: text51("name").notNull(),
|
|
1437
|
+
type: nomineeTypeEnum("type").notNull(),
|
|
1438
|
+
imageUrl: text51("image_url"),
|
|
1439
|
+
description: text51("description"),
|
|
1440
|
+
youtubeUrl: text51("youtube_url"),
|
|
1441
|
+
teamName: text51("team_name").notNull(),
|
|
1442
|
+
votes: integer9("votes").notNull().default(0),
|
|
1443
|
+
deletedAt: timestamp52("deleted_at"),
|
|
1444
|
+
createdAt: timestamp52("created_at").notNull().defaultNow(),
|
|
1445
|
+
updatedAt: timestamp52("updated_at").notNull().defaultNow()
|
|
1446
|
+
});
|
|
1447
|
+
|
|
1448
|
+
// booth/exhibitor.schema.ts
|
|
1449
|
+
import { index as index36, pgTable as pgTable54, text as text52, timestamp as timestamp53 } from "drizzle-orm/pg-core";
|
|
1450
|
+
var exhibitors = pgTable54(
|
|
1451
|
+
"exhibitors",
|
|
1452
|
+
{
|
|
1453
|
+
id: text52("id").primaryKey(),
|
|
1454
|
+
companyName: text52("company_name").notNull(),
|
|
1455
|
+
name: text52("name").notNull(),
|
|
1456
|
+
email: text52("email").notNull(),
|
|
1457
|
+
phoneNumber: text52("phone_number").notNull(),
|
|
1458
|
+
deletedAt: timestamp53("deleted_at"),
|
|
1459
|
+
createdAt: timestamp53("created_at").notNull().defaultNow(),
|
|
1460
|
+
updatedAt: timestamp53("updated_at").notNull().defaultNow()
|
|
1461
|
+
},
|
|
1462
|
+
(table) => [
|
|
1463
|
+
index36("exhibitors_company_name_idx").on(table.companyName),
|
|
1464
|
+
index36("exhibitors_email_idx").on(table.email)
|
|
1465
|
+
]
|
|
1466
|
+
);
|
|
1467
|
+
|
|
1468
|
+
// booth/main-event-booth-reward.schema.ts
|
|
1469
|
+
import { index as index37, integer as integer10, pgTable as pgTable55, text as text53, timestamp as timestamp54 } from "drizzle-orm/pg-core";
|
|
1470
|
+
var mainEventBoothRewards = pgTable55(
|
|
1471
|
+
"main_event_booth_rewards",
|
|
1472
|
+
{
|
|
1473
|
+
id: text53("id").primaryKey(),
|
|
1474
|
+
companyName: text53("company_name").notNull(),
|
|
1475
|
+
description: text53("description").notNull(),
|
|
1476
|
+
points: integer10("points").notNull(),
|
|
1477
|
+
type: boothRewardTypeEnum("type").notNull(),
|
|
1478
|
+
createdAt: timestamp54("created_at").notNull().defaultNow(),
|
|
1479
|
+
updatedAt: timestamp54("updated_at").notNull().defaultNow()
|
|
1480
|
+
},
|
|
1481
|
+
(table) => [
|
|
1482
|
+
index37("main_event_booth_rewards_company_name_idx").on(table.companyName),
|
|
1483
|
+
index37("main_event_booth_rewards_type_idx").on(table.type)
|
|
1484
|
+
]
|
|
1485
|
+
);
|
|
1486
|
+
|
|
1487
|
+
// supermarket/supermarket-item.schema.ts
|
|
1488
|
+
import { decimal, integer as integer11, pgTable as pgTable56, text as text54, timestamp as timestamp55 } from "drizzle-orm/pg-core";
|
|
1489
|
+
var supermarketItems = pgTable56("supermarket_items", {
|
|
1490
|
+
id: text54("id").primaryKey(),
|
|
1491
|
+
name: text54("name").notNull(),
|
|
1492
|
+
description: text54("description"),
|
|
1493
|
+
price: decimal("price", { precision: 10, scale: 2 }).notNull(),
|
|
1494
|
+
stock: integer11("stock").notNull().default(0),
|
|
1495
|
+
category: text54("category").notNull(),
|
|
1496
|
+
imageUrl: text54("image_url"),
|
|
1497
|
+
deletedAt: timestamp55("deleted_at"),
|
|
1498
|
+
// Soft delete
|
|
1499
|
+
createdAt: timestamp55("created_at").notNull().defaultNow(),
|
|
1500
|
+
updatedAt: timestamp55("updated_at").notNull().defaultNow()
|
|
1501
|
+
});
|
|
1502
|
+
|
|
1503
|
+
// supermarket/supermarket-item-option.schema.ts
|
|
1504
|
+
import { relations as relations42 } from "drizzle-orm";
|
|
1505
|
+
import { pgTable as pgTable57, text as text55, timestamp as timestamp56 } from "drizzle-orm/pg-core";
|
|
1506
|
+
var supermarketItemOptions = pgTable57("supermarket_item_options", {
|
|
1507
|
+
id: text55("id").primaryKey(),
|
|
1508
|
+
itemId: text55("item_id").notNull().references(() => supermarketItems.id, { onDelete: "cascade" }),
|
|
1509
|
+
key: text55("key").notNull(),
|
|
1510
|
+
value: text55("value").notNull(),
|
|
1511
|
+
deletedAt: timestamp56("deleted_at"),
|
|
1512
|
+
// Soft delete
|
|
1513
|
+
createdAt: timestamp56("created_at").notNull().defaultNow(),
|
|
1514
|
+
updatedAt: timestamp56("updated_at").notNull().defaultNow()
|
|
1515
|
+
});
|
|
1516
|
+
var supermarketItemOptionsRelations = relations42(supermarketItemOptions, ({ one }) => ({
|
|
1517
|
+
item: one(supermarketItems, {
|
|
1518
|
+
fields: [supermarketItemOptions.itemId],
|
|
1519
|
+
references: [supermarketItems.id]
|
|
1520
|
+
})
|
|
1521
|
+
}));
|
|
1522
|
+
|
|
1523
|
+
// supermarket/supermarket-user-cart.schema.ts
|
|
1524
|
+
import { relations as relations44 } from "drizzle-orm";
|
|
1525
|
+
import { decimal as decimal2, pgTable as pgTable59, text as text57, timestamp as timestamp58 } from "drizzle-orm/pg-core";
|
|
1526
|
+
|
|
1527
|
+
// supermarket/supermarket-user-cart-item.schema.ts
|
|
1528
|
+
import { relations as relations43 } from "drizzle-orm";
|
|
1529
|
+
import { integer as integer12, json as json3, pgTable as pgTable58, text as text56, timestamp as timestamp57 } from "drizzle-orm/pg-core";
|
|
1530
|
+
var supermarketUserCartItems = pgTable58("supermarket_user_cart_items", {
|
|
1531
|
+
id: text56("id").primaryKey(),
|
|
1532
|
+
cartId: text56("cart_id").notNull().references(() => supermarketUserCarts.id, { onDelete: "cascade" }),
|
|
1533
|
+
itemId: text56("item_id").notNull().references(() => supermarketItems.id, { onDelete: "cascade" }),
|
|
1534
|
+
quantity: integer12("quantity").notNull().default(1),
|
|
1535
|
+
selectedOptions: json3("selected_options"),
|
|
1536
|
+
// JSON to store selected option key-value pairs
|
|
1537
|
+
deletedAt: timestamp57("deleted_at"),
|
|
1538
|
+
// Soft delete
|
|
1539
|
+
createdAt: timestamp57("created_at").notNull().defaultNow(),
|
|
1540
|
+
updatedAt: timestamp57("updated_at").notNull().defaultNow()
|
|
1541
|
+
});
|
|
1542
|
+
var supermarketUserCartItemsRelations = relations43(supermarketUserCartItems, ({ one }) => ({
|
|
1543
|
+
cart: one(supermarketUserCarts, {
|
|
1544
|
+
fields: [supermarketUserCartItems.cartId],
|
|
1545
|
+
references: [supermarketUserCarts.id]
|
|
1546
|
+
}),
|
|
1547
|
+
item: one(supermarketItems, {
|
|
1548
|
+
fields: [supermarketUserCartItems.itemId],
|
|
1549
|
+
references: [supermarketItems.id]
|
|
1550
|
+
})
|
|
1551
|
+
}));
|
|
1552
|
+
|
|
1553
|
+
// supermarket/supermarket-user-cart.schema.ts
|
|
1554
|
+
var supermarketUserCarts = pgTable59("supermarket_user_carts", {
|
|
1555
|
+
id: text57("id").primaryKey(),
|
|
1556
|
+
userId: text57("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
1557
|
+
totalPrice: decimal2("total_price", { precision: 10, scale: 2 }).notNull(),
|
|
1558
|
+
status: cartStatusEnum("status").notNull().default("PENDING"),
|
|
1559
|
+
deletedAt: timestamp58("deleted_at"),
|
|
1560
|
+
// Soft delete
|
|
1561
|
+
createdAt: timestamp58("created_at").notNull().defaultNow(),
|
|
1562
|
+
updatedAt: timestamp58("updated_at").notNull().defaultNow()
|
|
1563
|
+
});
|
|
1564
|
+
var supermarketUserCartsRelations = relations44(supermarketUserCarts, ({ many }) => ({
|
|
1565
|
+
cartItems: many(supermarketUserCartItems)
|
|
1566
|
+
}));
|
|
1567
|
+
|
|
1568
|
+
// content/article.schema.ts
|
|
1569
|
+
import { pgTable as pgTable60, text as text58, timestamp as timestamp59 } from "drizzle-orm/pg-core";
|
|
1570
|
+
var articles = pgTable60("articles", {
|
|
1571
|
+
id: text58("id").primaryKey(),
|
|
1572
|
+
title: text58("title").notNull(),
|
|
1573
|
+
description: text58("description"),
|
|
1574
|
+
url: text58("url").notNull(),
|
|
1575
|
+
imageUrl: text58("image_url"),
|
|
1576
|
+
deletedAt: timestamp59("deleted_at"),
|
|
1577
|
+
createdAt: timestamp59("created_at").notNull().defaultNow(),
|
|
1578
|
+
updatedAt: timestamp59("updated_at").notNull().defaultNow()
|
|
1579
|
+
});
|
|
1580
|
+
|
|
1581
|
+
// content/explore-it-funfact.schema.ts
|
|
1582
|
+
import { pgTable as pgTable61, text as text59, timestamp as timestamp60 } from "drizzle-orm/pg-core";
|
|
1583
|
+
var exploreITFunfacts = pgTable61("explore_it_funfacts", {
|
|
1584
|
+
id: text59("id").primaryKey(),
|
|
1585
|
+
title: text59("title").notNull(),
|
|
1586
|
+
content: text59("content").notNull(),
|
|
1587
|
+
imageUrl: text59("image_url"),
|
|
1588
|
+
deletedAt: timestamp60("deleted_at"),
|
|
1589
|
+
createdAt: timestamp60("created_at").notNull().defaultNow(),
|
|
1590
|
+
updatedAt: timestamp60("updated_at").notNull().defaultNow()
|
|
1591
|
+
});
|
|
1592
|
+
|
|
1593
|
+
// notifications/dashboard-notification.schema.ts
|
|
1594
|
+
import { boolean as boolean15, index as index38, pgTable as pgTable62, text as text60, timestamp as timestamp61 } from "drizzle-orm/pg-core";
|
|
1595
|
+
var dashboardNotifications = pgTable62(
|
|
1596
|
+
"dashboard_notifications",
|
|
1597
|
+
{
|
|
1598
|
+
id: text60("id").primaryKey(),
|
|
1599
|
+
title: text60("title").notNull(),
|
|
1600
|
+
content: text60("content").notNull(),
|
|
1601
|
+
isPrivate: boolean15("is_private").notNull().default(false),
|
|
1602
|
+
type: text60("type").notNull(),
|
|
1603
|
+
programCode: programCodeEnum("program_code"),
|
|
1604
|
+
deletedAt: timestamp61("deleted_at"),
|
|
1605
|
+
createdAt: timestamp61("created_at").notNull().defaultNow(),
|
|
1606
|
+
updatedAt: timestamp61("updated_at").notNull().defaultNow()
|
|
1607
|
+
},
|
|
1608
|
+
(table) => [index38("dashboard_notifications_program_code_idx").on(table.programCode)]
|
|
1609
|
+
);
|
|
1610
|
+
|
|
1611
|
+
// notifications/dashboard-notification-user-read.schema.ts
|
|
1612
|
+
import { relations as relations45 } from "drizzle-orm";
|
|
1613
|
+
import { boolean as boolean16, index as index39, pgTable as pgTable63, text as text61, timestamp as timestamp62 } from "drizzle-orm/pg-core";
|
|
1614
|
+
var dashboardNotificationUserReads = pgTable63(
|
|
1615
|
+
"dashboard_notification_user_reads",
|
|
1616
|
+
{
|
|
1617
|
+
id: text61("id").primaryKey(),
|
|
1618
|
+
userId: text61("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
1619
|
+
notificationId: text61("notification_id").notNull().references(() => dashboardNotifications.id, { onDelete: "cascade" }),
|
|
1620
|
+
isOpened: boolean16("is_opened").notNull().default(false),
|
|
1621
|
+
createdAt: timestamp62("created_at").notNull().defaultNow(),
|
|
1622
|
+
updatedAt: timestamp62("updated_at").notNull().defaultNow()
|
|
1623
|
+
},
|
|
1624
|
+
(table) => [
|
|
1625
|
+
index39("dashboard_notification_user_reads_user_id_idx").on(table.userId),
|
|
1626
|
+
index39("dashboard_notification_user_reads_notification_id_idx").on(table.notificationId)
|
|
1627
|
+
]
|
|
1628
|
+
);
|
|
1629
|
+
var dashboardNotificationUserReadsRelations = relations45(
|
|
1630
|
+
dashboardNotificationUserReads,
|
|
1631
|
+
({ one }) => ({
|
|
1632
|
+
user: one(users, {
|
|
1633
|
+
fields: [dashboardNotificationUserReads.userId],
|
|
1634
|
+
references: [users.id]
|
|
1635
|
+
}),
|
|
1636
|
+
notification: one(dashboardNotifications, {
|
|
1637
|
+
fields: [dashboardNotificationUserReads.notificationId],
|
|
1638
|
+
references: [dashboardNotifications.id]
|
|
1639
|
+
})
|
|
1640
|
+
})
|
|
1641
|
+
);
|
|
1642
|
+
|
|
1643
|
+
// post-example/comment.schema.ts
|
|
1644
|
+
import { pgTable as pgTable64, text as text62, uuid as uuid10 } from "drizzle-orm/pg-core";
|
|
1645
|
+
var comments = pgTable64("comments", {
|
|
1646
|
+
id: uuid10("id").primaryKey(),
|
|
1647
|
+
postId: uuid10("post_id").notNull(),
|
|
1648
|
+
content: text62("content").notNull(),
|
|
1649
|
+
author: text62("author").notNull()
|
|
1650
|
+
});
|
|
1651
|
+
|
|
1652
|
+
// post-example/like.schema.ts
|
|
1653
|
+
import { pgTable as pgTable65, text as text63, uuid as uuid11 } from "drizzle-orm/pg-core";
|
|
1654
|
+
var likes = pgTable65("likes", {
|
|
1655
|
+
id: uuid11("id").primaryKey(),
|
|
1656
|
+
postId: uuid11("post_id").notNull(),
|
|
1657
|
+
userName: text63("user_name").notNull()
|
|
1658
|
+
});
|
|
1659
|
+
|
|
1660
|
+
// post-example/post.schema.ts
|
|
1661
|
+
import { pgTable as pgTable66, text as text64, timestamp as timestamp63, uuid as uuid12 } from "drizzle-orm/pg-core";
|
|
1662
|
+
var posts = pgTable66("posts", {
|
|
1663
|
+
id: uuid12("id").primaryKey(),
|
|
1664
|
+
// Primary Key UUID
|
|
1665
|
+
title: text64("title").notNull(),
|
|
1666
|
+
content: text64("content").notNull(),
|
|
1667
|
+
author: text64("author").notNull(),
|
|
1668
|
+
createdAt: timestamp63("created_at").defaultNow().notNull(),
|
|
1669
|
+
updatedAt: timestamp63("updated_at").defaultNow().notNull()
|
|
1670
|
+
});
|
|
1671
|
+
export {
|
|
1672
|
+
adWatchHistories,
|
|
1673
|
+
adWatchHistoriesRelations,
|
|
1674
|
+
adWatchSessions,
|
|
1675
|
+
adWatchSessionsRelations,
|
|
1676
|
+
advertisements,
|
|
1677
|
+
announcements,
|
|
1678
|
+
announcementsRelations,
|
|
1679
|
+
articles,
|
|
1680
|
+
boothRewardTypeEnum,
|
|
1681
|
+
cartStatusEnum,
|
|
1682
|
+
comments,
|
|
1683
|
+
companyExhibitionVacancies,
|
|
1684
|
+
companyExhibitionVacanciesRelations,
|
|
1685
|
+
companyExhibitions,
|
|
1686
|
+
cvClinicClaims,
|
|
1687
|
+
cvClinicVouchers,
|
|
1688
|
+
dashboardNotificationUserReads,
|
|
1689
|
+
dashboardNotificationUserReadsRelations,
|
|
1690
|
+
dashboardNotifications,
|
|
1691
|
+
detentionStateEnum,
|
|
1692
|
+
eventDates,
|
|
1693
|
+
eventDatesRelations,
|
|
1694
|
+
eventEnum,
|
|
1695
|
+
eventRegistrations,
|
|
1696
|
+
eventRegistrationsRelations,
|
|
1697
|
+
events,
|
|
1698
|
+
eventsRelations,
|
|
1699
|
+
exhibitors,
|
|
1700
|
+
exploreITFunfacts,
|
|
1701
|
+
feedbackOptions,
|
|
1702
|
+
feedbackOptionsRelations,
|
|
1703
|
+
feedbackQuestions,
|
|
1704
|
+
feedbackQuestionsRelations,
|
|
1705
|
+
feedbackSubmissions,
|
|
1706
|
+
feedbackSubmissionsRelations,
|
|
1707
|
+
feedbacks,
|
|
1708
|
+
feedbacksRelations,
|
|
1709
|
+
fileTypeEnum,
|
|
1710
|
+
gameDevelopers,
|
|
1711
|
+
gameDevelopersRelations,
|
|
1712
|
+
gameOrientationEnum,
|
|
1713
|
+
gameRules,
|
|
1714
|
+
gameRulesRelations,
|
|
1715
|
+
games,
|
|
1716
|
+
gamesRelations,
|
|
1717
|
+
grandLaunchingRegistrations,
|
|
1718
|
+
grandLaunchingRegistrationsRelations,
|
|
1719
|
+
interviewApplicantStatusEnum,
|
|
1720
|
+
knowEventSourceEnum,
|
|
1721
|
+
leaderboardHistories,
|
|
1722
|
+
likes,
|
|
1723
|
+
mainEventBoothRewards,
|
|
1724
|
+
mainEventMiniQuizAttempts,
|
|
1725
|
+
mainEventMiniQuizAttemptsRelations,
|
|
1726
|
+
mainEventMiniQuizQuestionOptions,
|
|
1727
|
+
mainEventMiniQuizQuestionOptionsRelations,
|
|
1728
|
+
mainEventMiniQuizQuestions,
|
|
1729
|
+
mainEventMiniQuizQuestionsRelations,
|
|
1730
|
+
mainEventMiniQuizzes,
|
|
1731
|
+
mainEventMiniQuizzesRelations,
|
|
1732
|
+
mainEventOccupationTypeEnum,
|
|
1733
|
+
mainEventRegistrations,
|
|
1734
|
+
mainEventRegistrationsRelations,
|
|
1735
|
+
members,
|
|
1736
|
+
membersRelations,
|
|
1737
|
+
miniQuizAttempts,
|
|
1738
|
+
miniQuizAttemptsRelations,
|
|
1739
|
+
miniQuizQuestions,
|
|
1740
|
+
miniQuizQuestionsRelations,
|
|
1741
|
+
miniQuizzes,
|
|
1742
|
+
miniQuizzesRelations,
|
|
1743
|
+
nomineeTypeEnum,
|
|
1744
|
+
nomineeVotes,
|
|
1745
|
+
nominees,
|
|
1746
|
+
playgroundExpenseHistories,
|
|
1747
|
+
playgroundExpenseHistoriesRelations,
|
|
1748
|
+
playgroundRewardHistories,
|
|
1749
|
+
playgroundRewardHistoriesRelations,
|
|
1750
|
+
playgroundTokens,
|
|
1751
|
+
playgroundTokensRelations,
|
|
1752
|
+
posts,
|
|
1753
|
+
programCodeEnum,
|
|
1754
|
+
programRegistrations,
|
|
1755
|
+
programRegistrationsRelations,
|
|
1756
|
+
programTaskExtraDescriptions,
|
|
1757
|
+
programTaskExtraDescriptionsRelations,
|
|
1758
|
+
programTaskSubmissions,
|
|
1759
|
+
programTaskSubmissionsRelations,
|
|
1760
|
+
programTaskTypeEnum,
|
|
1761
|
+
programTasks,
|
|
1762
|
+
programTasksRelations,
|
|
1763
|
+
programTypeEnum,
|
|
1764
|
+
programs,
|
|
1765
|
+
programsRelations,
|
|
1766
|
+
projects,
|
|
1767
|
+
questionTypeEnum,
|
|
1768
|
+
rewardTypeEnum,
|
|
1769
|
+
singleParticipants,
|
|
1770
|
+
singleParticipantsRelations,
|
|
1771
|
+
submissionStatusEnum,
|
|
1772
|
+
submissionStatusEnumLocal,
|
|
1773
|
+
supermarketItemOptions,
|
|
1774
|
+
supermarketItemOptionsRelations,
|
|
1775
|
+
supermarketItems,
|
|
1776
|
+
supermarketUserCartItems,
|
|
1777
|
+
supermarketUserCartItemsRelations,
|
|
1778
|
+
supermarketUserCarts,
|
|
1779
|
+
supermarketUserCartsRelations,
|
|
1780
|
+
teamStatusEnum,
|
|
1781
|
+
teams,
|
|
1782
|
+
teamsRelations,
|
|
1783
|
+
tokenTypeEnum,
|
|
1784
|
+
userPlayGameHistories,
|
|
1785
|
+
userPlayGameHistoriesRelations,
|
|
1786
|
+
userPlaygroundDetentions,
|
|
1787
|
+
userPlaygrounds,
|
|
1788
|
+
userProfiles,
|
|
1789
|
+
userProfilesRelations,
|
|
1790
|
+
users,
|
|
1791
|
+
vacancyJobTypeEnum,
|
|
1792
|
+
walkInInterviewApplicants,
|
|
1793
|
+
walkInInterviewApplicantsRelations,
|
|
1794
|
+
walkInInterviewCompanies,
|
|
1795
|
+
walkInInterviewCompaniesRelations,
|
|
1796
|
+
walkInInterviewCompanySlots,
|
|
1797
|
+
walkInInterviewCompanySlotsRelations,
|
|
1798
|
+
xcelerateRegistrations,
|
|
1799
|
+
xcelerateRegistrationsRelations,
|
|
1800
|
+
xcelerateWorkshopTaskSubmissions,
|
|
1801
|
+
xcelerateWorkshopTaskSubmissionsRelations,
|
|
1802
|
+
xcelerateWorkshopTasks
|
|
1803
|
+
};
|