@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.
- package/dist/shared/chunk-19qhst35.js +5 -0
- package/dist/shared/{chunk-tqd6ek7s.js.map → chunk-19qhst35.js.map} +2 -2
- package/dist/shared/{chunk-trhrh4e1.js → chunk-31y260d6.js} +24 -89
- package/dist/shared/{chunk-trhrh4e1.js.map → chunk-31y260d6.js.map} +2 -2
- package/dist/shared/chunk-59vwmfpm.js +5 -0
- package/dist/shared/{chunk-r9hsk9fk.js.map → chunk-59vwmfpm.js.map} +1 -1
- package/dist/shared/chunk-5tnqjb3n.js +5 -0
- package/dist/shared/{chunk-2wdazj26.js.map → chunk-5tnqjb3n.js.map} +2 -2
- package/dist/shared/chunk-5ybg5hda.js +5 -0
- package/dist/shared/{chunk-m4mpkr4n.js.map → chunk-5ybg5hda.js.map} +2 -2
- package/dist/shared/chunk-6jnj2pfx.js +5 -0
- package/dist/shared/{chunk-p12g6e7b.js.map → chunk-6jnj2pfx.js.map} +2 -2
- package/dist/shared/chunk-6kdkyjbn.js +5 -0
- package/dist/shared/{chunk-mssxq87m.js.map → chunk-6kdkyjbn.js.map} +2 -2
- package/dist/shared/{chunk-jap9t59k.js → chunk-aj0aak90.js} +14 -52
- package/dist/shared/{chunk-jap9t59k.js.map → chunk-aj0aak90.js.map} +2 -2
- package/dist/shared/chunk-e51ktjsq.js +5 -0
- package/dist/shared/{chunk-efmap3y3.js.map → chunk-e51ktjsq.js.map} +2 -2
- package/dist/shared/{chunk-yszvxhf3.js → chunk-jr0xys18.js} +11 -41
- package/dist/shared/{chunk-yszvxhf3.js.map → chunk-jr0xys18.js.map} +2 -2
- package/dist/shared/chunk-kw4t1san.js +5 -0
- package/dist/shared/{chunk-m9wkjs7v.js.map → chunk-kw4t1san.js.map} +2 -2
- package/dist/shared/chunk-nfv9ce7v.js +5 -0
- package/dist/shared/{chunk-qbn9p4vj.js.map → chunk-nfv9ce7v.js.map} +2 -2
- package/dist/shared/chunk-p22keb3y.js +5 -0
- package/dist/shared/{chunk-bkdccdhn.js.map → chunk-p22keb3y.js.map} +2 -2
- package/dist/shared/chunk-pbns711f.js +5 -0
- package/dist/shared/{chunk-hkfj9j6w.js.map → chunk-pbns711f.js.map} +2 -2
- package/dist/shared/{chunk-6vmvyg0q.js → chunk-qrs0g3m9.js} +17 -58
- package/dist/shared/{chunk-6vmvyg0q.js.map → chunk-qrs0g3m9.js.map} +2 -2
- package/dist/shared/{chunk-eets3mef.js → chunk-qyf32qsz.js} +22 -75
- package/dist/shared/{chunk-eets3mef.js.map → chunk-qyf32qsz.js.map} +2 -2
- package/dist/shared/chunk-t1jad451.js +5 -0
- package/dist/shared/{chunk-cv6xa6qy.js.map → chunk-t1jad451.js.map} +2 -2
- package/dist/shared/chunk-t5cy307m.js +5 -0
- package/dist/shared/{chunk-wg7xcq50.js.map → chunk-t5cy307m.js.map} +2 -2
- package/dist/shared/chunk-x2d798hg.js +5 -0
- package/dist/shared/{chunk-sk8z5zmk.js.map → chunk-x2d798hg.js.map} +2 -2
- package/dist/shared/chunk-x3pmm3na.js +5 -0
- package/dist/shared/{chunk-cwxhwya1.js.map → chunk-x3pmm3na.js.map} +2 -2
- package/dist/shared/chunk-xrqhqgen.js +5 -0
- package/dist/shared/{chunk-chan1evn.js.map → chunk-xrqhqgen.js.map} +2 -2
- package/dist/shared/chunk-xwe8m6av.js +5 -0
- package/dist/shared/{chunk-0swb1h0m.js.map → chunk-xwe8m6av.js.map} +2 -2
- package/dist/shared/chunk-yrwsqc6r.js +5 -0
- package/dist/shared/{chunk-6m3p1ht9.js.map → chunk-yrwsqc6r.js.map} +2 -2
- package/dist/src/entities/book/index.js +2 -34
- package/dist/src/entities/book/index.js.map +1 -1
- package/dist/src/entities/common/index.js +2 -26
- package/dist/src/entities/common/index.js.map +1 -1
- package/dist/src/entities/country/index.js +2 -9
- package/dist/src/entities/country/index.js.map +1 -1
- package/dist/src/entities/currency/index.js +2 -9
- package/dist/src/entities/currency/index.js.map +1 -1
- package/dist/src/entities/folder/index.js +2 -394
- package/dist/src/entities/folder/index.js.map +2 -2
- package/dist/src/entities/gamification/flashcard/index.js +2 -26
- package/dist/src/entities/gamification/flashcard/index.js.map +1 -1
- package/dist/src/entities/gamification/index.js +2 -9
- package/dist/src/entities/gamification/index.js.map +1 -1
- package/dist/src/entities/gamification/mcq/index.js +2 -36
- package/dist/src/entities/gamification/mcq/index.js.map +1 -1
- package/dist/src/entities/image/index.js +2 -31
- package/dist/src/entities/image/index.js.map +1 -1
- package/dist/src/entities/medecine/index.js +2 -13
- package/dist/src/entities/medecine/index.js.map +1 -1
- package/dist/src/entities/payment/index.js +2 -23
- package/dist/src/entities/payment/index.js.map +1 -1
- package/dist/src/entities/user/index.js +2 -30
- package/dist/src/entities/user/index.js.map +1 -1
- package/dist/src/entities/video/index.js +2 -34
- package/dist/src/entities/video/index.js.map +1 -1
- package/dist/src/migrations/book/index.js +137 -541
- package/dist/src/migrations/book/index.js.map +2 -2
- package/dist/src/migrations/common/index.js +14 -63
- package/dist/src/migrations/common/index.js.map +2 -2
- package/dist/src/migrations/country/index.js +13 -48
- package/dist/src/migrations/country/index.js.map +2 -2
- package/dist/src/migrations/currency/index.js +14 -50
- package/dist/src/migrations/currency/index.js.map +2 -2
- package/dist/src/migrations/folder/index.js +104 -426
- package/dist/src/migrations/folder/index.js.map +2 -2
- package/dist/src/migrations/gamification/flashcard/index.js +96 -356
- package/dist/src/migrations/gamification/flashcard/index.js.map +2 -2
- package/dist/src/migrations/gamification/index.js +2 -8
- package/dist/src/migrations/gamification/index.js.map +1 -1
- package/dist/src/migrations/gamification/mcq/index.js +139 -553
- package/dist/src/migrations/gamification/mcq/index.js.map +2 -2
- package/dist/src/migrations/image/index.js +85 -353
- package/dist/src/migrations/image/index.js.map +2 -2
- package/dist/src/migrations/medecine/index.js +36 -132
- package/dist/src/migrations/medecine/index.js.map +2 -2
- package/dist/src/migrations/payment/index.js +94 -339
- package/dist/src/migrations/payment/index.js.map +2 -2
- package/dist/src/migrations/user/index.js +39 -331
- package/dist/src/migrations/user/index.js.map +2 -2
- package/dist/src/migrations/video/index.js +17 -345
- package/dist/src/migrations/video/index.js.map +2 -2
- package/dist/src/repositories/book/index.js +2 -997
- package/dist/src/repositories/book/index.js.map +2 -2
- package/dist/src/repositories/common/index.js +2 -439
- package/dist/src/repositories/common/index.js.map +2 -2
- package/dist/src/repositories/country/index.js +2 -89
- package/dist/src/repositories/country/index.js.map +2 -2
- package/dist/src/repositories/currency/index.js +2 -89
- package/dist/src/repositories/currency/index.js.map +2 -2
- package/dist/src/repositories/gamification/flashcard/index.js +2 -632
- package/dist/src/repositories/gamification/flashcard/index.js.map +2 -2
- package/dist/src/repositories/gamification/index.js +2 -160
- package/dist/src/repositories/gamification/index.js.map +2 -2
- package/dist/src/repositories/gamification/mcq/index.js +2 -1017
- package/dist/src/repositories/gamification/mcq/index.js.map +2 -2
- package/dist/src/repositories/image/index.js +2 -800
- package/dist/src/repositories/image/index.js.map +2 -2
- package/dist/src/repositories/medecine/index.js +2 -243
- package/dist/src/repositories/medecine/index.js.map +2 -2
- package/dist/src/repositories/payment/index.js +2 -560
- package/dist/src/repositories/payment/index.js.map +2 -2
- package/dist/src/repositories/user/index.js +2 -999
- package/dist/src/repositories/user/index.js.map +2 -2
- package/dist/src/repositories/video/index.js +2 -975
- package/dist/src/repositories/video/index.js.map +2 -2
- package/package.json +21 -21
- package/dist/shared/chunk-0swb1h0m.js +0 -51
- package/dist/shared/chunk-2wdazj26.js +0 -371
- package/dist/shared/chunk-6m3p1ht9.js +0 -606
- package/dist/shared/chunk-bkdccdhn.js +0 -105
- package/dist/shared/chunk-chan1evn.js +0 -72
- package/dist/shared/chunk-cv6xa6qy.js +0 -621
- package/dist/shared/chunk-cwxhwya1.js +0 -548
- package/dist/shared/chunk-efmap3y3.js +0 -345
- package/dist/shared/chunk-hkfj9j6w.js +0 -30
- package/dist/shared/chunk-m4mpkr4n.js +0 -34
- package/dist/shared/chunk-m9wkjs7v.js +0 -639
- package/dist/shared/chunk-mssxq87m.js +0 -195
- package/dist/shared/chunk-p12g6e7b.js +0 -38
- package/dist/shared/chunk-qbn9p4vj.js +0 -835
- package/dist/shared/chunk-r9hsk9fk.js +0 -20
- package/dist/shared/chunk-sk8z5zmk.js +0 -112
- package/dist/shared/chunk-tqd6ek7s.js +0 -86
- package/dist/shared/chunk-wg7xcq50.js +0 -38
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
Migration20251225173352645
|
|
4
|
-
} from "../../../shared/chunk-6vmvyg0q.js";
|
|
5
|
-
import {
|
|
6
|
-
Migration20251225173351645
|
|
7
|
-
} from "../../../shared/chunk-jap9t59k.js";
|
|
8
|
-
import {
|
|
9
|
-
Migration20251225173350644
|
|
10
|
-
} from "../../../shared/chunk-trhrh4e1.js";
|
|
11
|
-
import {
|
|
12
|
-
__legacyDecorateClassTS
|
|
13
|
-
} from "../../../shared/chunk-r9hsk9fk.js";
|
|
14
|
-
|
|
15
|
-
// src/migrations/book/Migration20251225173353646.ts
|
|
16
|
-
import { decorator } from "@ooneex/migrations";
|
|
17
|
-
class Migration20251225173353646 {
|
|
18
|
-
async up(tx) {
|
|
19
|
-
await tx`
|
|
2
|
+
import{b as p}from"../../../shared/chunk-qrs0g3m9.js";import{c as O}from"../../../shared/chunk-aj0aak90.js";import{e as l}from"../../../shared/chunk-31y260d6.js";import{Ha as T}from"../../../shared/chunk-59vwmfpm.js";import{decorator as L}from"@ooneex/migrations";class _{async up(E){await E`
|
|
20
3
|
CREATE TABLE IF NOT EXISTS book_authors (
|
|
21
4
|
id VARCHAR(25) PRIMARY KEY,
|
|
22
5
|
first_name VARCHAR(100) NOT NULL,
|
|
@@ -37,56 +20,27 @@ class Migration20251225173353646 {
|
|
|
37
20
|
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
38
21
|
deleted_at TIMESTAMPTZ
|
|
39
22
|
)
|
|
40
|
-
|
|
41
|
-
await tx`
|
|
23
|
+
`,await E`
|
|
42
24
|
CREATE INDEX IF NOT EXISTS idx_book_authors_first_name ON book_authors(first_name)
|
|
43
|
-
|
|
44
|
-
await tx`
|
|
25
|
+
`,await E`
|
|
45
26
|
CREATE INDEX IF NOT EXISTS idx_book_authors_last_name ON book_authors(last_name)
|
|
46
|
-
|
|
47
|
-
await tx`
|
|
27
|
+
`,await E`
|
|
48
28
|
CREATE INDEX IF NOT EXISTS idx_book_authors_full_name ON book_authors(full_name)
|
|
49
|
-
|
|
50
|
-
await tx`
|
|
29
|
+
`,await E`
|
|
51
30
|
CREATE INDEX IF NOT EXISTS idx_book_authors_nationality ON book_authors(nationality)
|
|
52
|
-
|
|
53
|
-
await tx`
|
|
31
|
+
`,await E`
|
|
54
32
|
CREATE INDEX IF NOT EXISTS idx_book_authors_language ON book_authors(language)
|
|
55
|
-
|
|
56
|
-
await tx`
|
|
33
|
+
`,await E`
|
|
57
34
|
CREATE INDEX IF NOT EXISTS idx_book_authors_deleted_at ON book_authors(deleted_at)
|
|
58
|
-
|
|
59
|
-
await tx`
|
|
35
|
+
`,await E`
|
|
60
36
|
CREATE INDEX IF NOT EXISTS idx_book_authors_is_public ON book_authors(is_public) WHERE deleted_at IS NULL
|
|
61
|
-
|
|
62
|
-
await tx`
|
|
37
|
+
`,await E`
|
|
63
38
|
CREATE INDEX IF NOT EXISTS idx_book_authors_full_name_lower ON book_authors(LOWER(full_name)) WHERE deleted_at IS NULL
|
|
64
|
-
|
|
65
|
-
await tx`
|
|
39
|
+
`,await E`
|
|
66
40
|
CREATE INDEX IF NOT EXISTS idx_book_authors_created_at ON book_authors(created_at DESC)
|
|
67
|
-
|
|
68
|
-
await tx`
|
|
41
|
+
`,await E`
|
|
69
42
|
CREATE INDEX IF NOT EXISTS idx_book_authors_active ON book_authors(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
async down(tx) {
|
|
73
|
-
await tx`DROP TABLE IF EXISTS book_authors CASCADE`;
|
|
74
|
-
}
|
|
75
|
-
getVersion() {
|
|
76
|
-
return "20251225173353646";
|
|
77
|
-
}
|
|
78
|
-
getDependencies() {
|
|
79
|
-
return [];
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
Migration20251225173353646 = __legacyDecorateClassTS([
|
|
83
|
-
decorator.migration()
|
|
84
|
-
], Migration20251225173353646);
|
|
85
|
-
// src/migrations/book/Migration20251225173354646.ts
|
|
86
|
-
import { decorator as decorator2 } from "@ooneex/migrations";
|
|
87
|
-
class Migration20251225173354646 {
|
|
88
|
-
async up(tx) {
|
|
89
|
-
await tx`
|
|
43
|
+
`}async down(E){await E`DROP TABLE IF EXISTS book_authors CASCADE`}getVersion(){return"20251225173353646"}getDependencies(){return[]}}_=T([L.migration()],_);import{decorator as C}from"@ooneex/migrations";class s{async up(E){await E`
|
|
90
44
|
CREATE TABLE IF NOT EXISTS book_publishers (
|
|
91
45
|
id VARCHAR(25) PRIMARY KEY,
|
|
92
46
|
name VARCHAR(200) NOT NULL,
|
|
@@ -104,50 +58,23 @@ class Migration20251225173354646 {
|
|
|
104
58
|
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
105
59
|
deleted_at TIMESTAMPTZ
|
|
106
60
|
)
|
|
107
|
-
|
|
108
|
-
await tx`
|
|
61
|
+
`,await E`
|
|
109
62
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_name ON book_publishers(name)
|
|
110
|
-
|
|
111
|
-
await tx`
|
|
63
|
+
`,await E`
|
|
112
64
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_founded_year ON book_publishers(founded_year)
|
|
113
|
-
|
|
114
|
-
await tx`
|
|
65
|
+
`,await E`
|
|
115
66
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_language ON book_publishers(language)
|
|
116
|
-
|
|
117
|
-
await tx`
|
|
67
|
+
`,await E`
|
|
118
68
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_deleted_at ON book_publishers(deleted_at)
|
|
119
|
-
|
|
120
|
-
await tx`
|
|
69
|
+
`,await E`
|
|
121
70
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_is_public ON book_publishers(is_public) WHERE deleted_at IS NULL
|
|
122
|
-
|
|
123
|
-
await tx`
|
|
71
|
+
`,await E`
|
|
124
72
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_name_lower ON book_publishers(LOWER(name)) WHERE deleted_at IS NULL
|
|
125
|
-
|
|
126
|
-
await tx`
|
|
73
|
+
`,await E`
|
|
127
74
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_created_at ON book_publishers(created_at DESC)
|
|
128
|
-
|
|
129
|
-
await tx`
|
|
75
|
+
`,await E`
|
|
130
76
|
CREATE INDEX IF NOT EXISTS idx_book_publishers_active ON book_publishers(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
async down(tx) {
|
|
134
|
-
await tx`DROP TABLE IF EXISTS book_publishers CASCADE`;
|
|
135
|
-
}
|
|
136
|
-
getVersion() {
|
|
137
|
-
return "20251225173354646";
|
|
138
|
-
}
|
|
139
|
-
getDependencies() {
|
|
140
|
-
return [];
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
Migration20251225173354646 = __legacyDecorateClassTS([
|
|
144
|
-
decorator2.migration()
|
|
145
|
-
], Migration20251225173354646);
|
|
146
|
-
// src/migrations/book/Migration20251225173355647.ts
|
|
147
|
-
import { decorator as decorator3 } from "@ooneex/migrations";
|
|
148
|
-
class Migration20251225173355647 {
|
|
149
|
-
async up(tx) {
|
|
150
|
-
await tx`
|
|
77
|
+
`}async down(E){await E`DROP TABLE IF EXISTS book_publishers CASCADE`}getVersion(){return"20251225173354646"}getDependencies(){return[]}}s=T([C.migration()],s);import{decorator as X}from"@ooneex/migrations";class e{async up(E){await E`
|
|
151
78
|
CREATE TABLE IF NOT EXISTS books (
|
|
152
79
|
id VARCHAR(25) PRIMARY KEY,
|
|
153
80
|
title VARCHAR(500) NOT NULL,
|
|
@@ -185,8 +112,7 @@ class Migration20251225173355647 {
|
|
|
185
112
|
CONSTRAINT fk_books_category FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE SET NULL,
|
|
186
113
|
CONSTRAINT fk_books_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
|
|
187
114
|
)
|
|
188
|
-
|
|
189
|
-
await tx`
|
|
115
|
+
`,await E`
|
|
190
116
|
CREATE TABLE IF NOT EXISTS books_authors (
|
|
191
117
|
book_id VARCHAR(25) NOT NULL,
|
|
192
118
|
author_id VARCHAR(25) NOT NULL,
|
|
@@ -194,8 +120,7 @@ class Migration20251225173355647 {
|
|
|
194
120
|
CONSTRAINT fk_books_authors_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE,
|
|
195
121
|
CONSTRAINT fk_books_authors_author FOREIGN KEY (author_id) REFERENCES book_authors(id) ON DELETE CASCADE
|
|
196
122
|
)
|
|
197
|
-
|
|
198
|
-
await tx`
|
|
123
|
+
`,await E`
|
|
199
124
|
CREATE TABLE IF NOT EXISTS books_tags (
|
|
200
125
|
book_id VARCHAR(25) NOT NULL,
|
|
201
126
|
tag_id VARCHAR(25) NOT NULL,
|
|
@@ -203,103 +128,53 @@ class Migration20251225173355647 {
|
|
|
203
128
|
CONSTRAINT fk_books_tags_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE,
|
|
204
129
|
CONSTRAINT fk_books_tags_tag FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
|
|
205
130
|
)
|
|
206
|
-
|
|
207
|
-
await tx`
|
|
131
|
+
`,await E`
|
|
208
132
|
CREATE INDEX IF NOT EXISTS idx_books_title ON books(title)
|
|
209
|
-
|
|
210
|
-
await tx`
|
|
133
|
+
`,await E`
|
|
211
134
|
CREATE INDEX IF NOT EXISTS idx_books_isbn ON books(isbn)
|
|
212
|
-
|
|
213
|
-
await tx`
|
|
135
|
+
`,await E`
|
|
214
136
|
CREATE INDEX IF NOT EXISTS idx_books_isbn13 ON books(isbn13)
|
|
215
|
-
|
|
216
|
-
await tx`
|
|
137
|
+
`,await E`
|
|
217
138
|
CREATE INDEX IF NOT EXISTS idx_books_publisher_id ON books(publisher_id)
|
|
218
|
-
|
|
219
|
-
await tx`
|
|
139
|
+
`,await E`
|
|
220
140
|
CREATE INDEX IF NOT EXISTS idx_books_category_id ON books(category_id)
|
|
221
|
-
|
|
222
|
-
await tx`
|
|
141
|
+
`,await E`
|
|
223
142
|
CREATE INDEX IF NOT EXISTS idx_books_status_id ON books(status_id)
|
|
224
|
-
|
|
225
|
-
await tx`
|
|
143
|
+
`,await E`
|
|
226
144
|
CREATE INDEX IF NOT EXISTS idx_books_language ON books(language)
|
|
227
|
-
|
|
228
|
-
await tx`
|
|
145
|
+
`,await E`
|
|
229
146
|
CREATE INDEX IF NOT EXISTS idx_books_deleted_at ON books(deleted_at)
|
|
230
|
-
|
|
231
|
-
await tx`
|
|
147
|
+
`,await E`
|
|
232
148
|
CREATE INDEX IF NOT EXISTS idx_books_context ON books(context, context_id)
|
|
233
|
-
|
|
234
|
-
await tx`
|
|
149
|
+
`,await E`
|
|
235
150
|
CREATE INDEX IF NOT EXISTS idx_books_series ON books(series, series_volume)
|
|
236
|
-
|
|
237
|
-
await tx`
|
|
151
|
+
`,await E`
|
|
238
152
|
CREATE INDEX IF NOT EXISTS idx_books_published_date ON books(published_date DESC)
|
|
239
|
-
|
|
240
|
-
await tx`
|
|
153
|
+
`,await E`
|
|
241
154
|
CREATE INDEX IF NOT EXISTS idx_books_average_rating ON books(average_rating DESC)
|
|
242
|
-
|
|
243
|
-
await tx`
|
|
155
|
+
`,await E`
|
|
244
156
|
CREATE INDEX IF NOT EXISTS idx_books_ratings_count ON books(ratings_count DESC)
|
|
245
|
-
|
|
246
|
-
await tx`
|
|
157
|
+
`,await E`
|
|
247
158
|
CREATE INDEX IF NOT EXISTS idx_books_is_public ON books(is_public) WHERE deleted_at IS NULL
|
|
248
|
-
|
|
249
|
-
await tx`
|
|
159
|
+
`,await E`
|
|
250
160
|
CREATE INDEX IF NOT EXISTS idx_books_title_lower ON books(LOWER(title)) WHERE deleted_at IS NULL
|
|
251
|
-
|
|
252
|
-
await tx`
|
|
161
|
+
`,await E`
|
|
253
162
|
CREATE INDEX IF NOT EXISTS idx_books_created_at ON books(created_at DESC)
|
|
254
|
-
|
|
255
|
-
await tx`
|
|
163
|
+
`,await E`
|
|
256
164
|
CREATE INDEX IF NOT EXISTS idx_books_updated_at ON books(updated_at DESC)
|
|
257
|
-
|
|
258
|
-
await tx`
|
|
165
|
+
`,await E`
|
|
259
166
|
CREATE INDEX IF NOT EXISTS idx_books_popular ON books(is_public, average_rating DESC, ratings_count DESC) WHERE deleted_at IS NULL
|
|
260
|
-
|
|
261
|
-
await tx`
|
|
167
|
+
`,await E`
|
|
262
168
|
CREATE INDEX IF NOT EXISTS idx_books_active ON books(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
263
|
-
|
|
264
|
-
await tx`
|
|
169
|
+
`,await E`
|
|
265
170
|
CREATE INDEX IF NOT EXISTS idx_books_authors_book_id ON books_authors(book_id)
|
|
266
|
-
|
|
267
|
-
await tx`
|
|
171
|
+
`,await E`
|
|
268
172
|
CREATE INDEX IF NOT EXISTS idx_books_authors_author_id ON books_authors(author_id)
|
|
269
|
-
|
|
270
|
-
await tx`
|
|
173
|
+
`,await E`
|
|
271
174
|
CREATE INDEX IF NOT EXISTS idx_books_tags_book_id ON books_tags(book_id)
|
|
272
|
-
|
|
273
|
-
await tx`
|
|
175
|
+
`,await E`
|
|
274
176
|
CREATE INDEX IF NOT EXISTS idx_books_tags_tag_id ON books_tags(tag_id)
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
async down(tx) {
|
|
278
|
-
await tx`DROP TABLE IF EXISTS books_tags CASCADE`;
|
|
279
|
-
await tx`DROP TABLE IF EXISTS books_authors CASCADE`;
|
|
280
|
-
await tx`DROP TABLE IF EXISTS books CASCADE`;
|
|
281
|
-
}
|
|
282
|
-
getVersion() {
|
|
283
|
-
return "20251225173355647";
|
|
284
|
-
}
|
|
285
|
-
getDependencies() {
|
|
286
|
-
return [
|
|
287
|
-
Migration20251225173353646,
|
|
288
|
-
Migration20251225173354646,
|
|
289
|
-
Migration20251225173350644,
|
|
290
|
-
Migration20251225173351645,
|
|
291
|
-
Migration20251225173352645
|
|
292
|
-
];
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
Migration20251225173355647 = __legacyDecorateClassTS([
|
|
296
|
-
decorator3.migration()
|
|
297
|
-
], Migration20251225173355647);
|
|
298
|
-
// src/migrations/book/Migration20251225173356648.ts
|
|
299
|
-
import { decorator as decorator4 } from "@ooneex/migrations";
|
|
300
|
-
class Migration20251225173356648 {
|
|
301
|
-
async up(tx) {
|
|
302
|
-
await tx`
|
|
177
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_tags CASCADE`,await E`DROP TABLE IF EXISTS books_authors CASCADE`,await E`DROP TABLE IF EXISTS books CASCADE`}getVersion(){return"20251225173355647"}getDependencies(){return[_,s,l,O,p]}}e=T([X.migration()],e);import{decorator as c}from"@ooneex/migrations";class I{async up(E){await E`
|
|
303
178
|
CREATE TABLE IF NOT EXISTS books_stats (
|
|
304
179
|
id VARCHAR(25) PRIMARY KEY,
|
|
305
180
|
book_id VARCHAR(25),
|
|
@@ -323,58 +198,27 @@ class Migration20251225173356648 {
|
|
|
323
198
|
deleted_at TIMESTAMPTZ,
|
|
324
199
|
CONSTRAINT fk_books_stats_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE
|
|
325
200
|
)
|
|
326
|
-
|
|
327
|
-
await tx`
|
|
201
|
+
`,await E`
|
|
328
202
|
CREATE INDEX IF NOT EXISTS idx_books_stats_book_id ON books_stats(book_id)
|
|
329
|
-
|
|
330
|
-
await tx`
|
|
203
|
+
`,await E`
|
|
331
204
|
CREATE INDEX IF NOT EXISTS idx_books_stats_likes_count ON books_stats(likes_count DESC)
|
|
332
|
-
|
|
333
|
-
await tx`
|
|
205
|
+
`,await E`
|
|
334
206
|
CREATE INDEX IF NOT EXISTS idx_books_stats_views_count ON books_stats(views_count DESC)
|
|
335
|
-
|
|
336
|
-
await tx`
|
|
207
|
+
`,await E`
|
|
337
208
|
CREATE INDEX IF NOT EXISTS idx_books_stats_downloads_count ON books_stats(downloads_count DESC)
|
|
338
|
-
|
|
339
|
-
await tx`
|
|
209
|
+
`,await E`
|
|
340
210
|
CREATE INDEX IF NOT EXISTS idx_books_stats_language ON books_stats(language)
|
|
341
|
-
|
|
342
|
-
await tx`
|
|
211
|
+
`,await E`
|
|
343
212
|
CREATE INDEX IF NOT EXISTS idx_books_stats_deleted_at ON books_stats(deleted_at)
|
|
344
|
-
|
|
345
|
-
await tx`
|
|
213
|
+
`,await E`
|
|
346
214
|
CREATE INDEX IF NOT EXISTS idx_books_stats_is_public ON books_stats(is_public) WHERE deleted_at IS NULL
|
|
347
|
-
|
|
348
|
-
await tx`
|
|
215
|
+
`,await E`
|
|
349
216
|
CREATE INDEX IF NOT EXISTS idx_books_stats_popular ON books_stats(is_public, likes_count DESC, views_count DESC) WHERE deleted_at IS NULL
|
|
350
|
-
|
|
351
|
-
await tx`
|
|
217
|
+
`,await E`
|
|
352
218
|
CREATE INDEX IF NOT EXISTS idx_books_stats_created_at ON books_stats(created_at DESC)
|
|
353
|
-
|
|
354
|
-
await tx`
|
|
219
|
+
`,await E`
|
|
355
220
|
CREATE INDEX IF NOT EXISTS idx_books_stats_active ON books_stats(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
async down(tx) {
|
|
359
|
-
await tx`DROP TABLE IF EXISTS books_stats CASCADE`;
|
|
360
|
-
}
|
|
361
|
-
getVersion() {
|
|
362
|
-
return "20251225173356648";
|
|
363
|
-
}
|
|
364
|
-
getDependencies() {
|
|
365
|
-
return [
|
|
366
|
-
Migration20251225173355647
|
|
367
|
-
];
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
Migration20251225173356648 = __legacyDecorateClassTS([
|
|
371
|
-
decorator4.migration()
|
|
372
|
-
], Migration20251225173356648);
|
|
373
|
-
// src/migrations/book/Migration20251225173357649.ts
|
|
374
|
-
import { decorator as decorator5 } from "@ooneex/migrations";
|
|
375
|
-
class Migration20251225173357649 {
|
|
376
|
-
async up(tx) {
|
|
377
|
-
await tx`
|
|
221
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_stats CASCADE`}getVersion(){return"20251225173356648"}getDependencies(){return[e]}}I=T([c.migration()],I);import{decorator as h}from"@ooneex/migrations";class a{async up(E){await E`
|
|
378
222
|
CREATE TABLE IF NOT EXISTS books_comments (
|
|
379
223
|
id VARCHAR(25) PRIMARY KEY,
|
|
380
224
|
book_id VARCHAR(25),
|
|
@@ -395,55 +239,25 @@ class Migration20251225173357649 {
|
|
|
395
239
|
CONSTRAINT fk_books_comments_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE,
|
|
396
240
|
CONSTRAINT fk_books_comments_parent FOREIGN KEY (parent_comment_id) REFERENCES books_comments(id) ON DELETE CASCADE
|
|
397
241
|
)
|
|
398
|
-
|
|
399
|
-
await tx`
|
|
242
|
+
`,await E`
|
|
400
243
|
CREATE INDEX IF NOT EXISTS idx_books_comments_book_id ON books_comments(book_id)
|
|
401
|
-
|
|
402
|
-
await tx`
|
|
244
|
+
`,await E`
|
|
403
245
|
CREATE INDEX IF NOT EXISTS idx_books_comments_commented_by_id ON books_comments(commented_by_id)
|
|
404
|
-
|
|
405
|
-
await tx`
|
|
246
|
+
`,await E`
|
|
406
247
|
CREATE INDEX IF NOT EXISTS idx_books_comments_parent_comment_id ON books_comments(parent_comment_id)
|
|
407
|
-
|
|
408
|
-
await tx`
|
|
248
|
+
`,await E`
|
|
409
249
|
CREATE INDEX IF NOT EXISTS idx_books_comments_language ON books_comments(language)
|
|
410
|
-
|
|
411
|
-
await tx`
|
|
250
|
+
`,await E`
|
|
412
251
|
CREATE INDEX IF NOT EXISTS idx_books_comments_deleted_at ON books_comments(deleted_at)
|
|
413
|
-
|
|
414
|
-
await tx`
|
|
252
|
+
`,await E`
|
|
415
253
|
CREATE INDEX IF NOT EXISTS idx_books_comments_is_public ON books_comments(is_public) WHERE deleted_at IS NULL
|
|
416
|
-
|
|
417
|
-
await tx`
|
|
254
|
+
`,await E`
|
|
418
255
|
CREATE INDEX IF NOT EXISTS idx_books_comments_created_at ON books_comments(created_at DESC)
|
|
419
|
-
|
|
420
|
-
await tx`
|
|
256
|
+
`,await E`
|
|
421
257
|
CREATE INDEX IF NOT EXISTS idx_books_comments_book_created ON books_comments(book_id, created_at DESC) WHERE deleted_at IS NULL
|
|
422
|
-
|
|
423
|
-
await tx`
|
|
258
|
+
`,await E`
|
|
424
259
|
CREATE INDEX IF NOT EXISTS idx_books_comments_active ON books_comments(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
async down(tx) {
|
|
428
|
-
await tx`DROP TABLE IF EXISTS books_comments CASCADE`;
|
|
429
|
-
}
|
|
430
|
-
getVersion() {
|
|
431
|
-
return "20251225173357649";
|
|
432
|
-
}
|
|
433
|
-
getDependencies() {
|
|
434
|
-
return [
|
|
435
|
-
Migration20251225173355647
|
|
436
|
-
];
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
Migration20251225173357649 = __legacyDecorateClassTS([
|
|
440
|
-
decorator5.migration()
|
|
441
|
-
], Migration20251225173357649);
|
|
442
|
-
// src/migrations/book/Migration20251225173358650.ts
|
|
443
|
-
import { decorator as decorator6 } from "@ooneex/migrations";
|
|
444
|
-
class Migration20251225173358650 {
|
|
445
|
-
async up(tx) {
|
|
446
|
-
await tx`
|
|
260
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_comments CASCADE`}getVersion(){return"20251225173357649"}getDependencies(){return[e]}}a=T([h.migration()],a);import{decorator as D}from"@ooneex/migrations";class A{async up(E){await E`
|
|
447
261
|
CREATE TABLE IF NOT EXISTS books_liked (
|
|
448
262
|
id VARCHAR(25) PRIMARY KEY,
|
|
449
263
|
book_id VARCHAR(25),
|
|
@@ -461,52 +275,23 @@ class Migration20251225173358650 {
|
|
|
461
275
|
deleted_at TIMESTAMPTZ,
|
|
462
276
|
CONSTRAINT fk_books_liked_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE
|
|
463
277
|
)
|
|
464
|
-
|
|
465
|
-
await tx`
|
|
278
|
+
`,await E`
|
|
466
279
|
CREATE INDEX IF NOT EXISTS idx_books_liked_book_id ON books_liked(book_id)
|
|
467
|
-
|
|
468
|
-
await tx`
|
|
280
|
+
`,await E`
|
|
469
281
|
CREATE INDEX IF NOT EXISTS idx_books_liked_liked_by_id ON books_liked(liked_by_id)
|
|
470
|
-
|
|
471
|
-
await tx`
|
|
282
|
+
`,await E`
|
|
472
283
|
CREATE INDEX IF NOT EXISTS idx_books_liked_language ON books_liked(language)
|
|
473
|
-
|
|
474
|
-
await tx`
|
|
284
|
+
`,await E`
|
|
475
285
|
CREATE INDEX IF NOT EXISTS idx_books_liked_deleted_at ON books_liked(deleted_at)
|
|
476
|
-
|
|
477
|
-
await tx`
|
|
286
|
+
`,await E`
|
|
478
287
|
CREATE INDEX IF NOT EXISTS idx_books_liked_is_public ON books_liked(is_public) WHERE deleted_at IS NULL
|
|
479
|
-
|
|
480
|
-
await tx`
|
|
288
|
+
`,await E`
|
|
481
289
|
CREATE INDEX IF NOT EXISTS idx_books_liked_created_at ON books_liked(created_at DESC)
|
|
482
|
-
|
|
483
|
-
await tx`
|
|
290
|
+
`,await E`
|
|
484
291
|
CREATE INDEX IF NOT EXISTS idx_books_liked_book_user ON books_liked(book_id, liked_by_id) WHERE deleted_at IS NULL
|
|
485
|
-
|
|
486
|
-
await tx`
|
|
292
|
+
`,await E`
|
|
487
293
|
CREATE INDEX IF NOT EXISTS idx_books_liked_active ON books_liked(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
async down(tx) {
|
|
491
|
-
await tx`DROP TABLE IF EXISTS books_liked CASCADE`;
|
|
492
|
-
}
|
|
493
|
-
getVersion() {
|
|
494
|
-
return "20251225173358650";
|
|
495
|
-
}
|
|
496
|
-
getDependencies() {
|
|
497
|
-
return [
|
|
498
|
-
Migration20251225173355647
|
|
499
|
-
];
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
Migration20251225173358650 = __legacyDecorateClassTS([
|
|
503
|
-
decorator6.migration()
|
|
504
|
-
], Migration20251225173358650);
|
|
505
|
-
// src/migrations/book/Migration20251225173359651.ts
|
|
506
|
-
import { decorator as decorator7 } from "@ooneex/migrations";
|
|
507
|
-
class Migration20251225173359651 {
|
|
508
|
-
async up(tx) {
|
|
509
|
-
await tx`
|
|
294
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_liked CASCADE`}getVersion(){return"20251225173358650"}getDependencies(){return[e]}}A=T([D.migration()],A);import{decorator as o}from"@ooneex/migrations";class N{async up(E){await E`
|
|
510
295
|
CREATE TABLE IF NOT EXISTS books_disliked (
|
|
511
296
|
id VARCHAR(25) PRIMARY KEY,
|
|
512
297
|
book_id VARCHAR(25),
|
|
@@ -524,52 +309,23 @@ class Migration20251225173359651 {
|
|
|
524
309
|
deleted_at TIMESTAMPTZ,
|
|
525
310
|
CONSTRAINT fk_books_disliked_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE
|
|
526
311
|
)
|
|
527
|
-
|
|
528
|
-
await tx`
|
|
312
|
+
`,await E`
|
|
529
313
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_book_id ON books_disliked(book_id)
|
|
530
|
-
|
|
531
|
-
await tx`
|
|
314
|
+
`,await E`
|
|
532
315
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_disliked_by_id ON books_disliked(disliked_by_id)
|
|
533
|
-
|
|
534
|
-
await tx`
|
|
316
|
+
`,await E`
|
|
535
317
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_language ON books_disliked(language)
|
|
536
|
-
|
|
537
|
-
await tx`
|
|
318
|
+
`,await E`
|
|
538
319
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_deleted_at ON books_disliked(deleted_at)
|
|
539
|
-
|
|
540
|
-
await tx`
|
|
320
|
+
`,await E`
|
|
541
321
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_is_public ON books_disliked(is_public) WHERE deleted_at IS NULL
|
|
542
|
-
|
|
543
|
-
await tx`
|
|
322
|
+
`,await E`
|
|
544
323
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_created_at ON books_disliked(created_at DESC)
|
|
545
|
-
|
|
546
|
-
await tx`
|
|
324
|
+
`,await E`
|
|
547
325
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_book_user ON books_disliked(book_id, disliked_by_id) WHERE deleted_at IS NULL
|
|
548
|
-
|
|
549
|
-
await tx`
|
|
326
|
+
`,await E`
|
|
550
327
|
CREATE INDEX IF NOT EXISTS idx_books_disliked_active ON books_disliked(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
async down(tx) {
|
|
554
|
-
await tx`DROP TABLE IF EXISTS books_disliked CASCADE`;
|
|
555
|
-
}
|
|
556
|
-
getVersion() {
|
|
557
|
-
return "20251225173359651";
|
|
558
|
-
}
|
|
559
|
-
getDependencies() {
|
|
560
|
-
return [
|
|
561
|
-
Migration20251225173355647
|
|
562
|
-
];
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
Migration20251225173359651 = __legacyDecorateClassTS([
|
|
566
|
-
decorator7.migration()
|
|
567
|
-
], Migration20251225173359651);
|
|
568
|
-
// src/migrations/book/Migration20251225173400652.ts
|
|
569
|
-
import { decorator as decorator8 } from "@ooneex/migrations";
|
|
570
|
-
class Migration20251225173400652 {
|
|
571
|
-
async up(tx) {
|
|
572
|
-
await tx`
|
|
328
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_disliked CASCADE`}getVersion(){return"20251225173359651"}getDependencies(){return[e]}}N=T([o.migration()],N);import{decorator as m}from"@ooneex/migrations";class S{async up(E){await E`
|
|
573
329
|
CREATE TABLE IF NOT EXISTS books_viewed (
|
|
574
330
|
id VARCHAR(25) PRIMARY KEY,
|
|
575
331
|
book_id VARCHAR(25),
|
|
@@ -587,52 +343,23 @@ class Migration20251225173400652 {
|
|
|
587
343
|
deleted_at TIMESTAMPTZ,
|
|
588
344
|
CONSTRAINT fk_books_viewed_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE
|
|
589
345
|
)
|
|
590
|
-
|
|
591
|
-
await tx`
|
|
346
|
+
`,await E`
|
|
592
347
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_book_id ON books_viewed(book_id)
|
|
593
|
-
|
|
594
|
-
await tx`
|
|
348
|
+
`,await E`
|
|
595
349
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_viewed_by_id ON books_viewed(viewed_by_id)
|
|
596
|
-
|
|
597
|
-
await tx`
|
|
350
|
+
`,await E`
|
|
598
351
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_language ON books_viewed(language)
|
|
599
|
-
|
|
600
|
-
await tx`
|
|
352
|
+
`,await E`
|
|
601
353
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_deleted_at ON books_viewed(deleted_at)
|
|
602
|
-
|
|
603
|
-
await tx`
|
|
354
|
+
`,await E`
|
|
604
355
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_is_public ON books_viewed(is_public) WHERE deleted_at IS NULL
|
|
605
|
-
|
|
606
|
-
await tx`
|
|
356
|
+
`,await E`
|
|
607
357
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_created_at ON books_viewed(created_at DESC)
|
|
608
|
-
|
|
609
|
-
await tx`
|
|
358
|
+
`,await E`
|
|
610
359
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_book_user ON books_viewed(book_id, viewed_by_id) WHERE deleted_at IS NULL
|
|
611
|
-
|
|
612
|
-
await tx`
|
|
360
|
+
`,await E`
|
|
613
361
|
CREATE INDEX IF NOT EXISTS idx_books_viewed_active ON books_viewed(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
614
|
-
|
|
615
|
-
}
|
|
616
|
-
async down(tx) {
|
|
617
|
-
await tx`DROP TABLE IF EXISTS books_viewed CASCADE`;
|
|
618
|
-
}
|
|
619
|
-
getVersion() {
|
|
620
|
-
return "20251225173400652";
|
|
621
|
-
}
|
|
622
|
-
getDependencies() {
|
|
623
|
-
return [
|
|
624
|
-
Migration20251225173355647
|
|
625
|
-
];
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
Migration20251225173400652 = __legacyDecorateClassTS([
|
|
629
|
-
decorator8.migration()
|
|
630
|
-
], Migration20251225173400652);
|
|
631
|
-
// src/migrations/book/Migration20251225173401654.ts
|
|
632
|
-
import { decorator as decorator9 } from "@ooneex/migrations";
|
|
633
|
-
class Migration20251225173401654 {
|
|
634
|
-
async up(tx) {
|
|
635
|
-
await tx`
|
|
362
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_viewed CASCADE`}getVersion(){return"20251225173400652"}getDependencies(){return[e]}}S=T([m.migration()],S);import{decorator as k}from"@ooneex/migrations";class d{async up(E){await E`
|
|
636
363
|
CREATE TABLE IF NOT EXISTS books_saved (
|
|
637
364
|
id VARCHAR(25) PRIMARY KEY,
|
|
638
365
|
book_id VARCHAR(25),
|
|
@@ -650,52 +377,23 @@ class Migration20251225173401654 {
|
|
|
650
377
|
deleted_at TIMESTAMPTZ,
|
|
651
378
|
CONSTRAINT fk_books_saved_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE
|
|
652
379
|
)
|
|
653
|
-
|
|
654
|
-
await tx`
|
|
380
|
+
`,await E`
|
|
655
381
|
CREATE INDEX IF NOT EXISTS idx_books_saved_book_id ON books_saved(book_id)
|
|
656
|
-
|
|
657
|
-
await tx`
|
|
382
|
+
`,await E`
|
|
658
383
|
CREATE INDEX IF NOT EXISTS idx_books_saved_saved_by_id ON books_saved(saved_by_id)
|
|
659
|
-
|
|
660
|
-
await tx`
|
|
384
|
+
`,await E`
|
|
661
385
|
CREATE INDEX IF NOT EXISTS idx_books_saved_language ON books_saved(language)
|
|
662
|
-
|
|
663
|
-
await tx`
|
|
386
|
+
`,await E`
|
|
664
387
|
CREATE INDEX IF NOT EXISTS idx_books_saved_deleted_at ON books_saved(deleted_at)
|
|
665
|
-
|
|
666
|
-
await tx`
|
|
388
|
+
`,await E`
|
|
667
389
|
CREATE INDEX IF NOT EXISTS idx_books_saved_is_public ON books_saved(is_public) WHERE deleted_at IS NULL
|
|
668
|
-
|
|
669
|
-
await tx`
|
|
390
|
+
`,await E`
|
|
670
391
|
CREATE INDEX IF NOT EXISTS idx_books_saved_created_at ON books_saved(created_at DESC)
|
|
671
|
-
|
|
672
|
-
await tx`
|
|
392
|
+
`,await E`
|
|
673
393
|
CREATE INDEX IF NOT EXISTS idx_books_saved_book_user ON books_saved(book_id, saved_by_id) WHERE deleted_at IS NULL
|
|
674
|
-
|
|
675
|
-
await tx`
|
|
394
|
+
`,await E`
|
|
676
395
|
CREATE INDEX IF NOT EXISTS idx_books_saved_active ON books_saved(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
677
|
-
|
|
678
|
-
}
|
|
679
|
-
async down(tx) {
|
|
680
|
-
await tx`DROP TABLE IF EXISTS books_saved CASCADE`;
|
|
681
|
-
}
|
|
682
|
-
getVersion() {
|
|
683
|
-
return "20251225173401654";
|
|
684
|
-
}
|
|
685
|
-
getDependencies() {
|
|
686
|
-
return [
|
|
687
|
-
Migration20251225173355647
|
|
688
|
-
];
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
Migration20251225173401654 = __legacyDecorateClassTS([
|
|
692
|
-
decorator9.migration()
|
|
693
|
-
], Migration20251225173401654);
|
|
694
|
-
// src/migrations/book/Migration20251225173402655.ts
|
|
695
|
-
import { decorator as decorator10 } from "@ooneex/migrations";
|
|
696
|
-
class Migration20251225173402655 {
|
|
697
|
-
async up(tx) {
|
|
698
|
-
await tx`
|
|
396
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_saved CASCADE`}getVersion(){return"20251225173401654"}getDependencies(){return[e]}}d=T([k.migration()],d);import{decorator as F}from"@ooneex/migrations";class u{async up(E){await E`
|
|
699
397
|
CREATE TABLE IF NOT EXISTS books_downloaded (
|
|
700
398
|
id VARCHAR(25) PRIMARY KEY,
|
|
701
399
|
book_id VARCHAR(25),
|
|
@@ -713,52 +411,23 @@ class Migration20251225173402655 {
|
|
|
713
411
|
deleted_at TIMESTAMPTZ,
|
|
714
412
|
CONSTRAINT fk_books_downloaded_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE
|
|
715
413
|
)
|
|
716
|
-
|
|
717
|
-
await tx`
|
|
414
|
+
`,await E`
|
|
718
415
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_book_id ON books_downloaded(book_id)
|
|
719
|
-
|
|
720
|
-
await tx`
|
|
416
|
+
`,await E`
|
|
721
417
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_downloaded_by_id ON books_downloaded(downloaded_by_id)
|
|
722
|
-
|
|
723
|
-
await tx`
|
|
418
|
+
`,await E`
|
|
724
419
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_language ON books_downloaded(language)
|
|
725
|
-
|
|
726
|
-
await tx`
|
|
420
|
+
`,await E`
|
|
727
421
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_deleted_at ON books_downloaded(deleted_at)
|
|
728
|
-
|
|
729
|
-
await tx`
|
|
422
|
+
`,await E`
|
|
730
423
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_is_public ON books_downloaded(is_public) WHERE deleted_at IS NULL
|
|
731
|
-
|
|
732
|
-
await tx`
|
|
424
|
+
`,await E`
|
|
733
425
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_created_at ON books_downloaded(created_at DESC)
|
|
734
|
-
|
|
735
|
-
await tx`
|
|
426
|
+
`,await E`
|
|
736
427
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_book_user ON books_downloaded(book_id, downloaded_by_id) WHERE deleted_at IS NULL
|
|
737
|
-
|
|
738
|
-
await tx`
|
|
428
|
+
`,await E`
|
|
739
429
|
CREATE INDEX IF NOT EXISTS idx_books_downloaded_active ON books_downloaded(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
async down(tx) {
|
|
743
|
-
await tx`DROP TABLE IF EXISTS books_downloaded CASCADE`;
|
|
744
|
-
}
|
|
745
|
-
getVersion() {
|
|
746
|
-
return "20251225173402655";
|
|
747
|
-
}
|
|
748
|
-
getDependencies() {
|
|
749
|
-
return [
|
|
750
|
-
Migration20251225173355647
|
|
751
|
-
];
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
Migration20251225173402655 = __legacyDecorateClassTS([
|
|
755
|
-
decorator10.migration()
|
|
756
|
-
], Migration20251225173402655);
|
|
757
|
-
// src/migrations/book/Migration20251225173403656.ts
|
|
758
|
-
import { decorator as decorator11 } from "@ooneex/migrations";
|
|
759
|
-
class Migration20251225173403656 {
|
|
760
|
-
async up(tx) {
|
|
761
|
-
await tx`
|
|
430
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_downloaded CASCADE`}getVersion(){return"20251225173402655"}getDependencies(){return[e]}}u=T([F.migration()],u);import{decorator as U}from"@ooneex/migrations";class R{async up(E){await E`
|
|
762
431
|
CREATE TABLE IF NOT EXISTS books_shared (
|
|
763
432
|
id VARCHAR(25) PRIMARY KEY,
|
|
764
433
|
book_id VARCHAR(25),
|
|
@@ -778,61 +447,29 @@ class Migration20251225173403656 {
|
|
|
778
447
|
deleted_at TIMESTAMPTZ,
|
|
779
448
|
CONSTRAINT fk_books_shared_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE
|
|
780
449
|
)
|
|
781
|
-
|
|
782
|
-
await tx`
|
|
450
|
+
`,await E`
|
|
783
451
|
CREATE INDEX IF NOT EXISTS idx_books_shared_book_id ON books_shared(book_id)
|
|
784
|
-
|
|
785
|
-
await tx`
|
|
452
|
+
`,await E`
|
|
786
453
|
CREATE INDEX IF NOT EXISTS idx_books_shared_shared_by_id ON books_shared(shared_by_id)
|
|
787
|
-
|
|
788
|
-
await tx`
|
|
454
|
+
`,await E`
|
|
789
455
|
CREATE INDEX IF NOT EXISTS idx_books_shared_permission ON books_shared(permission)
|
|
790
|
-
|
|
791
|
-
await tx`
|
|
456
|
+
`,await E`
|
|
792
457
|
CREATE INDEX IF NOT EXISTS idx_books_shared_expires_at ON books_shared(expires_at)
|
|
793
|
-
|
|
794
|
-
await tx`
|
|
458
|
+
`,await E`
|
|
795
459
|
CREATE INDEX IF NOT EXISTS idx_books_shared_language ON books_shared(language)
|
|
796
|
-
|
|
797
|
-
await tx`
|
|
460
|
+
`,await E`
|
|
798
461
|
CREATE INDEX IF NOT EXISTS idx_books_shared_deleted_at ON books_shared(deleted_at)
|
|
799
|
-
|
|
800
|
-
await tx`
|
|
462
|
+
`,await E`
|
|
801
463
|
CREATE INDEX IF NOT EXISTS idx_books_shared_is_public ON books_shared(is_public) WHERE deleted_at IS NULL
|
|
802
|
-
|
|
803
|
-
await tx`
|
|
464
|
+
`,await E`
|
|
804
465
|
CREATE INDEX IF NOT EXISTS idx_books_shared_created_at ON books_shared(created_at DESC)
|
|
805
|
-
|
|
806
|
-
await tx`
|
|
466
|
+
`,await E`
|
|
807
467
|
CREATE INDEX IF NOT EXISTS idx_books_shared_book_user ON books_shared(book_id, shared_by_id) WHERE deleted_at IS NULL
|
|
808
|
-
|
|
809
|
-
await tx`
|
|
468
|
+
`,await E`
|
|
810
469
|
CREATE INDEX IF NOT EXISTS idx_books_shared_active ON books_shared(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
811
|
-
|
|
812
|
-
await tx`
|
|
470
|
+
`,await E`
|
|
813
471
|
CREATE INDEX IF NOT EXISTS idx_books_shared_active_not_expired ON books_shared(expires_at) WHERE deleted_at IS NULL AND expires_at > NOW()
|
|
814
|
-
|
|
815
|
-
}
|
|
816
|
-
async down(tx) {
|
|
817
|
-
await tx`DROP TABLE IF EXISTS books_shared CASCADE`;
|
|
818
|
-
}
|
|
819
|
-
getVersion() {
|
|
820
|
-
return "20251225173403656";
|
|
821
|
-
}
|
|
822
|
-
getDependencies() {
|
|
823
|
-
return [
|
|
824
|
-
Migration20251225173355647
|
|
825
|
-
];
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
Migration20251225173403656 = __legacyDecorateClassTS([
|
|
829
|
-
decorator11.migration()
|
|
830
|
-
], Migration20251225173403656);
|
|
831
|
-
// src/migrations/book/Migration20251225173404658.ts
|
|
832
|
-
import { decorator as decorator12 } from "@ooneex/migrations";
|
|
833
|
-
class Migration20251225173404658 {
|
|
834
|
-
async up(tx) {
|
|
835
|
-
await tx`
|
|
472
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_shared CASCADE`}getVersion(){return"20251225173403656"}getDependencies(){return[e]}}R=T([U.migration()],R);import{decorator as P}from"@ooneex/migrations";class b{async up(E){await E`
|
|
836
473
|
CREATE TABLE IF NOT EXISTS books_reports (
|
|
837
474
|
id VARCHAR(25) PRIMARY KEY,
|
|
838
475
|
book_id VARCHAR(25),
|
|
@@ -854,67 +491,26 @@ class Migration20251225173404658 {
|
|
|
854
491
|
CONSTRAINT fk_books_reports_book FOREIGN KEY (book_id) REFERENCES books(id) ON DELETE CASCADE,
|
|
855
492
|
CONSTRAINT fk_books_reports_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
|
|
856
493
|
)
|
|
857
|
-
|
|
858
|
-
await tx`
|
|
494
|
+
`,await E`
|
|
859
495
|
CREATE INDEX IF NOT EXISTS idx_books_reports_book_id ON books_reports(book_id)
|
|
860
|
-
|
|
861
|
-
await tx`
|
|
496
|
+
`,await E`
|
|
862
497
|
CREATE INDEX IF NOT EXISTS idx_books_reports_reported_by_id ON books_reports(reported_by_id)
|
|
863
|
-
|
|
864
|
-
await tx`
|
|
498
|
+
`,await E`
|
|
865
499
|
CREATE INDEX IF NOT EXISTS idx_books_reports_status_id ON books_reports(status_id)
|
|
866
|
-
|
|
867
|
-
await tx`
|
|
500
|
+
`,await E`
|
|
868
501
|
CREATE INDEX IF NOT EXISTS idx_books_reports_reason ON books_reports(reason)
|
|
869
|
-
|
|
870
|
-
await tx`
|
|
502
|
+
`,await E`
|
|
871
503
|
CREATE INDEX IF NOT EXISTS idx_books_reports_language ON books_reports(language)
|
|
872
|
-
|
|
873
|
-
await tx`
|
|
504
|
+
`,await E`
|
|
874
505
|
CREATE INDEX IF NOT EXISTS idx_books_reports_deleted_at ON books_reports(deleted_at)
|
|
875
|
-
|
|
876
|
-
await tx`
|
|
506
|
+
`,await E`
|
|
877
507
|
CREATE INDEX IF NOT EXISTS idx_books_reports_is_public ON books_reports(is_public) WHERE deleted_at IS NULL
|
|
878
|
-
|
|
879
|
-
await tx`
|
|
508
|
+
`,await E`
|
|
880
509
|
CREATE INDEX IF NOT EXISTS idx_books_reports_created_at ON books_reports(created_at DESC)
|
|
881
|
-
|
|
882
|
-
await tx`
|
|
510
|
+
`,await E`
|
|
883
511
|
CREATE INDEX IF NOT EXISTS idx_books_reports_book_status ON books_reports(book_id, status_id) WHERE deleted_at IS NULL
|
|
884
|
-
|
|
885
|
-
await tx`
|
|
512
|
+
`,await E`
|
|
886
513
|
CREATE INDEX IF NOT EXISTS idx_books_reports_active ON books_reports(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
887
|
-
|
|
888
|
-
}
|
|
889
|
-
async down(tx) {
|
|
890
|
-
await tx`DROP TABLE IF EXISTS books_reports CASCADE`;
|
|
891
|
-
}
|
|
892
|
-
getVersion() {
|
|
893
|
-
return "20251225173404658";
|
|
894
|
-
}
|
|
895
|
-
getDependencies() {
|
|
896
|
-
return [
|
|
897
|
-
Migration20251225173355647,
|
|
898
|
-
Migration20251225173350644
|
|
899
|
-
];
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
Migration20251225173404658 = __legacyDecorateClassTS([
|
|
903
|
-
decorator12.migration()
|
|
904
|
-
], Migration20251225173404658);
|
|
905
|
-
export {
|
|
906
|
-
Migration20251225173404658,
|
|
907
|
-
Migration20251225173403656,
|
|
908
|
-
Migration20251225173402655,
|
|
909
|
-
Migration20251225173401654,
|
|
910
|
-
Migration20251225173400652,
|
|
911
|
-
Migration20251225173359651,
|
|
912
|
-
Migration20251225173358650,
|
|
913
|
-
Migration20251225173357649,
|
|
914
|
-
Migration20251225173356648,
|
|
915
|
-
Migration20251225173355647,
|
|
916
|
-
Migration20251225173354646,
|
|
917
|
-
Migration20251225173353646
|
|
918
|
-
};
|
|
514
|
+
`}async down(E){await E`DROP TABLE IF EXISTS books_reports CASCADE`}getVersion(){return"20251225173404658"}getDependencies(){return[e,l]}}b=T([P.migration()],b);export{b as Migration20251225173404658,R as Migration20251225173403656,u as Migration20251225173402655,d as Migration20251225173401654,S as Migration20251225173400652,N as Migration20251225173359651,A as Migration20251225173358650,a as Migration20251225173357649,I as Migration20251225173356648,e as Migration20251225173355647,s as Migration20251225173354646,_ as Migration20251225173353646};
|
|
919
515
|
|
|
920
|
-
//# debugId=
|
|
516
|
+
//# debugId=6199AC8003206A2E64756E2164756E21
|