@ooneex/typeorm 0.12.0 → 0.14.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-19qhst35.js +5 -0
  2. package/dist/shared/{chunk-tqd6ek7s.js.map → chunk-19qhst35.js.map} +2 -2
  3. package/dist/shared/{chunk-trhrh4e1.js → chunk-31y260d6.js} +24 -89
  4. package/dist/shared/{chunk-trhrh4e1.js.map → chunk-31y260d6.js.map} +2 -2
  5. package/dist/shared/chunk-59vwmfpm.js +5 -0
  6. package/dist/shared/{chunk-r9hsk9fk.js.map → chunk-59vwmfpm.js.map} +1 -1
  7. package/dist/shared/chunk-5tnqjb3n.js +5 -0
  8. package/dist/shared/{chunk-2wdazj26.js.map → chunk-5tnqjb3n.js.map} +2 -2
  9. package/dist/shared/chunk-5ybg5hda.js +5 -0
  10. package/dist/shared/{chunk-m4mpkr4n.js.map → chunk-5ybg5hda.js.map} +2 -2
  11. package/dist/shared/chunk-6jnj2pfx.js +5 -0
  12. package/dist/shared/{chunk-p12g6e7b.js.map → chunk-6jnj2pfx.js.map} +2 -2
  13. package/dist/shared/chunk-6kdkyjbn.js +5 -0
  14. package/dist/shared/{chunk-mssxq87m.js.map → chunk-6kdkyjbn.js.map} +2 -2
  15. package/dist/shared/{chunk-jap9t59k.js → chunk-aj0aak90.js} +14 -52
  16. package/dist/shared/{chunk-jap9t59k.js.map → chunk-aj0aak90.js.map} +2 -2
  17. package/dist/shared/chunk-e51ktjsq.js +5 -0
  18. package/dist/shared/{chunk-efmap3y3.js.map → chunk-e51ktjsq.js.map} +2 -2
  19. package/dist/shared/{chunk-yszvxhf3.js → chunk-jr0xys18.js} +11 -41
  20. package/dist/shared/{chunk-yszvxhf3.js.map → chunk-jr0xys18.js.map} +2 -2
  21. package/dist/shared/chunk-kw4t1san.js +5 -0
  22. package/dist/shared/{chunk-m9wkjs7v.js.map → chunk-kw4t1san.js.map} +2 -2
  23. package/dist/shared/chunk-nfv9ce7v.js +5 -0
  24. package/dist/shared/{chunk-qbn9p4vj.js.map → chunk-nfv9ce7v.js.map} +2 -2
  25. package/dist/shared/chunk-p22keb3y.js +5 -0
  26. package/dist/shared/{chunk-bkdccdhn.js.map → chunk-p22keb3y.js.map} +2 -2
  27. package/dist/shared/chunk-pbns711f.js +5 -0
  28. package/dist/shared/{chunk-hkfj9j6w.js.map → chunk-pbns711f.js.map} +2 -2
  29. package/dist/shared/{chunk-6vmvyg0q.js → chunk-qrs0g3m9.js} +17 -58
  30. package/dist/shared/{chunk-6vmvyg0q.js.map → chunk-qrs0g3m9.js.map} +2 -2
  31. package/dist/shared/{chunk-eets3mef.js → chunk-qyf32qsz.js} +22 -75
  32. package/dist/shared/{chunk-eets3mef.js.map → chunk-qyf32qsz.js.map} +2 -2
  33. package/dist/shared/chunk-t1jad451.js +5 -0
  34. package/dist/shared/{chunk-cv6xa6qy.js.map → chunk-t1jad451.js.map} +2 -2
  35. package/dist/shared/chunk-t5cy307m.js +5 -0
  36. package/dist/shared/{chunk-wg7xcq50.js.map → chunk-t5cy307m.js.map} +2 -2
  37. package/dist/shared/chunk-x2d798hg.js +5 -0
  38. package/dist/shared/{chunk-sk8z5zmk.js.map → chunk-x2d798hg.js.map} +2 -2
  39. package/dist/shared/chunk-x3pmm3na.js +5 -0
  40. package/dist/shared/{chunk-cwxhwya1.js.map → chunk-x3pmm3na.js.map} +2 -2
  41. package/dist/shared/chunk-xrqhqgen.js +5 -0
  42. package/dist/shared/{chunk-chan1evn.js.map → chunk-xrqhqgen.js.map} +2 -2
  43. package/dist/shared/chunk-xwe8m6av.js +5 -0
  44. package/dist/shared/{chunk-0swb1h0m.js.map → chunk-xwe8m6av.js.map} +2 -2
  45. package/dist/shared/chunk-yrwsqc6r.js +5 -0
  46. package/dist/shared/{chunk-6m3p1ht9.js.map → chunk-yrwsqc6r.js.map} +2 -2
  47. package/dist/src/entities/book/index.js +2 -34
  48. package/dist/src/entities/book/index.js.map +1 -1
  49. package/dist/src/entities/common/index.js +2 -26
  50. package/dist/src/entities/common/index.js.map +1 -1
  51. package/dist/src/entities/country/index.js +2 -9
  52. package/dist/src/entities/country/index.js.map +1 -1
  53. package/dist/src/entities/currency/index.js +2 -9
  54. package/dist/src/entities/currency/index.js.map +1 -1
  55. package/dist/src/entities/folder/index.js +2 -394
  56. package/dist/src/entities/folder/index.js.map +2 -2
  57. package/dist/src/entities/gamification/flashcard/index.js +2 -26
  58. package/dist/src/entities/gamification/flashcard/index.js.map +1 -1
  59. package/dist/src/entities/gamification/index.js +2 -9
  60. package/dist/src/entities/gamification/index.js.map +1 -1
  61. package/dist/src/entities/gamification/mcq/index.js +2 -36
  62. package/dist/src/entities/gamification/mcq/index.js.map +1 -1
  63. package/dist/src/entities/image/index.js +2 -31
  64. package/dist/src/entities/image/index.js.map +1 -1
  65. package/dist/src/entities/medecine/index.js +2 -13
  66. package/dist/src/entities/medecine/index.js.map +1 -1
  67. package/dist/src/entities/payment/index.js +2 -23
  68. package/dist/src/entities/payment/index.js.map +1 -1
  69. package/dist/src/entities/user/index.js +2 -30
  70. package/dist/src/entities/user/index.js.map +1 -1
  71. package/dist/src/entities/video/index.js +2 -34
  72. package/dist/src/entities/video/index.js.map +1 -1
  73. package/dist/src/migrations/book/index.js +137 -541
  74. package/dist/src/migrations/book/index.js.map +2 -2
  75. package/dist/src/migrations/common/index.js +14 -63
  76. package/dist/src/migrations/common/index.js.map +2 -2
  77. package/dist/src/migrations/country/index.js +13 -48
  78. package/dist/src/migrations/country/index.js.map +2 -2
  79. package/dist/src/migrations/currency/index.js +14 -50
  80. package/dist/src/migrations/currency/index.js.map +2 -2
  81. package/dist/src/migrations/folder/index.js +104 -426
  82. package/dist/src/migrations/folder/index.js.map +2 -2
  83. package/dist/src/migrations/gamification/flashcard/index.js +96 -356
  84. package/dist/src/migrations/gamification/flashcard/index.js.map +2 -2
  85. package/dist/src/migrations/gamification/index.js +2 -8
  86. package/dist/src/migrations/gamification/index.js.map +1 -1
  87. package/dist/src/migrations/gamification/mcq/index.js +139 -553
  88. package/dist/src/migrations/gamification/mcq/index.js.map +2 -2
  89. package/dist/src/migrations/image/index.js +85 -353
  90. package/dist/src/migrations/image/index.js.map +2 -2
  91. package/dist/src/migrations/medecine/index.js +36 -132
  92. package/dist/src/migrations/medecine/index.js.map +2 -2
  93. package/dist/src/migrations/payment/index.js +94 -339
  94. package/dist/src/migrations/payment/index.js.map +2 -2
  95. package/dist/src/migrations/user/index.js +39 -331
  96. package/dist/src/migrations/user/index.js.map +2 -2
  97. package/dist/src/migrations/video/index.js +17 -345
  98. package/dist/src/migrations/video/index.js.map +2 -2
  99. package/dist/src/repositories/book/index.js +2 -997
  100. package/dist/src/repositories/book/index.js.map +2 -2
  101. package/dist/src/repositories/common/index.js +2 -439
  102. package/dist/src/repositories/common/index.js.map +2 -2
  103. package/dist/src/repositories/country/index.js +2 -89
  104. package/dist/src/repositories/country/index.js.map +2 -2
  105. package/dist/src/repositories/currency/index.js +2 -89
  106. package/dist/src/repositories/currency/index.js.map +2 -2
  107. package/dist/src/repositories/gamification/flashcard/index.js +2 -632
  108. package/dist/src/repositories/gamification/flashcard/index.js.map +2 -2
  109. package/dist/src/repositories/gamification/index.js +2 -160
  110. package/dist/src/repositories/gamification/index.js.map +2 -2
  111. package/dist/src/repositories/gamification/mcq/index.js +2 -1017
  112. package/dist/src/repositories/gamification/mcq/index.js.map +2 -2
  113. package/dist/src/repositories/image/index.js +2 -800
  114. package/dist/src/repositories/image/index.js.map +2 -2
  115. package/dist/src/repositories/medecine/index.js +2 -243
  116. package/dist/src/repositories/medecine/index.js.map +2 -2
  117. package/dist/src/repositories/payment/index.js +2 -560
  118. package/dist/src/repositories/payment/index.js.map +2 -2
  119. package/dist/src/repositories/user/index.js +2 -999
  120. package/dist/src/repositories/user/index.js.map +2 -2
  121. package/dist/src/repositories/video/index.js +2 -975
  122. package/dist/src/repositories/video/index.js.map +2 -2
  123. package/package.json +21 -21
  124. package/dist/shared/chunk-0swb1h0m.js +0 -51
  125. package/dist/shared/chunk-2wdazj26.js +0 -371
  126. package/dist/shared/chunk-6m3p1ht9.js +0 -606
  127. package/dist/shared/chunk-bkdccdhn.js +0 -105
  128. package/dist/shared/chunk-chan1evn.js +0 -72
  129. package/dist/shared/chunk-cv6xa6qy.js +0 -621
  130. package/dist/shared/chunk-cwxhwya1.js +0 -548
  131. package/dist/shared/chunk-efmap3y3.js +0 -345
  132. package/dist/shared/chunk-hkfj9j6w.js +0 -30
  133. package/dist/shared/chunk-m4mpkr4n.js +0 -34
  134. package/dist/shared/chunk-m9wkjs7v.js +0 -639
  135. package/dist/shared/chunk-mssxq87m.js +0 -195
  136. package/dist/shared/chunk-p12g6e7b.js +0 -38
  137. package/dist/shared/chunk-qbn9p4vj.js +0 -835
  138. package/dist/shared/chunk-r9hsk9fk.js +0 -20
  139. package/dist/shared/chunk-sk8z5zmk.js +0 -112
  140. package/dist/shared/chunk-tqd6ek7s.js +0 -86
  141. package/dist/shared/chunk-wg7xcq50.js +0 -38
