@ooneex/typeorm 0.10.0 → 0.12.0

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.
Files changed (141) hide show
  1. package/dist/shared/chunk-0swb1h0m.js +51 -0
  2. package/dist/shared/{chunk-xwe8m6av.js.map → chunk-0swb1h0m.js.map} +2 -2
  3. package/dist/shared/chunk-2wdazj26.js +371 -0
  4. package/dist/shared/{chunk-5tnqjb3n.js.map → chunk-2wdazj26.js.map} +2 -2
  5. package/dist/shared/chunk-6m3p1ht9.js +606 -0
  6. package/dist/shared/{chunk-yrwsqc6r.js.map → chunk-6m3p1ht9.js.map} +2 -2
  7. package/dist/shared/{chunk-qrs0g3m9.js → chunk-6vmvyg0q.js} +58 -17
  8. package/dist/shared/{chunk-qrs0g3m9.js.map → chunk-6vmvyg0q.js.map} +2 -2
  9. package/dist/shared/chunk-bkdccdhn.js +105 -0
  10. package/dist/shared/{chunk-p22keb3y.js.map → chunk-bkdccdhn.js.map} +2 -2
  11. package/dist/shared/chunk-chan1evn.js +72 -0
  12. package/dist/shared/{chunk-xrqhqgen.js.map → chunk-chan1evn.js.map} +2 -2
  13. package/dist/shared/chunk-cv6xa6qy.js +621 -0
  14. package/dist/shared/{chunk-t1jad451.js.map → chunk-cv6xa6qy.js.map} +2 -2
  15. package/dist/shared/chunk-cwxhwya1.js +548 -0
  16. package/dist/shared/{chunk-x3pmm3na.js.map → chunk-cwxhwya1.js.map} +2 -2
  17. package/dist/shared/{chunk-qyf32qsz.js → chunk-eets3mef.js} +75 -22
  18. package/dist/shared/{chunk-qyf32qsz.js.map → chunk-eets3mef.js.map} +2 -2
  19. package/dist/shared/chunk-efmap3y3.js +345 -0
  20. package/dist/shared/{chunk-e51ktjsq.js.map → chunk-efmap3y3.js.map} +2 -2
  21. package/dist/shared/chunk-hkfj9j6w.js +30 -0
  22. package/dist/shared/{chunk-pbns711f.js.map → chunk-hkfj9j6w.js.map} +2 -2
  23. package/dist/shared/{chunk-aj0aak90.js → chunk-jap9t59k.js} +52 -14
  24. package/dist/shared/{chunk-aj0aak90.js.map → chunk-jap9t59k.js.map} +2 -2
  25. package/dist/shared/chunk-m4mpkr4n.js +34 -0
  26. package/dist/shared/{chunk-5ybg5hda.js.map → chunk-m4mpkr4n.js.map} +2 -2
  27. package/dist/shared/chunk-m9wkjs7v.js +639 -0
  28. package/dist/shared/{chunk-kw4t1san.js.map → chunk-m9wkjs7v.js.map} +2 -2
  29. package/dist/shared/chunk-mssxq87m.js +195 -0
  30. package/dist/shared/{chunk-6kdkyjbn.js.map → chunk-mssxq87m.js.map} +2 -2
  31. package/dist/shared/chunk-p12g6e7b.js +38 -0
  32. package/dist/shared/{chunk-6jnj2pfx.js.map → chunk-p12g6e7b.js.map} +2 -2
  33. package/dist/shared/chunk-qbn9p4vj.js +835 -0
  34. package/dist/shared/{chunk-nfv9ce7v.js.map → chunk-qbn9p4vj.js.map} +2 -2
  35. package/dist/shared/chunk-r9hsk9fk.js +20 -0
  36. package/dist/shared/{chunk-59vwmfpm.js.map → chunk-r9hsk9fk.js.map} +1 -1
  37. package/dist/shared/chunk-sk8z5zmk.js +112 -0
  38. package/dist/shared/{chunk-x2d798hg.js.map → chunk-sk8z5zmk.js.map} +2 -2
  39. package/dist/shared/chunk-tqd6ek7s.js +86 -0
  40. package/dist/shared/{chunk-19qhst35.js.map → chunk-tqd6ek7s.js.map} +2 -2
  41. package/dist/shared/{chunk-31y260d6.js → chunk-trhrh4e1.js} +89 -24
  42. package/dist/shared/{chunk-31y260d6.js.map → chunk-trhrh4e1.js.map} +2 -2
  43. package/dist/shared/chunk-wg7xcq50.js +38 -0
  44. package/dist/shared/{chunk-t5cy307m.js.map → chunk-wg7xcq50.js.map} +2 -2
  45. package/dist/shared/{chunk-jr0xys18.js → chunk-yszvxhf3.js} +41 -11
  46. package/dist/shared/{chunk-jr0xys18.js.map → chunk-yszvxhf3.js.map} +2 -2
  47. package/dist/src/entities/book/index.js +34 -2
  48. package/dist/src/entities/book/index.js.map +1 -1
  49. package/dist/src/entities/common/index.js +26 -2
  50. package/dist/src/entities/common/index.js.map +1 -1
  51. package/dist/src/entities/country/index.js +9 -2
  52. package/dist/src/entities/country/index.js.map +1 -1
  53. package/dist/src/entities/currency/index.js +9 -2
  54. package/dist/src/entities/currency/index.js.map +1 -1
  55. package/dist/src/entities/folder/index.js +394 -2
  56. package/dist/src/entities/folder/index.js.map +2 -2
  57. package/dist/src/entities/gamification/flashcard/index.js +26 -2
  58. package/dist/src/entities/gamification/flashcard/index.js.map +1 -1
  59. package/dist/src/entities/gamification/index.js +9 -2
  60. package/dist/src/entities/gamification/index.js.map +1 -1
  61. package/dist/src/entities/gamification/mcq/index.js +36 -2
  62. package/dist/src/entities/gamification/mcq/index.js.map +1 -1
  63. package/dist/src/entities/image/index.js +31 -2
  64. package/dist/src/entities/image/index.js.map +1 -1
  65. package/dist/src/entities/medecine/index.js +13 -2
  66. package/dist/src/entities/medecine/index.js.map +1 -1
  67. package/dist/src/entities/payment/index.js +23 -2
  68. package/dist/src/entities/payment/index.js.map +1 -1
  69. package/dist/src/entities/user/index.js +30 -2
  70. package/dist/src/entities/user/index.js.map +1 -1
  71. package/dist/src/entities/video/index.js +34 -2
  72. package/dist/src/entities/video/index.js.map +1 -1
  73. package/dist/src/migrations/book/index.js +541 -137
  74. package/dist/src/migrations/book/index.js.map +2 -2
  75. package/dist/src/migrations/common/index.js +63 -14
  76. package/dist/src/migrations/common/index.js.map +2 -2
  77. package/dist/src/migrations/country/index.js +48 -13
  78. package/dist/src/migrations/country/index.js.map +2 -2
  79. package/dist/src/migrations/currency/index.js +50 -14
  80. package/dist/src/migrations/currency/index.js.map +2 -2
  81. package/dist/src/migrations/folder/index.js +426 -104
  82. package/dist/src/migrations/folder/index.js.map +2 -2
  83. package/dist/src/migrations/gamification/flashcard/index.js +356 -96
  84. package/dist/src/migrations/gamification/flashcard/index.js.map +2 -2
  85. package/dist/src/migrations/gamification/index.js +8 -2
  86. package/dist/src/migrations/gamification/index.js.map +1 -1
  87. package/dist/src/migrations/gamification/mcq/index.js +553 -139
  88. package/dist/src/migrations/gamification/mcq/index.js.map +2 -2
  89. package/dist/src/migrations/image/index.js +353 -85
  90. package/dist/src/migrations/image/index.js.map +2 -2
  91. package/dist/src/migrations/medecine/index.js +132 -36
  92. package/dist/src/migrations/medecine/index.js.map +2 -2
  93. package/dist/src/migrations/payment/index.js +339 -94
  94. package/dist/src/migrations/payment/index.js.map +2 -2
  95. package/dist/src/migrations/user/index.js +331 -39
  96. package/dist/src/migrations/user/index.js.map +2 -2
  97. package/dist/src/migrations/video/index.js +345 -17
  98. package/dist/src/migrations/video/index.js.map +2 -2
  99. package/dist/src/repositories/book/index.js +997 -2
  100. package/dist/src/repositories/book/index.js.map +2 -2
  101. package/dist/src/repositories/common/index.js +439 -2
  102. package/dist/src/repositories/common/index.js.map +2 -2
  103. package/dist/src/repositories/country/index.js +89 -2
  104. package/dist/src/repositories/country/index.js.map +2 -2
  105. package/dist/src/repositories/currency/index.js +89 -2
  106. package/dist/src/repositories/currency/index.js.map +2 -2
  107. package/dist/src/repositories/gamification/flashcard/index.js +632 -2
  108. package/dist/src/repositories/gamification/flashcard/index.js.map +2 -2
  109. package/dist/src/repositories/gamification/index.js +160 -2
  110. package/dist/src/repositories/gamification/index.js.map +2 -2
  111. package/dist/src/repositories/gamification/mcq/index.js +1017 -2
  112. package/dist/src/repositories/gamification/mcq/index.js.map +2 -2
  113. package/dist/src/repositories/image/index.js +800 -2
  114. package/dist/src/repositories/image/index.js.map +2 -2
  115. package/dist/src/repositories/medecine/index.js +243 -2
  116. package/dist/src/repositories/medecine/index.js.map +2 -2
  117. package/dist/src/repositories/payment/index.js +560 -2
  118. package/dist/src/repositories/payment/index.js.map +2 -2
  119. package/dist/src/repositories/user/index.js +999 -2
  120. package/dist/src/repositories/user/index.js.map +2 -2
  121. package/dist/src/repositories/video/index.js +975 -2
  122. package/dist/src/repositories/video/index.js.map +2 -2
  123. package/package.json +21 -21
  124. package/dist/shared/chunk-19qhst35.js +0 -5
  125. package/dist/shared/chunk-59vwmfpm.js +0 -5
  126. package/dist/shared/chunk-5tnqjb3n.js +0 -5
  127. package/dist/shared/chunk-5ybg5hda.js +0 -5
  128. package/dist/shared/chunk-6jnj2pfx.js +0 -5
  129. package/dist/shared/chunk-6kdkyjbn.js +0 -5
  130. package/dist/shared/chunk-e51ktjsq.js +0 -5
  131. package/dist/shared/chunk-kw4t1san.js +0 -5
  132. package/dist/shared/chunk-nfv9ce7v.js +0 -5
  133. package/dist/shared/chunk-p22keb3y.js +0 -5
  134. package/dist/shared/chunk-pbns711f.js +0 -5
  135. package/dist/shared/chunk-t1jad451.js +0 -5
  136. package/dist/shared/chunk-t5cy307m.js +0 -5
  137. package/dist/shared/chunk-x2d798hg.js +0 -5
  138. package/dist/shared/chunk-x3pmm3na.js +0 -5
  139. package/dist/shared/chunk-xrqhqgen.js +0 -5
  140. package/dist/shared/chunk-xwe8m6av.js +0 -5
  141. package/dist/shared/chunk-yrwsqc6r.js +0 -5