@@ -1,22 +1,5 @@
1
1
  // @bun
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`
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`
20
3
  CREATE TABLE IF NOT EXISTS mcq_questions (
21
4
  id VARCHAR(25) PRIMARY KEY,
22
5
  question_number INT NOT NULL,
@@ -38,8 +21,7 @@ class Migration20251225180910446 {
38
21
  deleted_at TIMESTAMPTZ,
39
22
  CONSTRAINT fk_mcq_questions_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
40
23
  )
41
- `;
42
- await tx`
24
+ `,await h`
43
25
  CREATE TABLE IF NOT EXISTS mcq_questions_tags (
44
26
  question_id VARCHAR(25) NOT NULL,
45
27
  tag_id VARCHAR(25) NOT NULL,
@@ -47,72 +29,35 @@ class Migration20251225180910446 {
47
29
  CONSTRAINT fk_mcq_questions_tags_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE,
48
30
  CONSTRAINT fk_mcq_questions_tags_tag FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
49
31
  )
50
- `;
51
- await tx`
32
+ `,await h`
52
33
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_question_number ON mcq_questions(question_number)
53
- `;
54
- await tx`
34
+ `,await h`
55
35
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_context ON mcq_questions(context, context_id)
56
- `;
57
- await tx`
36
+ `,await h`
58
37
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stat_id ON mcq_questions(stat_id)
59
- `;
60
- await tx`
38
+ `,await h`
61
39
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_status_id ON mcq_questions(status_id)
62
- `;
63
- await tx`
40
+ `,await h`
64
41
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_image_id ON mcq_questions(image_id)
65
- `;
66
- await tx`
42
+ `,await h`
67
43
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_language ON mcq_questions(language)
68
- `;
69
- await tx`
44
+ `,await h`
70
45
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_deleted_at ON mcq_questions(deleted_at)
71
- `;
72
- await tx`
46
+ `,await h`
73
47
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_is_public ON mcq_questions(is_public) WHERE deleted_at IS NULL
74
- `;
75
- await tx`
48
+ `,await h`
76
49
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_created_at ON mcq_questions(created_at DESC)
77
- `;
78
- await tx`
50
+ `,await h`
79
51
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_updated_at ON mcq_questions(updated_at DESC)
80
- `;
81
- await tx`
52
+ `,await h`
82
53
  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
83
- `;
84
- await tx`
54
+ `,await h`
85
55
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_tags_question_id ON mcq_questions_tags(question_id)
86
- `;
87
- await tx`
56
+ `,await h`
88
57
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_tags_tag_id ON mcq_questions_tags(tag_id)
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`
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`
113
59
  CREATE TYPE mcq_choice_letter AS ENUM ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J')
114
- `;
115
- await tx`
60
+ `,await h`
116
61
  CREATE TABLE IF NOT EXISTS mcq_question_choices (
117
62
  id VARCHAR(25) PRIMARY KEY,
118
63
  letter mcq_choice_letter NOT NULL,
@@ -132,65 +77,32 @@ class Migration20251225180910449 {
132
77
  deleted_at TIMESTAMPTZ,
133
78
  CONSTRAINT fk_mcq_question_choices_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
134
79
  )
135
- `;
136
- await tx`
80
+ `,await h`
137
81
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_question_id ON mcq_question_choices(question_id)
138
- `;
139
- await tx`
82
+ `,await h`
140
83
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_letter ON mcq_question_choices(letter)
141
- `;
142
- await tx`
84
+ `,await h`
143
85
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_is_correct ON mcq_question_choices(is_correct)
144
- `;
145
- await tx`
86
+ `,await h`
146
87
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_language ON mcq_question_choices(language)
147
- `;
148
- await tx`
88
+ `,await h`
149
89
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_deleted_at ON mcq_question_choices(deleted_at)
150
- `;
151
- await tx`
90
+ `,await h`
152
91
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_is_public ON mcq_question_choices(is_public) WHERE deleted_at IS NULL
153
- `;
154
- await tx`
92
+ `,await h`
155
93
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_created_at ON mcq_question_choices(created_at DESC)
156
- `;
157
- await tx`
94
+ `,await h`
158
95
  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
159
- `;
160
- await tx`
96
+ `,await h`
161
97
  CREATE INDEX IF NOT EXISTS idx_mcq_question_choices_question_letter ON mcq_question_choices(question_id, letter)
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`
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`
185
99
  CREATE TYPE mcq_session_status AS ENUM ('DRAFT', 'IN_PROGRESS', 'PAUSED', 'COMPLETED', 'CANCELLED')
186
- `;
187
- await tx`
100
+ `,await h`
188
101
  CREATE TYPE session_type AS ENUM (
189
102
  'TRAINING', 'PRACTICE', 'SIMULATION', 'QUIZ',
190
103
  'CHALLENGE', 'TOURNAMENT', 'REVIEW', 'DIAGNOSTIC', 'SPEED_TEST'
191
104
  )
192
- `;
193
- await tx`
105
+ `,await h`
194
106
  CREATE TABLE IF NOT EXISTS mcq_sessions (
195
107
  id VARCHAR(25) PRIMARY KEY,
196
108
  name VARCHAR(500) NOT NULL,
@@ -219,8 +131,7 @@ class Migration20251225180910451 {
219
131
  deleted_at TIMESTAMPTZ,
220
132
  CONSTRAINT fk_mcq_sessions_level FOREIGN KEY (level_id) REFERENCES levels(id) ON DELETE RESTRICT
221
133
  )
222
- `;
223
- await tx`
134
+ `,await h`
224
135
  CREATE TABLE IF NOT EXISTS mcq_sessions_questions (
225
136
  session_id VARCHAR(25) NOT NULL,
226
137
  question_id VARCHAR(25) NOT NULL,
@@ -228,83 +139,41 @@ class Migration20251225180910451 {
228
139
  CONSTRAINT fk_mcq_sessions_questions_session FOREIGN KEY (session_id) REFERENCES mcq_sessions(id) ON DELETE CASCADE,
229
140
  CONSTRAINT fk_mcq_sessions_questions_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
230
141
  )
231
- `;
232
- await tx`
142
+ `,await h`
233
143
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_name ON mcq_sessions(name)
234
- `;
235
- await tx`
144
+ `,await h`
236
145
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_status ON mcq_sessions(status)
237
- `;
238
- await tx`
146
+ `,await h`
239
147
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_type ON mcq_sessions(type)
240
- `;
241
- await tx`
148
+ `,await h`
242
149
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_level_id ON mcq_sessions(level_id)
243
- `;
244
- await tx`
150
+ `,await h`
245
151
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_score ON mcq_sessions(score DESC)
246
- `;
247
- await tx`
152
+ `,await h`
248
153
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_started_at ON mcq_sessions(started_at DESC)
249
- `;
250
- await tx`
154
+ `,await h`
251
155
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_completed_at ON mcq_sessions(completed_at DESC)
252
- `;
253
- await tx`
156
+ `,await h`
254
157
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_language ON mcq_sessions(language)
255
- `;
256
- await tx`
158
+ `,await h`
257
159
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_deleted_at ON mcq_sessions(deleted_at)
258
- `;
259
- await tx`
160
+ `,await h`
260
161
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_is_public ON mcq_sessions(is_public) WHERE deleted_at IS NULL
261
- `;
262
- await tx`
162
+ `,await h`
263
163
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_created_at ON mcq_sessions(created_at DESC)
264
- `;
265
- await tx`
164
+ `,await h`
266
165
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_updated_at ON mcq_sessions(updated_at DESC)
267
- `;
268
- await tx`
166
+ `,await h`
269
167
  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
270
- `;
271
- await tx`
168
+ `,await h`
272
169
  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
273
- `;
274
- await tx`
170
+ `,await h`
275
171
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_questions_session_id ON mcq_sessions_questions(session_id)
276
- `;
277
- await tx`
172
+ `,await h`
278
173
  CREATE INDEX IF NOT EXISTS idx_mcq_sessions_questions_question_id ON mcq_sessions_questions(question_id)
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`
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`
305
175
  CREATE TYPE answer_state AS ENUM ('UNANSWERED', 'CORRECT', 'INCORRECT', 'PARTIAL', 'SKIPPED')
306
- `;
307
- await tx`
176
+ `,await h`
308
177
  CREATE TABLE IF NOT EXISTS mcq_session_questions (
309
178
  id VARCHAR(25) PRIMARY KEY,
310
179
  session_id VARCHAR(25) NOT NULL,
@@ -327,8 +196,7 @@ class Migration20251225180910453 {
327
196
  CONSTRAINT fk_mcq_session_questions_session FOREIGN KEY (session_id) REFERENCES mcq_sessions(id) ON DELETE CASCADE,
328
197
  CONSTRAINT fk_mcq_session_questions_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE RESTRICT
329
198
  )
330
- `;
331
- await tx`
199
+ `,await h`
332
200
  CREATE TABLE IF NOT EXISTS mcq_session_questions_selected_choices (
333
201
  session_question_id VARCHAR(25) NOT NULL,
334
202
  choice_id VARCHAR(25) NOT NULL,
@@ -336,73 +204,35 @@ class Migration20251225180910453 {
336
204
  CONSTRAINT fk_mcq_session_questions_selected_choices_session_question FOREIGN KEY (session_question_id) REFERENCES mcq_session_questions(id) ON DELETE CASCADE,
337
205
  CONSTRAINT fk_mcq_session_questions_selected_choices_choice FOREIGN KEY (choice_id) REFERENCES mcq_question_choices(id) ON DELETE CASCADE
338
206
  )
339
- `;
340
- await tx`
207
+ `,await h`
341
208
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_session_id ON mcq_session_questions(session_id)
342
- `;
343
- await tx`
209
+ `,await h`
344
210
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_question_id ON mcq_session_questions(question_id)
345
- `;
346
- await tx`
211
+ `,await h`
347
212
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_question_number ON mcq_session_questions(question_number)
348
- `;
349
- await tx`
213
+ `,await h`
350
214
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_state ON mcq_session_questions(state)
351
- `;
352
- await tx`
215
+ `,await h`
353
216
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_context ON mcq_session_questions(context, context_id)
354
- `;
355
- await tx`
217
+ `,await h`
356
218
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_score ON mcq_session_questions(score DESC)
357
- `;
358
- await tx`
219
+ `,await h`
359
220
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_language ON mcq_session_questions(language)
360
- `;
361
- await tx`
221
+ `,await h`
362
222
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_deleted_at ON mcq_session_questions(deleted_at)
363
- `;
364
- await tx`
223
+ `,await h`
365
224
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_is_public ON mcq_session_questions(is_public) WHERE deleted_at IS NULL
366
- `;
367
- await tx`
225
+ `,await h`
368
226
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_created_at ON mcq_session_questions(created_at DESC)
369
- `;
370
- await tx`
227
+ `,await h`
371
228
  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
372
- `;
373
- await tx`
229
+ `,await h`
374
230
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_session_question ON mcq_session_questions(session_id, question_number)
375
- `;
376
- await tx`
231
+ `,await h`
377
232
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_selected_choices_session_question_id ON mcq_session_questions_selected_choices(session_question_id)
378
- `;
379
- await tx`
233
+ `,await h`
380
234
  CREATE INDEX IF NOT EXISTS idx_mcq_session_questions_selected_choices_choice_id ON mcq_session_questions_selected_choices(choice_id)
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`
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`
406
236
  CREATE TABLE IF NOT EXISTS mcq_questions_stats (
407
237
  id VARCHAR(25) PRIMARY KEY,
408
238
  question_id VARCHAR(25),
@@ -425,55 +255,25 @@ class Migration20251225180910455 {
425
255
  deleted_at TIMESTAMPTZ,
426
256
  CONSTRAINT fk_mcq_questions_stats_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
427
257
  )
428
- `;
429
- await tx`
258
+ `,await h`
430
259
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_question_id ON mcq_questions_stats(question_id)
431
- `;
432
- await tx`
260
+ `,await h`
433
261
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_likes_count ON mcq_questions_stats(likes_count DESC)
434
- `;
435
- await tx`
262
+ `,await h`
436
263
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_views_count ON mcq_questions_stats(views_count DESC)
437
- `;
438
- await tx`
264
+ `,await h`
439
265
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_language ON mcq_questions_stats(language)
440
- `;
441
- await tx`
266
+ `,await h`
442
267
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_deleted_at ON mcq_questions_stats(deleted_at)
443
- `;
444
- await tx`
268
+ `,await h`
445
269
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_is_public ON mcq_questions_stats(is_public) WHERE deleted_at IS NULL
446
- `;
447
- await tx`
270
+ `,await h`
448
271
  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
449
- `;
450
- await tx`
272
+ `,await h`
451
273
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_stats_created_at ON mcq_questions_stats(created_at DESC)
452
- `;
453
- await tx`
274
+ `,await h`
454
275
  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
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`
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`
477
277
  CREATE TABLE IF NOT EXISTS mcq_questions_comments (
478
278
  id VARCHAR(25) PRIMARY KEY,
479
279
  question_id VARCHAR(25),
@@ -493,52 +293,23 @@ class Migration20251225180910458 {
493
293
  deleted_at TIMESTAMPTZ,
494
294
  CONSTRAINT fk_mcq_questions_comments_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
495
295
  )
496
- `;
497
- await tx`
296
+ `,await h`
498
297
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_question_id ON mcq_questions_comments(question_id)
499
- `;
500
- await tx`
298
+ `,await h`
501
299
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_commented_by_id ON mcq_questions_comments(commented_by_id)
502
- `;
503
- await tx`
300
+ `,await h`
504
301
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_parent_comment_id ON mcq_questions_comments(parent_comment_id)
505
- `;
506
- await tx`
302
+ `,await h`
507
303
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_language ON mcq_questions_comments(language)
508
- `;
509
- await tx`
304
+ `,await h`
510
305
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_deleted_at ON mcq_questions_comments(deleted_at)
511
- `;
512
- await tx`
306
+ `,await h`
513
307
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_is_public ON mcq_questions_comments(is_public) WHERE deleted_at IS NULL
514
- `;
515
- await tx`
308
+ `,await h`
516
309
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_comments_created_at ON mcq_questions_comments(created_at DESC)
517
- `;
518
- await tx`
310
+ `,await h`
519
311
  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
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`
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`
542
313
  CREATE TABLE IF NOT EXISTS mcq_questions_liked (
543
314
  id VARCHAR(25) PRIMARY KEY,
544
315
  question_id VARCHAR(25),
@@ -556,52 +327,23 @@ class Migration20251225180910460 {
556
327
  deleted_at TIMESTAMPTZ,
557
328
  CONSTRAINT fk_mcq_questions_liked_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
558
329
  )
559
- `;
560
- await tx`
330
+ `,await h`
561
331
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_question_id ON mcq_questions_liked(question_id)
562
- `;
563
- await tx`
332
+ `,await h`
564
333
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_liked_by_id ON mcq_questions_liked(liked_by_id)
565
- `;
566
- await tx`
334
+ `,await h`
567
335
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_language ON mcq_questions_liked(language)
568
- `;
569
- await tx`
336
+ `,await h`
570
337
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_deleted_at ON mcq_questions_liked(deleted_at)
571
- `;
572
- await tx`
338
+ `,await h`
573
339
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_is_public ON mcq_questions_liked(is_public) WHERE deleted_at IS NULL
574
- `;
575
- await tx`
340
+ `,await h`
576
341
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_liked_created_at ON mcq_questions_liked(created_at DESC)
577
- `;
578
- await tx`
342
+ `,await h`
579
343
  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
580
- `;
581
- await tx`
344
+ `,await h`
582
345
  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
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`
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`
605
347
  CREATE TABLE IF NOT EXISTS mcq_questions_disliked (
606
348
  id VARCHAR(25) PRIMARY KEY,
607
349
  question_id VARCHAR(25),
@@ -619,52 +361,23 @@ class Migration20251225180910462 {
619
361
  deleted_at TIMESTAMPTZ,
620
362
  CONSTRAINT fk_mcq_questions_disliked_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
621
363
  )
622
- `;
623
- await tx`
364
+ `,await h`
624
365
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_question_id ON mcq_questions_disliked(question_id)
625
- `;
626
- await tx`
366
+ `,await h`
627
367
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_disliked_by_id ON mcq_questions_disliked(disliked_by_id)
628
- `;
629
- await tx`
368
+ `,await h`
630
369
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_language ON mcq_questions_disliked(language)
631
- `;
632
- await tx`
370
+ `,await h`
633
371
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_deleted_at ON mcq_questions_disliked(deleted_at)
634
- `;
635
- await tx`
372
+ `,await h`
636
373
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_is_public ON mcq_questions_disliked(is_public) WHERE deleted_at IS NULL
637
- `;
638
- await tx`
374
+ `,await h`
639
375
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_disliked_created_at ON mcq_questions_disliked(created_at DESC)
640
- `;
641
- await tx`
376
+ `,await h`
642
377
  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
643
- `;
644
- await tx`
378
+ `,await h`
645
379
  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
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`
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`
668
381
  CREATE TABLE IF NOT EXISTS mcq_questions_viewed (
669
382
  id VARCHAR(25) PRIMARY KEY,
670
383
  question_id VARCHAR(25),
@@ -682,49 +395,21 @@ class Migration20251225180910465 {
682
395
  deleted_at TIMESTAMPTZ,
683
396
  CONSTRAINT fk_mcq_questions_viewed_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
684
397
  )
685
- `;
686
- await tx`
398
+ `,await h`
687
399
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_question_id ON mcq_questions_viewed(question_id)
688
- `;
689
- await tx`
400
+ `,await h`
690
401
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_viewed_by_id ON mcq_questions_viewed(viewed_by_id)
691
- `;
692
- await tx`
402
+ `,await h`
693
403
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_language ON mcq_questions_viewed(language)
694
- `;
695
- await tx`
404
+ `,await h`
696
405
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_deleted_at ON mcq_questions_viewed(deleted_at)
697
- `;
698
- await tx`
406
+ `,await h`
699
407
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_is_public ON mcq_questions_viewed(is_public) WHERE deleted_at IS NULL
700
- `;
701
- await tx`
408
+ `,await h`
702
409
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_viewed_created_at ON mcq_questions_viewed(created_at DESC)
703
- `;
704
- await tx`
410
+ `,await h`
705
411
  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
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`
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`
728
413
  CREATE TABLE IF NOT EXISTS mcq_questions_saved (
729
414
  id VARCHAR(25) PRIMARY KEY,
730
415
  question_id VARCHAR(25),
@@ -742,52 +427,23 @@ class Migration20251225180910467 {
742
427
  deleted_at TIMESTAMPTZ,
743
428
  CONSTRAINT fk_mcq_questions_saved_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
744
429
  )
745
- `;
746
- await tx`
430
+ `,await h`
747
431
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_question_id ON mcq_questions_saved(question_id)
748
- `;
749
- await tx`
432
+ `,await h`
750
433
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_saved_by_id ON mcq_questions_saved(saved_by_id)
751
- `;
752
- await tx`
434
+ `,await h`
753
435
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_language ON mcq_questions_saved(language)
754
- `;
755
- await tx`
436
+ `,await h`
756
437
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_deleted_at ON mcq_questions_saved(deleted_at)
757
- `;
758
- await tx`
438
+ `,await h`
759
439
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_is_public ON mcq_questions_saved(is_public) WHERE deleted_at IS NULL
760
- `;
761
- await tx`
440
+ `,await h`
762
441
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_saved_created_at ON mcq_questions_saved(created_at DESC)
763
- `;
764
- await tx`
442
+ `,await h`
765
443
  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
766
- `;
767
- await tx`
444
+ `,await h`
768
445
  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
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`
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`
791
447
  CREATE TABLE IF NOT EXISTS mcq_questions_shared (
792
448
  id VARCHAR(25) PRIMARY KEY,
793
449
  question_id VARCHAR(25),
@@ -807,55 +463,25 @@ class Migration20251225180910469 {
807
463
  deleted_at TIMESTAMPTZ,
808
464
  CONSTRAINT fk_mcq_questions_shared_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE
809
465
  )
810
- `;
811
- await tx`
466
+ `,await h`
812
467
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_question_id ON mcq_questions_shared(question_id)
813
- `;
814
- await tx`
468
+ `,await h`
815
469
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_shared_by_id ON mcq_questions_shared(shared_by_id)
816
- `;
817
- await tx`
470
+ `,await h`
818
471
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_expires_at ON mcq_questions_shared(expires_at)
819
- `;
820
- await tx`
472
+ `,await h`
821
473
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_language ON mcq_questions_shared(language)
822
- `;
823
- await tx`
474
+ `,await h`
824
475
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_deleted_at ON mcq_questions_shared(deleted_at)
825
- `;
826
- await tx`
476
+ `,await h`
827
477
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_is_public ON mcq_questions_shared(is_public) WHERE deleted_at IS NULL
828
- `;
829
- await tx`
478
+ `,await h`
830
479
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_shared_created_at ON mcq_questions_shared(created_at DESC)
831
- `;
832
- await tx`
480
+ `,await h`
833
481
  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
834
- `;
835
- await tx`
482
+ `,await h`
836
483
  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)
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`
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`
859
485
  CREATE TABLE IF NOT EXISTS mcq_questions_reports (
860
486
  id VARCHAR(25) PRIMARY KEY,
861
487
  question_id VARCHAR(25),
@@ -877,64 +503,24 @@ class Migration20251225180910472 {
877
503
  CONSTRAINT fk_mcq_questions_reports_question FOREIGN KEY (question_id) REFERENCES mcq_questions(id) ON DELETE CASCADE,
878
504
  CONSTRAINT fk_mcq_questions_reports_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
879
505
  )
880
- `;
881
- await tx`
506
+ `,await h`
882
507
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_question_id ON mcq_questions_reports(question_id)
883
- `;
884
- await tx`
508
+ `,await h`
885
509
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_reported_by_id ON mcq_questions_reports(reported_by_id)
886
- `;
887
- await tx`
510
+ `,await h`
888
511
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_status_id ON mcq_questions_reports(status_id)
889
- `;
890
- await tx`
512
+ `,await h`
891
513
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_reason ON mcq_questions_reports(reason)
892
- `;
893
- await tx`
514
+ `,await h`
894
515
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_language ON mcq_questions_reports(language)
895
- `;
896
- await tx`
516
+ `,await h`
897
517
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_deleted_at ON mcq_questions_reports(deleted_at)
898
- `;
899
- await tx`
518
+ `,await h`
900
519
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_is_public ON mcq_questions_reports(is_public) WHERE deleted_at IS NULL
901
- `;
902
- await tx`
520
+ `,await h`
903
521
  CREATE INDEX IF NOT EXISTS idx_mcq_questions_reports_created_at ON mcq_questions_reports(created_at DESC)
904
- `;
905
- await tx`
522
+ `,await h`
906
523
  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
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
- };
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};
939
525
 
940
- //# debugId=7CA8F2F04D78139864756E2164756E21
526
+ //# debugId=9A5AB86DE5CC468A64756E2164756E21