@@ -1,5 +1,22 @@
1
1
  // @bun
2
- import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../../../../shared/chunk-31y260d6.js";import{f as O}from"../../../../shared/chunk-jr0xys18.js";import{Ha as v}from"../../../../shared/chunk-59vwmfpm.js";import{decorator as P}from"@ooneex/migrations";class p{async up(h){await h`
2
+ import {
3
+ Migration20251225173351645
4
+ } from "../../../../shared/chunk-jap9t59k.js";
5
+ import {
6
+ Migration20251225173350644
7
+ } from "../../../../shared/chunk-trhrh4e1.js";
8
+ import {
9
+ Migration20251225180910444
10
+ } from "../../../../shared/chunk-yszvxhf3.js";
11
+ import {
12
+ __legacyDecorateClassTS
13
+ } from "../../../../shared/chunk-r9hsk9fk.js";
14
+
15
+ // src/migrations/gamification/mcq/Migration20251225180910446.ts
16
+ import { decorator } from "@ooneex/migrations";
17
+ class Migration20251225180910446 {
18
+ async up(tx) {
19
+ await tx`
3
20
  CREATE TABLE IF NOT EXISTS mcq_questions (
4
21
  id VARCHAR(25) PRIMARY KEY,
5
22
  question_number INT NOT NULL,
@@ -21,7 +38,8 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
21
38
  deleted_at TIMESTAMPTZ,
22
39
  CONSTRAINT fk_mcq_questions_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
23
40
  )
24
- `,await h`
41
+ `;
42
+ await tx`
25
43
  CREATE TABLE IF NOT EXISTS mcq_questions_tags (
26
44
  question_id VARCHAR(25) NOT NULL,
27
45
  tag_id VARCHAR(25) NOT NULL,
@@ -29,35 +47,72 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
29
47
  CONSTRAINT fk_mcq_questions_tags_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE,
30
48
  CONSTRAINT fk_mcq_questions_tags_tag FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
31
49
  )
32
- `,await h`
50
+ `;
51
+ await tx`
33
52
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_question_number ON mcq_questions(question_number)
34
- `,await h`
53
+ `;
54
+ await tx`
35
55
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_context ON mcq_questions(context, context_id)
36
- `,await h`
56
+ `;
57
+ await tx`
37
58
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stat_id ON mcq_questions(stat_id)
38
- `,await h`
59
+ `;
60
+ await tx`
39
61
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_status_id ON mcq_questions(status_id)
40
- `,await h`
62
+ `;
63
+ await tx`
41
64
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_image_id ON mcq_questions(image_id)
42
- `,await h`
65
+ `;
66
+ await tx`
43
67
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_language ON mcq_questions(language)
44
- `,await h`
68
+ `;
69
+ await tx`
45
70
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_deleted_at ON mcq_questions(deleted_at)
46
- `,await h`
71
+ `;
72
+ await tx`
47
73
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_is_public ON mcq_questions(is_public) WHERE deleted_at IS NULL
48
- `,await h`
74
+ `;
75
+ await tx`
49
76
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_created_at ON mcq_questions(created_at DESC)
50
- `,await h`
77
+ `;
78
+ await tx`
51
79
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_updated_at ON mcq_questions(updated_at DESC)
52
- `,await h`
80
+ `;
81
+ await tx`
53
82
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_active ON mcq_questions(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
54
- `,await h`
83
+ `;
84
+ await tx`
55
85
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_tags_question_id ON mcq_questions_tags(question_id)
56
- `,await h`
86
+ `;
87
+ await tx`
57
88
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_tags_tag_id ON mcq_questions_tags(tag_id)
58
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_tags CASCADE`,await h`DROP TABLE IF EXISTS mcq_questions CASCADE`}getVersion(){return"20251225180910446"}getDependencies(){return[B,N]}}p=v([P.migration()],p);import{decorator as R}from"@ooneex/migrations";class z{async up(h){await h`
89
+ `;
90
+ }
91
+ async down(tx) {
92
+ await tx`DROP TABLE IF EXISTS mcq_questions_tags CASCADE`;
93
+ await tx`DROP TABLE IF EXISTS mcq_questions CASCADE`;
94
+ }
95
+ getVersion() {
96
+ return "20251225180910446";
97
+ }
98
+ getDependencies() {
99
+ return [
100
+ Migration20251225173350644,
101
+ Migration20251225173351645
102
+ ];
103
+ }
104
+ }
105
+ Migration20251225180910446 = __legacyDecorateClassTS([
106
+ decorator.migration()
107
+ ], Migration20251225180910446);
108
+ // src/migrations/gamification/mcq/Migration20251225180910449.ts
109
+ import { decorator as decorator2 } from "@ooneex/migrations";
110
+ class Migration20251225180910449 {
111
+ async up(tx) {
112
+ await tx`
59
113
  CREATE TYPE mcq_choice_letter AS ENUM ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J')
60
- `,await h`
114
+ `;
115
+ await tx`
61
116
  CREATE TABLE IF NOT EXISTS mcq_question_choices (
62
117
  id VARCHAR(25) PRIMARY KEY,
63
118
  letter mcq_choice_letter NOT NULL,
@@ -77,32 +132,65 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
77
132
  deleted_at TIMESTAMPTZ,
78
133
  CONSTRAINT fk_mcq_question_choices_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
79
134
  )
80
- `,await h`
135
+ `;
136
+ await tx`
81
137
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_question_id ON mcq_question_choices(question_id)
82
- `,await h`
138
+ `;
139
+ await tx`
83
140
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_letter ON mcq_question_choices(letter)
84
- `,await h`
141
+ `;
142
+ await tx`
85
143
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_is_correct ON mcq_question_choices(is_correct)
86
- `,await h`
144
+ `;
145
+ await tx`
87
146
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_language ON mcq_question_choices(language)
88
- `,await h`
147
+ `;
148
+ await tx`
89
149
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_deleted_at ON mcq_question_choices(deleted_at)
90
- `,await h`
150
+ `;
151
+ await tx`
91
152
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_is_public ON mcq_question_choices(is_public) WHERE deleted_at IS NULL
92
- `,await h`
153
+ `;
154
+ await tx`
93
155
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_created_at ON mcq_question_choices(created_at DESC)
94
- `,await h`
156
+ `;
157
+ await tx`
95
158
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_active ON mcq_question_choices(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
96
- `,await h`
159
+ `;
160
+ await tx`
97
161
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_question_letter ON mcq_question_choices(question_id, letter)
98
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_question_choices CASCADE`,await h`DROP TYPE IF EXISTS mcq_choice_letter CASCADE`}getVersion(){return"20251225180910449"}getDependencies(){return[p]}}z=v([R.migration()],z);import{decorator as S}from"@ooneex/migrations";class A{async up(h){await h`
162
+ `;
163
+ }
164
+ async down(tx) {
165
+ await tx`DROP TABLE IF EXISTS mcq_question_choices CASCADE`;
166
+ await tx`DROP TYPE IF EXISTS mcq_choice_letter CASCADE`;
167
+ }
168
+ getVersion() {
169
+ return "20251225180910449";
170
+ }
171
+ getDependencies() {
172
+ return [
173
+ Migration20251225180910446
174
+ ];
175
+ }
176
+ }
177
+ Migration20251225180910449 = __legacyDecorateClassTS([
178
+ decorator2.migration()
179
+ ], Migration20251225180910449);
180
+ // src/migrations/gamification/mcq/Migration20251225180910451.ts
181
+ import { decorator as decorator3 } from "@ooneex/migrations";
182
+ class Migration20251225180910451 {
183
+ async up(tx) {
184
+ await tx`
99
185
  CREATE TYPE mcq_session_status AS ENUM ('DRAFT', 'IN_PROGRESS', 'PAUSED', 'COMPLETED', 'CANCELLED')
100
- `,await h`
186
+ `;
187
+ await tx`
101
188
  CREATE TYPE session_type AS ENUM (
102
189
  'TRAINING', 'PRACTICE', 'SIMULATION', 'QUIZ',
103
190
  'CHALLENGE', 'TOURNAMENT', 'REVIEW', 'DIAGNOSTIC', 'SPEED_TEST'
104
191
  )
105
- `,await h`
192
+ `;
193
+ await tx`
106
194
  CREATE TABLE IF NOT EXISTS mcq_sessions (
107
195
  id VARCHAR(25) PRIMARY KEY,
108
196
  name VARCHAR(500) NOT NULL,
@@ -131,7 +219,8 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
131
219
  deleted_at TIMESTAMPTZ,
132
220
  CONSTRAINT fk_mcq_sessions_level FOREIGN KEY (level_id) REFERENCES levels(id) ON DELETE RESTRICT
133
221
  )
134
- `,await h`
222
+ `;
223
+ await tx`
135
224
  CREATE TABLE IF NOT EXISTS mcq_sessions_questions (
136
225
  session_id VARCHAR(25) NOT NULL,
137
226
  question_id VARCHAR(25) NOT NULL,
@@ -139,41 +228,83 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
139
228
  CONSTRAINT fk_mcq_sessions_questions_session FOREIGN KEY (session_id) REFERENCES mcq_sessions(id) ON DELETE CASCADE,
140
229
  CONSTRAINT fk_mcq_sessions_questions_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
141
230
  )
142
- `,await h`
231
+ `;
232
+ await tx`
143
233
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_name ON mcq_sessions(name)
144
- `,await h`
234
+ `;
235
+ await tx`
145
236
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_status ON mcq_sessions(status)
146
- `,await h`
237
+ `;
238
+ await tx`
147
239
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_type ON mcq_sessions(type)
148
- `,await h`
240
+ `;
241
+ await tx`
149
242
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_level_id ON mcq_sessions(level_id)
150
- `,await h`
243
+ `;
244
+ await tx`
151
245
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_score ON mcq_sessions(score DESC)
152
- `,await h`
246
+ `;
247
+ await tx`
153
248
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_started_at ON mcq_sessions(started_at DESC)
154
- `,await h`
249
+ `;
250
+ await tx`
155
251
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_completed_at ON mcq_sessions(completed_at DESC)
156
- `,await h`
252
+ `;
253
+ await tx`
157
254
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_language ON mcq_sessions(language)
158
- `,await h`
255
+ `;
256
+ await tx`
159
257
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_deleted_at ON mcq_sessions(deleted_at)
160
- `,await h`
258
+ `;
259
+ await tx`
161
260
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_is_public ON mcq_sessions(is_public) WHERE deleted_at IS NULL
162
- `,await h`
261
+ `;
262
+ await tx`
163
263
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_created_at ON mcq_sessions(created_at DESC)
164
- `,await h`
264
+ `;
265
+ await tx`
165
266
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_updated_at ON mcq_sessions(updated_at DESC)
166
- `,await h`
267
+ `;
268
+ await tx`
167
269
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_active ON mcq_sessions(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
168
- `,await h`
270
+ `;
271
+ await tx`
169
272
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_performance ON mcq_sessions(type, score DESC, completed_at DESC) WHERE status = 'COMPLETED' AND deleted_at IS NULL
170
- `,await h`
273
+ `;
274
+ await tx`
171
275
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_questions_session_id ON mcq_sessions_questions(session_id)
172
- `,await h`
276
+ `;
277
+ await tx`
173
278
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_questions_question_id ON mcq_sessions_questions(question_id)
174
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_sessions_questions CASCADE`,await h`DROP TABLE IF EXISTS mcq_sessions CASCADE`,await h`DROP TYPE IF EXISTS session_type CASCADE`,await h`DROP TYPE IF EXISTS mcq_session_status CASCADE`}getVersion(){return"20251225180910451"}getDependencies(){return[O,p]}}A=v([S.migration()],A);import{decorator as T}from"@ooneex/migrations";class D{async up(h){await h`
279
+ `;
280
+ }
281
+ async down(tx) {
282
+ await tx`DROP TABLE IF EXISTS mcq_sessions_questions CASCADE`;
283
+ await tx`DROP TABLE IF EXISTS mcq_sessions CASCADE`;
284
+ await tx`DROP TYPE IF EXISTS session_type CASCADE`;
285
+ await tx`DROP TYPE IF EXISTS mcq_session_status CASCADE`;
286
+ }
287
+ getVersion() {
288
+ return "20251225180910451";
289
+ }
290
+ getDependencies() {
291
+ return [
292
+ Migration20251225180910444,
293
+ Migration20251225180910446
294
+ ];
295
+ }
296
+ }
297
+ Migration20251225180910451 = __legacyDecorateClassTS([
298
+ decorator3.migration()
299
+ ], Migration20251225180910451);
300
+ // src/migrations/gamification/mcq/Migration20251225180910453.ts
301
+ import { decorator as decorator4 } from "@ooneex/migrations";
302
+ class Migration20251225180910453 {
303
+ async up(tx) {
304
+ await tx`
175
305
  CREATE TYPE answer_state AS ENUM ('UNANSWERED', 'CORRECT', 'INCORRECT', 'PARTIAL', 'SKIPPED')
176
- `,await h`
306
+ `;
307
+ await tx`
177
308
  CREATE TABLE IF NOT EXISTS mcq_session_questions (
178
309
  id VARCHAR(25) PRIMARY KEY,
179
310
  session_id VARCHAR(25) NOT NULL,
@@ -196,7 +327,8 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
196
327
  CONSTRAINT fk_mcq_session_questions_session FOREIGN KEY (session_id) REFERENCES mcq_sessions(id) ON DELETE CASCADE,
197
328
  CONSTRAINT fk_mcq_session_questions_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE RESTRICT
198
329
  )
199
- `,await h`
330
+ `;
331
+ await tx`
200
332
  CREATE TABLE IF NOT EXISTS mcq_session_questions_selected_choices (
201
333
  session_question_id VARCHAR(25) NOT NULL,
202
334
  choice_id VARCHAR(25) NOT NULL,
@@ -204,35 +336,73 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
204
336
  CONSTRAINT fk_mcq_session_questions_selected_choices_session_question FOREIGN KEY (session_question_id) REFERENCES mcq_session_questions(id) ON DELETE CASCADE,
205
337
  CONSTRAINT fk_mcq_session_questions_selected_choices_choice FOREIGN KEY (choice_id) REFERENCES mcq_question_choices(id) ON DELETE CASCADE
206
338
  )
207
- `,await h`
339
+ `;
340
+ await tx`
208
341
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_session_id ON mcq_session_questions(session_id)
209
- `,await h`
342
+ `;
343
+ await tx`
210
344
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_question_id ON mcq_session_questions(question_id)
211
- `,await h`
345
+ `;
346
+ await tx`
212
347
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_question_number ON mcq_session_questions(question_number)
213
- `,await h`
348
+ `;
349
+ await tx`
214
350
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_state ON mcq_session_questions(state)
215
- `,await h`
351
+ `;
352
+ await tx`
216
353
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_context ON mcq_session_questions(context, context_id)
217
- `,await h`
354
+ `;
355
+ await tx`
218
356
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_score ON mcq_session_questions(score DESC)
219
- `,await h`
357
+ `;
358
+ await tx`
220
359
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_language ON mcq_session_questions(language)
221
- `,await h`
360
+ `;
361
+ await tx`
222
362
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_deleted_at ON mcq_session_questions(deleted_at)
223
- `,await h`
363
+ `;
364
+ await tx`
224
365
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_is_public ON mcq_session_questions(is_public) WHERE deleted_at IS NULL
225
- `,await h`
366
+ `;
367
+ await tx`
226
368
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_created_at ON mcq_session_questions(created_at DESC)
227
- `,await h`
369
+ `;
370
+ await tx`
228
371
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_active ON mcq_session_questions(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
229
- `,await h`
372
+ `;
373
+ await tx`
230
374
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_session_question ON mcq_session_questions(session_id, question_number)
231
- `,await h`
375
+ `;
376
+ await tx`
232
377
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_selected_choices_session_question_id ON mcq_session_questions_selected_choices(session_question_id)
233
- `,await h`
378
+ `;
379
+ await tx`
234
380
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_selected_choices_choice_id ON mcq_session_questions_selected_choices(choice_id)
235
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_session_questions_selected_choices CASCADE`,await h`DROP TABLE IF EXISTS mcq_session_questions CASCADE`,await h`DROP TYPE IF EXISTS answer_state CASCADE`}getVersion(){return"20251225180910453"}getDependencies(){return[z,A]}}D=v([T.migration()],D);import{decorator as U}from"@ooneex/migrations";class E{async up(h){await h`
381
+ `;
382
+ }
383
+ async down(tx) {
384
+ await tx`DROP TABLE IF EXISTS mcq_session_questions_selected_choices CASCADE`;
385
+ await tx`DROP TABLE IF EXISTS mcq_session_questions CASCADE`;
386
+ await tx`DROP TYPE IF EXISTS answer_state CASCADE`;
387
+ }
388
+ getVersion() {
389
+ return "20251225180910453";
390
+ }
391
+ getDependencies() {
392
+ return [
393
+ Migration20251225180910449,
394
+ Migration20251225180910451
395
+ ];
396
+ }
397
+ }
398
+ Migration20251225180910453 = __legacyDecorateClassTS([
399
+ decorator4.migration()
400
+ ], Migration20251225180910453);
401
+ // src/migrations/gamification/mcq/Migration20251225180910455.ts
402
+ import { decorator as decorator5 } from "@ooneex/migrations";
403
+ class Migration20251225180910455 {
404
+ async up(tx) {
405
+ await tx`
236
406
  CREATE TABLE IF NOT EXISTS mcq_questions_stats (
237
407
  id VARCHAR(25) PRIMARY KEY,
238
408
  question_id VARCHAR(25),
@@ -255,25 +425,55 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
255
425
  deleted_at TIMESTAMPTZ,
256
426
  CONSTRAINT fk_mcq_questions_stats_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
257
427
  )
258
- `,await h`
428
+ `;
429
+ await tx`
259
430
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_question_id ON mcq_questions_stats(question_id)
260
- `,await h`
431
+ `;
432
+ await tx`
261
433
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_likes_count ON mcq_questions_stats(likes_count DESC)
262
- `,await h`
434
+ `;
435
+ await tx`
263
436
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_views_count ON mcq_questions_stats(views_count DESC)
264
- `,await h`
437
+ `;
438
+ await tx`
265
439
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_language ON mcq_questions_stats(language)
266
- `,await h`
440
+ `;
441
+ await tx`
267
442
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_deleted_at ON mcq_questions_stats(deleted_at)
268
- `,await h`
443
+ `;
444
+ await tx`
269
445
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_is_public ON mcq_questions_stats(is_public) WHERE deleted_at IS NULL
270
- `,await h`
446
+ `;
447
+ await tx`
271
448
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_popular ON mcq_questions_stats(is_public, likes_count DESC, views_count DESC) WHERE deleted_at IS NULL
272
- `,await h`
449
+ `;
450
+ await tx`
273
451
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_created_at ON mcq_questions_stats(created_at DESC)
274
- `,await h`
452
+ `;
453
+ await tx`
275
454
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_active ON mcq_questions_stats(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
276
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_stats CASCADE`}getVersion(){return"20251225180910455"}getDependencies(){return[p]}}E=v([U.migration()],E);import{decorator as V}from"@ooneex/migrations";class F{async up(h){await h`
455
+ `;
456
+ }
457
+ async down(tx) {
458
+ await tx`DROP TABLE IF EXISTS mcq_questions_stats CASCADE`;
459
+ }
460
+ getVersion() {
461
+ return "20251225180910455";
462
+ }
463
+ getDependencies() {
464
+ return [
465
+ Migration20251225180910446
466
+ ];
467
+ }
468
+ }
469
+ Migration20251225180910455 = __legacyDecorateClassTS([
470
+ decorator5.migration()
471
+ ], Migration20251225180910455);
472
+ // src/migrations/gamification/mcq/Migration20251225180910458.ts
473
+ import { decorator as decorator6 } from "@ooneex/migrations";
474
+ class Migration20251225180910458 {
475
+ async up(tx) {
476
+ await tx`
277
477
  CREATE TABLE IF NOT EXISTS mcq_questions_comments (
278
478
  id VARCHAR(25) PRIMARY KEY,
279
479
  question_id VARCHAR(25),
@@ -293,23 +493,52 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
293
493
  deleted_at TIMESTAMPTZ,
294
494
  CONSTRAINT fk_mcq_questions_comments_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
295
495
  )
296
- `,await h`
496
+ `;
497
+ await tx`
297
498
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_question_id ON mcq_questions_comments(question_id)
298
- `,await h`
499
+ `;
500
+ await tx`
299
501
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_commented_by_id ON mcq_questions_comments(commented_by_id)
300
- `,await h`
502
+ `;
503
+ await tx`
301
504
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_parent_comment_id ON mcq_questions_comments(parent_comment_id)
302
- `,await h`
505
+ `;
506
+ await tx`
303
507
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_language ON mcq_questions_comments(language)
304
- `,await h`
508
+ `;
509
+ await tx`
305
510
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_deleted_at ON mcq_questions_comments(deleted_at)
306
- `,await h`
511
+ `;
512
+ await tx`
307
513
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_is_public ON mcq_questions_comments(is_public) WHERE deleted_at IS NULL
308
- `,await h`
514
+ `;
515
+ await tx`
309
516
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_created_at ON mcq_questions_comments(created_at DESC)
310
- `,await h`
517
+ `;
518
+ await tx`
311
519
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_active ON mcq_questions_comments(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
312
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_comments CASCADE`}getVersion(){return"20251225180910458"}getDependencies(){return[p]}}F=v([V.migration()],F);import{decorator as W}from"@ooneex/migrations";class G{async up(h){await h`
520
+ `;
521
+ }
522
+ async down(tx) {
523
+ await tx`DROP TABLE IF EXISTS mcq_questions_comments CASCADE`;
524
+ }
525
+ getVersion() {
526
+ return "20251225180910458";
527
+ }
528
+ getDependencies() {
529
+ return [
530
+ Migration20251225180910446
531
+ ];
532
+ }
533
+ }
534
+ Migration20251225180910458 = __legacyDecorateClassTS([
535
+ decorator6.migration()
536
+ ], Migration20251225180910458);
537
+ // src/migrations/gamification/mcq/Migration20251225180910460.ts
538
+ import { decorator as decorator7 } from "@ooneex/migrations";
539
+ class Migration20251225180910460 {
540
+ async up(tx) {
541
+ await tx`
313
542
  CREATE TABLE IF NOT EXISTS mcq_questions_liked (
314
543
  id VARCHAR(25) PRIMARY KEY,
315
544
  question_id VARCHAR(25),
@@ -327,23 +556,52 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
327
556
  deleted_at TIMESTAMPTZ,
328
557
  CONSTRAINT fk_mcq_questions_liked_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
329
558
  )
330
- `,await h`
559
+ `;
560
+ await tx`
331
561
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_question_id ON mcq_questions_liked(question_id)
332
- `,await h`
562
+ `;
563
+ await tx`
333
564
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_liked_by_id ON mcq_questions_liked(liked_by_id)
334
- `,await h`
565
+ `;
566
+ await tx`
335
567
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_language ON mcq_questions_liked(language)
336
- `,await h`
568
+ `;
569
+ await tx`
337
570
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_deleted_at ON mcq_questions_liked(deleted_at)
338
- `,await h`
571
+ `;
572
+ await tx`
339
573
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_is_public ON mcq_questions_liked(is_public) WHERE deleted_at IS NULL
340
- `,await h`
574
+ `;
575
+ await tx`
341
576
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_created_at ON mcq_questions_liked(created_at DESC)
342
- `,await h`
577
+ `;
578
+ await tx`
343
579
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_active ON mcq_questions_liked(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
344
- `,await h`
580
+ `;
581
+ await tx`
345
582
  CREATE UNIQUE INDEX IF NOT EXISTS idx_mcq_questions_liked_unique ON mcq_questions_liked(question_id, liked_by_id) WHERE deleted_at IS NULL
346
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_liked CASCADE`}getVersion(){return"20251225180910460"}getDependencies(){return[p]}}G=v([W.migration()],G);import{decorator as X}from"@ooneex/migrations";class H{async up(h){await h`
583
+ `;
584
+ }
585
+ async down(tx) {
586
+ await tx`DROP TABLE IF EXISTS mcq_questions_liked CASCADE`;
587
+ }
588
+ getVersion() {
589
+ return "20251225180910460";
590
+ }
591
+ getDependencies() {
592
+ return [
593
+ Migration20251225180910446
594
+ ];
595
+ }
596
+ }
597
+ Migration20251225180910460 = __legacyDecorateClassTS([
598
+ decorator7.migration()
599
+ ], Migration20251225180910460);
600
+ // src/migrations/gamification/mcq/Migration20251225180910462.ts
601
+ import { decorator as decorator8 } from "@ooneex/migrations";
602
+ class Migration20251225180910462 {
603
+ async up(tx) {
604
+ await tx`
347
605
  CREATE TABLE IF NOT EXISTS mcq_questions_disliked (
348
606
  id VARCHAR(25) PRIMARY KEY,
349
607
  question_id VARCHAR(25),
@@ -361,23 +619,52 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
361
619
  deleted_at TIMESTAMPTZ,
362
620
  CONSTRAINT fk_mcq_questions_disliked_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
363
621
  )
364
- `,await h`
622
+ `;
623
+ await tx`
365
624
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_question_id ON mcq_questions_disliked(question_id)
366
- `,await h`
625
+ `;
626
+ await tx`
367
627
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_disliked_by_id ON mcq_questions_disliked(disliked_by_id)
368
- `,await h`
628
+ `;
629
+ await tx`
369
630
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_language ON mcq_questions_disliked(language)
370
- `,await h`
631
+ `;
632
+ await tx`
371
633
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_deleted_at ON mcq_questions_disliked(deleted_at)
372
- `,await h`
634
+ `;
635
+ await tx`
373
636
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_is_public ON mcq_questions_disliked(is_public) WHERE deleted_at IS NULL
374
- `,await h`
637
+ `;
638
+ await tx`
375
639
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_created_at ON mcq_questions_disliked(created_at DESC)
376
- `,await h`
640
+ `;
641
+ await tx`
377
642
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_active ON mcq_questions_disliked(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
378
- `,await h`
643
+ `;
644
+ await tx`
379
645
  CREATE UNIQUE INDEX IF NOT EXISTS idx_mcq_questions_disliked_unique ON mcq_questions_disliked(question_id, disliked_by_id) WHERE deleted_at IS NULL
380
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_disliked CASCADE`}getVersion(){return"20251225180910462"}getDependencies(){return[p]}}H=v([X.migration()],H);import{decorator as Y}from"@ooneex/migrations";class I{async up(h){await h`
646
+ `;
647
+ }
648
+ async down(tx) {
649
+ await tx`DROP TABLE IF EXISTS mcq_questions_disliked CASCADE`;
650
+ }
651
+ getVersion() {
652
+ return "20251225180910462";
653
+ }
654
+ getDependencies() {
655
+ return [
656
+ Migration20251225180910446
657
+ ];
658
+ }
659
+ }
660
+ Migration20251225180910462 = __legacyDecorateClassTS([
661
+ decorator8.migration()
662
+ ], Migration20251225180910462);
663
+ // src/migrations/gamification/mcq/Migration20251225180910465.ts
664
+ import { decorator as decorator9 } from "@ooneex/migrations";
665
+ class Migration20251225180910465 {
666
+ async up(tx) {
667
+ await tx`
381
668
  CREATE TABLE IF NOT EXISTS mcq_questions_viewed (
382
669
  id VARCHAR(25) PRIMARY KEY,
383
670
  question_id VARCHAR(25),
@@ -395,21 +682,49 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
395
682
  deleted_at TIMESTAMPTZ,
396
683
  CONSTRAINT fk_mcq_questions_viewed_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
397
684
  )
398
- `,await h`
685
+ `;
686
+ await tx`
399
687
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_question_id ON mcq_questions_viewed(question_id)
400
- `,await h`
688
+ `;
689
+ await tx`
401
690
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_viewed_by_id ON mcq_questions_viewed(viewed_by_id)
402
- `,await h`
691
+ `;
692
+ await tx`
403
693
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_language ON mcq_questions_viewed(language)
404
- `,await h`
694
+ `;
695
+ await tx`
405
696
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_deleted_at ON mcq_questions_viewed(deleted_at)
406
- `,await h`
697
+ `;
698
+ await tx`
407
699
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_is_public ON mcq_questions_viewed(is_public) WHERE deleted_at IS NULL
408
- `,await h`
700
+ `;
701
+ await tx`
409
702
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_created_at ON mcq_questions_viewed(created_at DESC)
410
- `,await h`
703
+ `;
704
+ await tx`
411
705
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_active ON mcq_questions_viewed(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
412
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_viewed CASCADE`}getVersion(){return"20251225180910465"}getDependencies(){return[p]}}I=v([Y.migration()],I);import{decorator as Z}from"@ooneex/migrations";class J{async up(h){await h`
706
+ `;
707
+ }
708
+ async down(tx) {
709
+ await tx`DROP TABLE IF EXISTS mcq_questions_viewed CASCADE`;
710
+ }
711
+ getVersion() {
712
+ return "20251225180910465";
713
+ }
714
+ getDependencies() {
715
+ return [
716
+ Migration20251225180910446
717
+ ];
718
+ }
719
+ }
720
+ Migration20251225180910465 = __legacyDecorateClassTS([
721
+ decorator9.migration()
722
+ ], Migration20251225180910465);
723
+ // src/migrations/gamification/mcq/Migration20251225180910467.ts
724
+ import { decorator as decorator10 } from "@ooneex/migrations";
725
+ class Migration20251225180910467 {
726
+ async up(tx) {
727
+ await tx`
413
728
  CREATE TABLE IF NOT EXISTS mcq_questions_saved (
414
729
  id VARCHAR(25) PRIMARY KEY,
415
730
  question_id VARCHAR(25),
@@ -427,23 +742,52 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
427
742
  deleted_at TIMESTAMPTZ,
428
743
  CONSTRAINT fk_mcq_questions_saved_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
429
744
  )
430
- `,await h`
745
+ `;
746
+ await tx`
431
747
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_question_id ON mcq_questions_saved(question_id)
432
- `,await h`
748
+ `;
749
+ await tx`
433
750
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_saved_by_id ON mcq_questions_saved(saved_by_id)
434
- `,await h`
751
+ `;
752
+ await tx`
435
753
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_language ON mcq_questions_saved(language)
436
- `,await h`
754
+ `;
755
+ await tx`
437
756
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_deleted_at ON mcq_questions_saved(deleted_at)
438
- `,await h`
757
+ `;
758
+ await tx`
439
759
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_is_public ON mcq_questions_saved(is_public) WHERE deleted_at IS NULL
440
- `,await h`
760
+ `;
761
+ await tx`
441
762
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_created_at ON mcq_questions_saved(created_at DESC)
442
- `,await h`
763
+ `;
764
+ await tx`
443
765
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_active ON mcq_questions_saved(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
444
- `,await h`
766
+ `;
767
+ await tx`
445
768
  CREATE UNIQUE INDEX IF NOT EXISTS idx_mcq_questions_saved_unique ON mcq_questions_saved(question_id, saved_by_id) WHERE deleted_at IS NULL
446
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_saved CASCADE`}getVersion(){return"20251225180910467"}getDependencies(){return[p]}}J=v([Z.migration()],J);import{decorator as $}from"@ooneex/migrations";class K{async up(h){await h`
769
+ `;
770
+ }
771
+ async down(tx) {
772
+ await tx`DROP TABLE IF EXISTS mcq_questions_saved CASCADE`;
773
+ }
774
+ getVersion() {
775
+ return "20251225180910467";
776
+ }
777
+ getDependencies() {
778
+ return [
779
+ Migration20251225180910446
780
+ ];
781
+ }
782
+ }
783
+ Migration20251225180910467 = __legacyDecorateClassTS([
784
+ decorator10.migration()
785
+ ], Migration20251225180910467);
786
+ // src/migrations/gamification/mcq/Migration20251225180910469.ts
787
+ import { decorator as decorator11 } from "@ooneex/migrations";
788
+ class Migration20251225180910469 {
789
+ async up(tx) {
790
+ await tx`
447
791
  CREATE TABLE IF NOT EXISTS mcq_questions_shared (
448
792
  id VARCHAR(25) PRIMARY KEY,
449
793
  question_id VARCHAR(25),
@@ -463,25 +807,55 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
463
807
  deleted_at TIMESTAMPTZ,
464
808
  CONSTRAINT fk_mcq_questions_shared_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
465
809
  )
466
- `,await h`
810
+ `;
811
+ await tx`
467
812
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_question_id ON mcq_questions_shared(question_id)
468
- `,await h`
813
+ `;
814
+ await tx`
469
815
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_shared_by_id ON mcq_questions_shared(shared_by_id)
470
- `,await h`
816
+ `;
817
+ await tx`
471
818
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_expires_at ON mcq_questions_shared(expires_at)
472
- `,await h`
819
+ `;
820
+ await tx`
473
821
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_language ON mcq_questions_shared(language)
474
- `,await h`
822
+ `;
823
+ await tx`
475
824
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_deleted_at ON mcq_questions_shared(deleted_at)
476
- `,await h`
825
+ `;
826
+ await tx`
477
827
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_is_public ON mcq_questions_shared(is_public) WHERE deleted_at IS NULL
478
- `,await h`
828
+ `;
829
+ await tx`
479
830
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_created_at ON mcq_questions_shared(created_at DESC)
480
- `,await h`
831
+ `;
832
+ await tx`
481
833
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_active ON mcq_questions_shared(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
482
- `,await h`
834
+ `;
835
+ await tx`
483
836
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_active_shares ON mcq_questions_shared(expires_at) WHERE deleted_at IS NULL AND (expires_at IS NULL OR expires_at > CURRENT_TIMESTAMP)
484
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_shared CASCADE`}getVersion(){return"20251225180910469"}getDependencies(){return[p]}}K=v([$.migration()],K);import{decorator as j}from"@ooneex/migrations";class L{async up(h){await h`
837
+ `;
838
+ }
839
+ async down(tx) {
840
+ await tx`DROP TABLE IF EXISTS mcq_questions_shared CASCADE`;
841
+ }
842
+ getVersion() {
843
+ return "20251225180910469";
844
+ }
845
+ getDependencies() {
846
+ return [
847
+ Migration20251225180910446
848
+ ];
849
+ }
850
+ }
851
+ Migration20251225180910469 = __legacyDecorateClassTS([
852
+ decorator11.migration()
853
+ ], Migration20251225180910469);
854
+ // src/migrations/gamification/mcq/Migration20251225180910472.ts
855
+ import { decorator as decorator12 } from "@ooneex/migrations";
856
+ class Migration20251225180910472 {
857
+ async up(tx) {
858
+ await tx`
485
859
  CREATE TABLE IF NOT EXISTS mcq_questions_reports (
486
860
  id VARCHAR(25) PRIMARY KEY,
487
861
  question_id VARCHAR(25),
@@ -503,24 +877,64 @@ import{c as N}from"../../../../shared/chunk-aj0aak90.js";import{e as B}from"../.
503
877
  CONSTRAINT fk_mcq_questions_reports_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE,
504
878
  CONSTRAINT fk_mcq_questions_reports_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
505
879
  )
506
- `,await h`
880
+ `;
881
+ await tx`
507
882
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_question_id ON mcq_questions_reports(question_id)
508
- `,await h`
883
+ `;
884
+ await tx`
509
885
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_reported_by_id ON mcq_questions_reports(reported_by_id)
510
- `,await h`
886
+ `;
887
+ await tx`
511
888
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_status_id ON mcq_questions_reports(status_id)
512
- `,await h`
889
+ `;
890
+ await tx`
513
891
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_reason ON mcq_questions_reports(reason)
514
- `,await h`
892
+ `;
893
+ await tx`
515
894
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_language ON mcq_questions_reports(language)
516
- `,await h`
895
+ `;
896
+ await tx`
517
897
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_deleted_at ON mcq_questions_reports(deleted_at)
518
- `,await h`
898
+ `;
899
+ await tx`
519
900
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_is_public ON mcq_questions_reports(is_public) WHERE deleted_at IS NULL
520
- `,await h`
901
+ `;
902
+ await tx`
521
903
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_created_at ON mcq_questions_reports(created_at DESC)
522
- `,await h`
904
+ `;
905
+ await tx`
523
906
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_active ON mcq_questions_reports(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
524
- `}async down(h){await h`DROP TABLE IF EXISTS mcq_questions_reports CASCADE`}getVersion(){return"20251225180910472"}getDependencies(){return[p,B]}}L=v([j.migration()],L);export{L as Migration20251225180910472,K as Migration20251225180910469,J as Migration20251225180910467,I as Migration20251225180910465,H as Migration20251225180910462,G as Migration20251225180910460,F as Migration20251225180910458,E as Migration20251225180910455,D as Migration20251225180910453,A as Migration20251225180910451,z as Migration20251225180910449,p as Migration20251225180910446};
907
+ `;
908
+ }
909
+ async down(tx) {
910
+ await tx`DROP TABLE IF EXISTS mcq_questions_reports CASCADE`;
911
+ }
912
+ getVersion() {
913
+ return "20251225180910472";
914
+ }
915
+ getDependencies() {
916
+ return [
917
+ Migration20251225180910446,
918
+ Migration20251225173350644
919
+ ];
920
+ }
921
+ }
922
+ Migration20251225180910472 = __legacyDecorateClassTS([
923
+ decorator12.migration()
924
+ ], Migration20251225180910472);
925
+ export {
926
+ Migration20251225180910472,
927
+ Migration20251225180910469,
928
+ Migration20251225180910467,
929
+ Migration20251225180910465,
930
+ Migration20251225180910462,
931
+ Migration20251225180910460,
932
+ Migration20251225180910458,
933
+ Migration20251225180910455,
934
+ Migration20251225180910453,
935
+ Migration20251225180910451,
936
+ Migration20251225180910449,
937
+ Migration20251225180910446
938
+ };
525
939
 
526
- //# debugId=9A5AB86DE5CC468A64756E2164756E21
940
+ //# debugId=7CA8F2F04D78139864756E2164756E21