@ooneex/typeorm 0.0.1 → 0.3.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-1ez1q8rj.js +5 -0
- package/dist/shared/chunk-1ez1q8rj.js.map +10 -0
- package/dist/shared/chunk-23739ja5.js +5 -0
- package/dist/shared/{chunk-pwhygf44.js.map → chunk-23739ja5.js.map} +2 -2
- package/dist/shared/chunk-3s989zjv.js +5 -0
- package/dist/shared/{chunk-eh420jqn.js.map → chunk-3s989zjv.js.map} +2 -2
- package/dist/shared/chunk-4ysz6b7v.js +5 -0
- package/dist/shared/chunk-4ysz6b7v.js.map +10 -0
- package/dist/shared/chunk-635xd7h1.js +5 -0
- package/dist/shared/{chunk-wmftwzcs.js.map → chunk-635xd7h1.js.map} +2 -2
- package/dist/shared/chunk-63wp98dt.js +101 -0
- package/dist/shared/chunk-63wp98dt.js.map +11 -0
- package/dist/shared/chunk-6gzanxfz.js +5 -0
- package/dist/shared/chunk-6gzanxfz.js.map +18 -0
- package/dist/shared/chunk-81xh5hbk.js +5 -0
- package/dist/shared/chunk-81xh5hbk.js.map +21 -0
- package/dist/shared/chunk-8q6vs955.js +5 -0
- package/dist/shared/chunk-8q6vs955.js.map +10 -0
- package/dist/shared/chunk-bdyby4d8.js +5 -0
- package/dist/shared/chunk-bdyby4d8.js.map +10 -0
- package/dist/shared/chunk-fjtw26pp.js +5 -0
- package/dist/shared/{chunk-j7nprmyh.js.map → chunk-fjtw26pp.js.map} +2 -2
- package/dist/shared/chunk-gcch857j.js +5 -0
- package/dist/shared/chunk-gcch857j.js.map +11 -0
- package/dist/shared/chunk-h5mdrgqp.js +5 -0
- package/dist/shared/chunk-h5mdrgqp.js.map +21 -0
- package/dist/shared/chunk-mwb9mvew.js +42 -0
- package/dist/shared/chunk-mwb9mvew.js.map +10 -0
- package/dist/shared/chunk-n5dqa3qy.js +36 -0
- package/dist/shared/chunk-n5dqa3qy.js.map +10 -0
- package/dist/shared/chunk-qqvx08b4.js +5 -0
- package/dist/shared/{chunk-2e7zbxcq.js.map → chunk-qqvx08b4.js.map} +2 -2
- package/dist/shared/chunk-r7q1mkar.js +82 -0
- package/dist/shared/chunk-r7q1mkar.js.map +10 -0
- package/dist/shared/chunk-s1yxjjz5.js +5 -0
- package/dist/shared/chunk-s1yxjjz5.js.map +21 -0
- package/dist/shared/chunk-sm3brprk.js +51 -0
- package/dist/shared/chunk-sm3brprk.js.map +10 -0
- package/dist/shared/chunk-wp8mt34q.js +5 -0
- package/dist/shared/chunk-wp8mt34q.js.map +12 -0
- package/dist/shared/chunk-x9h6vngs.js +5 -0
- package/dist/shared/chunk-x9h6vngs.js.map +9 -0
- package/dist/shared/chunk-xyq6sfz0.js +5 -0
- package/dist/shared/{chunk-zmzz7hqq.js.map → chunk-xyq6sfz0.js.map} +2 -2
- package/dist/shared/chunk-yq9g4gac.js +5 -0
- package/dist/shared/{chunk-wawk30n1.js.map → chunk-yq9g4gac.js.map} +9 -4
- package/dist/src/entities/book/index.d.ts +80 -3
- package/dist/src/entities/book/index.js +2 -2
- package/dist/src/entities/book/index.js.map +1 -1
- package/dist/src/entities/common/index.d.ts +21 -28
- package/dist/src/entities/common/index.js +2 -2
- package/dist/src/entities/common/index.js.map +1 -1
- package/dist/src/entities/country/index.d.ts +21 -0
- package/dist/src/entities/country/index.js +4 -0
- package/dist/src/entities/country/index.js.map +9 -0
- package/dist/src/entities/currency/index.d.ts +23 -0
- package/dist/src/entities/currency/index.js +4 -0
- package/dist/src/entities/currency/index.js.map +9 -0
- package/dist/src/entities/folder/index.d.ts +104 -0
- package/dist/src/entities/folder/index.js +4 -0
- package/dist/src/entities/folder/index.js.map +19 -0
- package/dist/src/entities/gamification/flashcard/index.js +2 -2
- package/dist/src/entities/gamification/flashcard/index.js.map +1 -1
- package/dist/src/entities/gamification/index.js +2 -2
- package/dist/src/entities/gamification/index.js.map +1 -1
- package/dist/src/entities/gamification/mcq/index.d.ts +76 -7
- package/dist/src/entities/gamification/mcq/index.js +2 -2
- package/dist/src/entities/gamification/mcq/index.js.map +1 -1
- package/dist/src/entities/image/index.d.ts +83 -6
- package/dist/src/entities/image/index.js +2 -2
- package/dist/src/entities/image/index.js.map +1 -1
- package/dist/src/entities/medecine/index.d.ts +36 -0
- package/dist/src/entities/medecine/index.js +4 -0
- package/dist/src/entities/medecine/index.js.map +9 -0
- package/dist/src/entities/payment/index.js +2 -2
- package/dist/src/entities/payment/index.js.map +1 -1
- package/dist/src/entities/user/index.d.ts +48 -7
- package/dist/src/entities/user/index.js +2 -2
- package/dist/src/entities/user/index.js.map +1 -1
- package/dist/src/entities/video/index.d.ts +88 -10
- package/dist/src/entities/video/index.js +2 -2
- package/dist/src/entities/video/index.js.map +1 -1
- package/dist/src/migrations/book/index.d.ts +97 -0
- package/dist/src/migrations/book/index.js +516 -0
- package/dist/src/migrations/book/index.js.map +21 -0
- package/dist/src/migrations/common/index.d.ts +41 -0
- package/dist/src/migrations/common/index.js +57 -0
- package/dist/src/migrations/common/index.js.map +10 -0
- package/dist/src/migrations/country/index.d.ts +9 -0
- package/dist/src/migrations/country/index.js +40 -0
- package/dist/src/migrations/country/index.js.map +10 -0
- package/dist/src/migrations/currency/index.d.ts +9 -0
- package/dist/src/migrations/currency/index.js +44 -0
- package/dist/src/migrations/currency/index.js.map +10 -0
- package/dist/src/migrations/folder/index.d.ts +81 -0
- package/dist/src/migrations/folder/index.js +387 -0
- package/dist/src/migrations/folder/index.js.map +19 -0
- package/dist/src/migrations/gamification/flashcard/index.d.ts +57 -0
- package/dist/src/migrations/gamification/flashcard/index.js +420 -0
- package/dist/src/migrations/gamification/flashcard/index.js.map +16 -0
- package/dist/src/migrations/gamification/index.d.ts +9 -0
- package/dist/src/migrations/gamification/index.js +4 -0
- package/dist/src/migrations/gamification/index.js.map +9 -0
- package/dist/src/migrations/gamification/mcq/index.d.ts +97 -0
- package/dist/src/migrations/gamification/mcq/index.js +526 -0
- package/dist/src/migrations/gamification/mcq/index.js.map +21 -0
- package/dist/src/migrations/image/index.d.ts +81 -0
- package/dist/src/migrations/image/index.js +328 -0
- package/dist/src/migrations/image/index.js.map +18 -0
- package/dist/src/migrations/medecine/index.d.ts +25 -0
- package/dist/src/migrations/medecine/index.js +119 -0
- package/dist/src/migrations/medecine/index.js.map +12 -0
- package/dist/src/migrations/payment/index.d.ts +49 -0
- package/dist/src/migrations/payment/index.js +352 -0
- package/dist/src/migrations/payment/index.js.map +15 -0
- package/dist/src/migrations/user/index.d.ts +81 -0
- package/dist/src/migrations/user/index.js +309 -0
- package/dist/src/migrations/user/index.js.map +19 -0
- package/dist/src/migrations/video/index.d.ts +97 -0
- package/dist/src/migrations/video/index.js +289 -0
- package/dist/src/migrations/video/index.js.map +21 -0
- package/dist/src/repositories/book/index.d.ts +310 -35
- package/dist/src/repositories/book/index.js +2 -2
- package/dist/src/repositories/book/index.js.map +15 -6
- package/dist/src/repositories/common/index.d.ts +65 -94
- package/dist/src/repositories/common/index.js +2 -2
- package/dist/src/repositories/common/index.js.map +8 -9
- package/dist/src/repositories/country/index.d.ts +42 -0
- package/dist/src/repositories/country/index.js +4 -0
- package/dist/src/repositories/country/index.js.map +10 -0
- package/dist/src/repositories/currency/index.d.ts +44 -0
- package/dist/src/repositories/currency/index.js +4 -0
- package/dist/src/repositories/currency/index.js.map +10 -0
- package/dist/src/repositories/gamification/flashcard/index.d.ts +14 -14
- package/dist/src/repositories/gamification/flashcard/index.js +2 -2
- package/dist/src/repositories/gamification/flashcard/index.js.map +9 -9
- package/dist/src/repositories/gamification/index.d.ts +328 -83
- package/dist/src/repositories/gamification/index.js +2 -2
- package/dist/src/repositories/gamification/index.js.map +3 -3
- package/dist/src/repositories/gamification/mcq/index.d.ts +299 -54
- package/dist/src/repositories/gamification/mcq/index.js +2 -2
- package/dist/src/repositories/gamification/mcq/index.js.map +15 -7
- package/dist/src/repositories/image/index.d.ts +295 -20
- package/dist/src/repositories/image/index.js +2 -2
- package/dist/src/repositories/image/index.js.map +13 -4
- package/dist/src/repositories/medecine/index.d.ts +99 -0
- package/dist/src/repositories/medecine/index.js +4 -0
- package/dist/src/repositories/medecine/index.js.map +12 -0
- package/dist/src/repositories/payment/index.d.ts +12 -12
- package/dist/src/repositories/payment/index.js +2 -2
- package/dist/src/repositories/payment/index.js.map +8 -8
- package/dist/src/repositories/user/index.d.ts +210 -59
- package/dist/src/repositories/user/index.js +2 -2
- package/dist/src/repositories/user/index.js.map +13 -8
- package/dist/src/repositories/video/index.d.ts +330 -54
- package/dist/src/repositories/video/index.js +2 -2
- package/dist/src/repositories/video/index.js.map +15 -6
- package/package.json +188 -58
- package/dist/ooneex-typeorm-0.0.1.tgz +0 -0
- package/dist/shared/chunk-2e7zbxcq.js +0 -5
- package/dist/shared/chunk-764bzjhz.js +0 -5
- package/dist/shared/chunk-764bzjhz.js.map +0 -12
- package/dist/shared/chunk-eh420jqn.js +0 -5
- package/dist/shared/chunk-gjsgnzaq.js +0 -5
- package/dist/shared/chunk-gjsgnzaq.js.map +0 -10
- package/dist/shared/chunk-hw4vdg6q.js +0 -5
- package/dist/shared/chunk-hw4vdg6q.js.map +0 -10
- package/dist/shared/chunk-j7nprmyh.js +0 -5
- package/dist/shared/chunk-kgxsdeye.js +0 -5
- package/dist/shared/chunk-kgxsdeye.js.map +0 -13
- package/dist/shared/chunk-ntrrrvwt.js +0 -5
- package/dist/shared/chunk-ntrrrvwt.js.map +0 -12
- package/dist/shared/chunk-pwhygf44.js +0 -5
- package/dist/shared/chunk-sd6mmec6.js +0 -5
- package/dist/shared/chunk-sd6mmec6.js.map +0 -12
- package/dist/shared/chunk-wawk30n1.js +0 -5
- package/dist/shared/chunk-wmftwzcs.js +0 -5
- package/dist/shared/chunk-zmzz7hqq.js +0 -5
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{c as I}from"../../../../shared/chunk-mwb9mvew.js";import{e as d}from"../../../../shared/chunk-63wp98dt.js";import{f as A}from"../../../../shared/chunk-n5dqa3qy.js";import{_a as e}from"../../../../shared/chunk-x9h6vngs.js";import{decorator as N}from"@ooneex/migrations";class T{async up(a){await a`
|
|
3
|
+
CREATE TYPE flashcard_algorithm AS ENUM ('FSRS', 'SM2', 'ANKI')
|
|
4
|
+
`,await a`
|
|
5
|
+
CREATE TABLE IF NOT EXISTS flashcard_decks (
|
|
6
|
+
id VARCHAR(25) PRIMARY KEY,
|
|
7
|
+
name VARCHAR(500) NOT NULL,
|
|
8
|
+
description TEXT,
|
|
9
|
+
total_cards INT DEFAULT 0,
|
|
10
|
+
new_cards INT DEFAULT 0,
|
|
11
|
+
learning_cards INT DEFAULT 0,
|
|
12
|
+
due_cards INT DEFAULT 0,
|
|
13
|
+
suspended_cards INT DEFAULT 0,
|
|
14
|
+
algorithm flashcard_algorithm DEFAULT 'FSRS',
|
|
15
|
+
max_new_cards_per_day INT DEFAULT 20,
|
|
16
|
+
max_review_cards_per_day INT DEFAULT 200,
|
|
17
|
+
desired_retention DECIMAL(4, 3) DEFAULT 0.9,
|
|
18
|
+
learning_steps JSON DEFAULT '[1, 10]',
|
|
19
|
+
relearning_steps JSON DEFAULT '[10]',
|
|
20
|
+
graduating_interval INT DEFAULT 1,
|
|
21
|
+
easy_interval INT DEFAULT 4,
|
|
22
|
+
max_interval INT DEFAULT 36500,
|
|
23
|
+
fsrs_parameters JSON,
|
|
24
|
+
leech_threshold INT DEFAULT 8,
|
|
25
|
+
bury_siblings BOOLEAN DEFAULT false,
|
|
26
|
+
stat_id VARCHAR(25),
|
|
27
|
+
status_id VARCHAR(25),
|
|
28
|
+
is_locked BOOLEAN DEFAULT false,
|
|
29
|
+
locked_at TIMESTAMPTZ,
|
|
30
|
+
is_blocked BOOLEAN DEFAULT false,
|
|
31
|
+
blocked_at TIMESTAMPTZ,
|
|
32
|
+
block_reason TEXT,
|
|
33
|
+
is_public BOOLEAN DEFAULT true,
|
|
34
|
+
language VARCHAR(10),
|
|
35
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
36
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
37
|
+
deleted_at TIMESTAMPTZ,
|
|
38
|
+
CONSTRAINT fk_flashcard_decks_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
|
|
39
|
+
)
|
|
40
|
+
`,await a`
|
|
41
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_name ON flashcard_decks(name)
|
|
42
|
+
`,await a`
|
|
43
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_algorithm ON flashcard_decks(algorithm)
|
|
44
|
+
`,await a`
|
|
45
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_stat_id ON flashcard_decks(stat_id)
|
|
46
|
+
`,await a`
|
|
47
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_status_id ON flashcard_decks(status_id)
|
|
48
|
+
`,await a`
|
|
49
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_language ON flashcard_decks(language)
|
|
50
|
+
`,await a`
|
|
51
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_deleted_at ON flashcard_decks(deleted_at)
|
|
52
|
+
`,await a`
|
|
53
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_is_public ON flashcard_decks(is_public) WHERE deleted_at IS NULL
|
|
54
|
+
`,await a`
|
|
55
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_created_at ON flashcard_decks(created_at DESC)
|
|
56
|
+
`,await a`
|
|
57
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_updated_at ON flashcard_decks(updated_at DESC)
|
|
58
|
+
`,await a`
|
|
59
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_decks_active ON flashcard_decks(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
60
|
+
`}async down(a){await a`DROP TABLE IF EXISTS flashcard_decks CASCADE`,await a`DROP TYPE IF EXISTS flashcard_algorithm CASCADE`}getVersion(){return"20251225181154477"}getDependencies(){return[d]}}T=e([N.migration()],T);import{decorator as i}from"@ooneex/migrations";class E{async up(a){await a`
|
|
61
|
+
CREATE TYPE flashcard_state AS ENUM ('NEW', 'LEARNING', 'REVIEW', 'RELEARNING', 'SUSPENDED')
|
|
62
|
+
`,await a`
|
|
63
|
+
CREATE TABLE IF NOT EXISTS flashcard_schedules (
|
|
64
|
+
id VARCHAR(25) PRIMARY KEY,
|
|
65
|
+
state flashcard_state DEFAULT 'NEW',
|
|
66
|
+
interval INT DEFAULT 0,
|
|
67
|
+
ease_factor DECIMAL(4, 2) DEFAULT 2.5,
|
|
68
|
+
review_count INT DEFAULT 0,
|
|
69
|
+
lapse_count INT DEFAULT 0,
|
|
70
|
+
current_step INT DEFAULT 0,
|
|
71
|
+
due_date TIMESTAMPTZ NOT NULL,
|
|
72
|
+
last_reviewed_at TIMESTAMPTZ,
|
|
73
|
+
difficulty DECIMAL(4, 2),
|
|
74
|
+
stability DECIMAL(10, 4),
|
|
75
|
+
retrievability DECIMAL(4, 3),
|
|
76
|
+
learning_steps JSON DEFAULT '[]',
|
|
77
|
+
relearning_steps JSON DEFAULT '[]',
|
|
78
|
+
is_locked BOOLEAN DEFAULT false,
|
|
79
|
+
locked_at TIMESTAMPTZ,
|
|
80
|
+
is_blocked BOOLEAN DEFAULT false,
|
|
81
|
+
blocked_at TIMESTAMPTZ,
|
|
82
|
+
block_reason TEXT,
|
|
83
|
+
is_public BOOLEAN DEFAULT true,
|
|
84
|
+
language VARCHAR(10),
|
|
85
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
86
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
87
|
+
deleted_at TIMESTAMPTZ
|
|
88
|
+
)
|
|
89
|
+
`,await a`
|
|
90
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_state ON flashcard_schedules(state)
|
|
91
|
+
`,await a`
|
|
92
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_due_date ON flashcard_schedules(due_date)
|
|
93
|
+
`,await a`
|
|
94
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_last_reviewed_at ON flashcard_schedules(last_reviewed_at DESC)
|
|
95
|
+
`,await a`
|
|
96
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_interval ON flashcard_schedules(interval)
|
|
97
|
+
`,await a`
|
|
98
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_language ON flashcard_schedules(language)
|
|
99
|
+
`,await a`
|
|
100
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_deleted_at ON flashcard_schedules(deleted_at)
|
|
101
|
+
`,await a`
|
|
102
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_is_public ON flashcard_schedules(is_public) WHERE deleted_at IS NULL
|
|
103
|
+
`,await a`
|
|
104
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_created_at ON flashcard_schedules(created_at DESC)
|
|
105
|
+
`,await a`
|
|
106
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_active ON flashcard_schedules(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
107
|
+
`,await a`
|
|
108
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_due ON flashcard_schedules(state, due_date) WHERE deleted_at IS NULL AND due_date <= CURRENT_TIMESTAMP
|
|
109
|
+
`}async down(a){await a`DROP TABLE IF EXISTS flashcard_schedules CASCADE`,await a`DROP TYPE IF EXISTS flashcard_state CASCADE`}getVersion(){return"20251225181154480"}getDependencies(){return[]}}E=e([i.migration()],E);import{decorator as t}from"@ooneex/migrations";class s{async up(a){await a`
|
|
110
|
+
CREATE TABLE IF NOT EXISTS flashcards (
|
|
111
|
+
id VARCHAR(25) PRIMARY KEY,
|
|
112
|
+
front TEXT NOT NULL,
|
|
113
|
+
back TEXT NOT NULL,
|
|
114
|
+
hint TEXT,
|
|
115
|
+
context VARCHAR(255),
|
|
116
|
+
context_id VARCHAR(25),
|
|
117
|
+
schedule_id VARCHAR(25) NOT NULL,
|
|
118
|
+
deck_id VARCHAR(25),
|
|
119
|
+
stat_id VARCHAR(25),
|
|
120
|
+
status_id VARCHAR(25),
|
|
121
|
+
image_id VARCHAR(25),
|
|
122
|
+
is_locked BOOLEAN DEFAULT false,
|
|
123
|
+
locked_at TIMESTAMPTZ,
|
|
124
|
+
is_blocked BOOLEAN DEFAULT false,
|
|
125
|
+
blocked_at TIMESTAMPTZ,
|
|
126
|
+
block_reason TEXT,
|
|
127
|
+
is_public BOOLEAN DEFAULT true,
|
|
128
|
+
language VARCHAR(10),
|
|
129
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
130
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
131
|
+
deleted_at TIMESTAMPTZ,
|
|
132
|
+
CONSTRAINT fk_flashcards_schedule FOREIGN KEY (schedule_id) REFERENCES flashcard_schedules(id) ON DELETE CASCADE,
|
|
133
|
+
CONSTRAINT fk_flashcards_deck FOREIGN KEY (deck_id) REFERENCES flashcard_decks(id) ON DELETE SET NULL,
|
|
134
|
+
CONSTRAINT fk_flashcards_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL
|
|
135
|
+
)
|
|
136
|
+
`,await a`
|
|
137
|
+
CREATE TABLE IF NOT EXISTS flashcards_tags (
|
|
138
|
+
flashcard_id VARCHAR(25) NOT NULL,
|
|
139
|
+
tag_id VARCHAR(25) NOT NULL,
|
|
140
|
+
PRIMARY KEY (flashcard_id, tag_id),
|
|
141
|
+
CONSTRAINT fk_flashcards_tags_flashcard FOREIGN KEY (flashcard_id) REFERENCES flashcards(id) ON DELETE CASCADE,
|
|
142
|
+
CONSTRAINT fk_flashcards_tags_tag FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
|
|
143
|
+
)
|
|
144
|
+
`,await a`
|
|
145
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_schedule_id ON flashcards(schedule_id)
|
|
146
|
+
`,await a`
|
|
147
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_deck_id ON flashcards(deck_id)
|
|
148
|
+
`,await a`
|
|
149
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_context ON flashcards(context, context_id)
|
|
150
|
+
`,await a`
|
|
151
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_stat_id ON flashcards(stat_id)
|
|
152
|
+
`,await a`
|
|
153
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_status_id ON flashcards(status_id)
|
|
154
|
+
`,await a`
|
|
155
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_image_id ON flashcards(image_id)
|
|
156
|
+
`,await a`
|
|
157
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_language ON flashcards(language)
|
|
158
|
+
`,await a`
|
|
159
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_deleted_at ON flashcards(deleted_at)
|
|
160
|
+
`,await a`
|
|
161
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_is_public ON flashcards(is_public) WHERE deleted_at IS NULL
|
|
162
|
+
`,await a`
|
|
163
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_created_at ON flashcards(created_at DESC)
|
|
164
|
+
`,await a`
|
|
165
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_updated_at ON flashcards(updated_at DESC)
|
|
166
|
+
`,await a`
|
|
167
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_active ON flashcards(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
168
|
+
`,await a`
|
|
169
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_tags_flashcard_id ON flashcards_tags(flashcard_id)
|
|
170
|
+
`,await a`
|
|
171
|
+
CREATE INDEX IF NOT EXISTS idx_flashcards_tags_tag_id ON flashcards_tags(tag_id)
|
|
172
|
+
`}async down(a){await a`DROP TABLE IF EXISTS flashcards_tags CASCADE`,await a`DROP TABLE IF EXISTS flashcards CASCADE`}getVersion(){return"20251225181154482"}getDependencies(){return[E,T,d,I]}}s=e([t.migration()],s);import{decorator as S}from"@ooneex/migrations";class l{async up(a){await a`
|
|
173
|
+
CREATE TABLE IF NOT EXISTS flashcard_presets (
|
|
174
|
+
id VARCHAR(25) PRIMARY KEY,
|
|
175
|
+
name VARCHAR(500) NOT NULL,
|
|
176
|
+
description TEXT,
|
|
177
|
+
algorithm flashcard_algorithm DEFAULT 'FSRS',
|
|
178
|
+
learning_steps JSON DEFAULT '[1, 10]',
|
|
179
|
+
relearning_steps JSON DEFAULT '[10]',
|
|
180
|
+
graduating_interval INT DEFAULT 1,
|
|
181
|
+
easy_interval INT DEFAULT 4,
|
|
182
|
+
max_interval INT DEFAULT 36500,
|
|
183
|
+
max_new_cards_per_day INT DEFAULT 20,
|
|
184
|
+
max_review_cards_per_day INT DEFAULT 200,
|
|
185
|
+
desired_retention DECIMAL(4, 3) DEFAULT 0.9,
|
|
186
|
+
fsrs_parameters JSON,
|
|
187
|
+
starting_ease_factor DECIMAL(4, 2) DEFAULT 2.5,
|
|
188
|
+
easy_bonus DECIMAL(4, 2) DEFAULT 1.3,
|
|
189
|
+
interval_modifier DECIMAL(4, 2) DEFAULT 1.0,
|
|
190
|
+
hard_interval DECIMAL(4, 2) DEFAULT 1.2,
|
|
191
|
+
new_interval DECIMAL(4, 2) DEFAULT 0.0,
|
|
192
|
+
minimum_interval INT DEFAULT 1,
|
|
193
|
+
leech_threshold INT DEFAULT 8,
|
|
194
|
+
bury_siblings BOOLEAN DEFAULT false,
|
|
195
|
+
show_timer BOOLEAN DEFAULT false,
|
|
196
|
+
auto_play_audio BOOLEAN DEFAULT true,
|
|
197
|
+
is_locked BOOLEAN DEFAULT false,
|
|
198
|
+
locked_at TIMESTAMPTZ,
|
|
199
|
+
is_blocked BOOLEAN DEFAULT false,
|
|
200
|
+
blocked_at TIMESTAMPTZ,
|
|
201
|
+
block_reason TEXT,
|
|
202
|
+
is_public BOOLEAN DEFAULT true,
|
|
203
|
+
language VARCHAR(10),
|
|
204
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
205
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
206
|
+
deleted_at TIMESTAMPTZ
|
|
207
|
+
)
|
|
208
|
+
`,await a`
|
|
209
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_presets_name ON flashcard_presets(name)
|
|
210
|
+
`,await a`
|
|
211
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_presets_algorithm ON flashcard_presets(algorithm)
|
|
212
|
+
`,await a`
|
|
213
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_presets_language ON flashcard_presets(language)
|
|
214
|
+
`,await a`
|
|
215
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_presets_deleted_at ON flashcard_presets(deleted_at)
|
|
216
|
+
`,await a`
|
|
217
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_presets_is_public ON flashcard_presets(is_public) WHERE deleted_at IS NULL
|
|
218
|
+
`,await a`
|
|
219
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_presets_created_at ON flashcard_presets(created_at DESC)
|
|
220
|
+
`,await a`
|
|
221
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_presets_active ON flashcard_presets(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
222
|
+
`}async down(a){await a`DROP TABLE IF EXISTS flashcard_presets CASCADE`}getVersion(){return"20251225181154484"}getDependencies(){return[]}}l=e([S.migration()],l);import{decorator as L}from"@ooneex/migrations";class _{async up(a){await a`
|
|
223
|
+
CREATE TYPE flashcard_session_status AS ENUM ('DRAFT', 'IN_PROGRESS', 'PAUSED', 'COMPLETED', 'CANCELLED')
|
|
224
|
+
`,await a`
|
|
225
|
+
CREATE TABLE IF NOT EXISTS flashcard_sessions (
|
|
226
|
+
id VARCHAR(25) PRIMARY KEY,
|
|
227
|
+
name VARCHAR(500) NOT NULL,
|
|
228
|
+
total_cards INT DEFAULT 0,
|
|
229
|
+
new_cards_count INT DEFAULT 0,
|
|
230
|
+
learning_cards_count INT DEFAULT 0,
|
|
231
|
+
review_cards_count INT DEFAULT 0,
|
|
232
|
+
studied_count INT DEFAULT 0,
|
|
233
|
+
correct_count INT DEFAULT 0,
|
|
234
|
+
incorrect_count INT DEFAULT 0,
|
|
235
|
+
study_time INT DEFAULT 0,
|
|
236
|
+
status flashcard_session_status DEFAULT 'DRAFT',
|
|
237
|
+
score DECIMAL(5, 2) DEFAULT 0,
|
|
238
|
+
started_at TIMESTAMPTZ,
|
|
239
|
+
paused_at TIMESTAMPTZ,
|
|
240
|
+
resumed_at TIMESTAMPTZ,
|
|
241
|
+
completed_at TIMESTAMPTZ,
|
|
242
|
+
type session_type NOT NULL,
|
|
243
|
+
level_id VARCHAR(25) NOT NULL,
|
|
244
|
+
algorithm flashcard_algorithm DEFAULT 'FSRS',
|
|
245
|
+
max_new_cards INT DEFAULT 20,
|
|
246
|
+
max_review_cards INT DEFAULT 200,
|
|
247
|
+
desired_retention DECIMAL(4, 3) DEFAULT 0.9,
|
|
248
|
+
learning_steps JSON DEFAULT '[1, 10]',
|
|
249
|
+
graduating_interval INT DEFAULT 1,
|
|
250
|
+
easy_interval INT DEFAULT 4,
|
|
251
|
+
max_interval INT DEFAULT 36500,
|
|
252
|
+
is_locked BOOLEAN DEFAULT false,
|
|
253
|
+
locked_at TIMESTAMPTZ,
|
|
254
|
+
is_blocked BOOLEAN DEFAULT false,
|
|
255
|
+
blocked_at TIMESTAMPTZ,
|
|
256
|
+
block_reason TEXT,
|
|
257
|
+
is_public BOOLEAN DEFAULT true,
|
|
258
|
+
language VARCHAR(10),
|
|
259
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
260
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
261
|
+
deleted_at TIMESTAMPTZ,
|
|
262
|
+
CONSTRAINT fk_flashcard_sessions_level FOREIGN KEY (level_id) REFERENCES levels(id) ON DELETE RESTRICT
|
|
263
|
+
)
|
|
264
|
+
`,await a`
|
|
265
|
+
CREATE TABLE IF NOT EXISTS flashcard_sessions_cards (
|
|
266
|
+
session_id VARCHAR(25) NOT NULL,
|
|
267
|
+
flashcard_id VARCHAR(25) NOT NULL,
|
|
268
|
+
PRIMARY KEY (session_id, flashcard_id),
|
|
269
|
+
CONSTRAINT fk_flashcard_sessions_cards_session FOREIGN KEY (session_id) REFERENCES flashcard_sessions(id) ON DELETE CASCADE,
|
|
270
|
+
CONSTRAINT fk_flashcard_sessions_cards_flashcard FOREIGN KEY (flashcard_id) REFERENCES flashcards(id) ON DELETE CASCADE
|
|
271
|
+
)
|
|
272
|
+
`,await a`
|
|
273
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_name ON flashcard_sessions(name)
|
|
274
|
+
`,await a`
|
|
275
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_status ON flashcard_sessions(status)
|
|
276
|
+
`,await a`
|
|
277
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_type ON flashcard_sessions(type)
|
|
278
|
+
`,await a`
|
|
279
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_level_id ON flashcard_sessions(level_id)
|
|
280
|
+
`,await a`
|
|
281
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_algorithm ON flashcard_sessions(algorithm)
|
|
282
|
+
`,await a`
|
|
283
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_score ON flashcard_sessions(score DESC)
|
|
284
|
+
`,await a`
|
|
285
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_started_at ON flashcard_sessions(started_at DESC)
|
|
286
|
+
`,await a`
|
|
287
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_completed_at ON flashcard_sessions(completed_at DESC)
|
|
288
|
+
`,await a`
|
|
289
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_language ON flashcard_sessions(language)
|
|
290
|
+
`,await a`
|
|
291
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_deleted_at ON flashcard_sessions(deleted_at)
|
|
292
|
+
`,await a`
|
|
293
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_is_public ON flashcard_sessions(is_public) WHERE deleted_at IS NULL
|
|
294
|
+
`,await a`
|
|
295
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_created_at ON flashcard_sessions(created_at DESC)
|
|
296
|
+
`,await a`
|
|
297
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_updated_at ON flashcard_sessions(updated_at DESC)
|
|
298
|
+
`,await a`
|
|
299
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_active ON flashcard_sessions(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
300
|
+
`,await a`
|
|
301
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_performance ON flashcard_sessions(type, score DESC, completed_at DESC) WHERE status = 'COMPLETED' AND deleted_at IS NULL
|
|
302
|
+
`,await a`
|
|
303
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_cards_session_id ON flashcard_sessions_cards(session_id)
|
|
304
|
+
`,await a`
|
|
305
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_cards_flashcard_id ON flashcard_sessions_cards(flashcard_id)
|
|
306
|
+
`}async down(a){await a`DROP TABLE IF EXISTS flashcard_sessions_cards CASCADE`,await a`DROP TABLE IF EXISTS flashcard_sessions CASCADE`,await a`DROP TYPE IF EXISTS flashcard_session_status CASCADE`}getVersion(){return"20251225181154486"}getDependencies(){return[A,s]}}_=e([L.migration()],_);import{decorator as D}from"@ooneex/migrations";class r{async up(a){await a`
|
|
307
|
+
CREATE TYPE flashcard_rating AS ENUM ('AGAIN', 'HARD', 'GOOD', 'EASY')
|
|
308
|
+
`,await a`
|
|
309
|
+
CREATE TABLE IF NOT EXISTS flashcard_reviews (
|
|
310
|
+
id VARCHAR(25) PRIMARY KEY,
|
|
311
|
+
card_id VARCHAR(25) NOT NULL,
|
|
312
|
+
session_id VARCHAR(25) NOT NULL,
|
|
313
|
+
rating flashcard_rating NOT NULL,
|
|
314
|
+
response_time INT NOT NULL,
|
|
315
|
+
previous_interval INT NOT NULL,
|
|
316
|
+
new_interval INT NOT NULL,
|
|
317
|
+
previous_ease_factor DECIMAL(4, 2) NOT NULL,
|
|
318
|
+
new_ease_factor DECIMAL(4, 2) NOT NULL,
|
|
319
|
+
previous_due_date TIMESTAMPTZ NOT NULL,
|
|
320
|
+
new_due_date TIMESTAMPTZ NOT NULL,
|
|
321
|
+
previous_state flashcard_state NOT NULL,
|
|
322
|
+
new_state flashcard_state NOT NULL,
|
|
323
|
+
was_lapse BOOLEAN DEFAULT false,
|
|
324
|
+
algorithm flashcard_algorithm NOT NULL,
|
|
325
|
+
reviewed_at TIMESTAMPTZ NOT NULL,
|
|
326
|
+
is_locked BOOLEAN DEFAULT false,
|
|
327
|
+
locked_at TIMESTAMPTZ,
|
|
328
|
+
is_blocked BOOLEAN DEFAULT false,
|
|
329
|
+
blocked_at TIMESTAMPTZ,
|
|
330
|
+
block_reason TEXT,
|
|
331
|
+
is_public BOOLEAN DEFAULT true,
|
|
332
|
+
language VARCHAR(10),
|
|
333
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
334
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
335
|
+
deleted_at TIMESTAMPTZ,
|
|
336
|
+
CONSTRAINT fk_flashcard_reviews_card FOREIGN KEY (card_id) REFERENCES flashcards(id) ON DELETE CASCADE,
|
|
337
|
+
CONSTRAINT fk_flashcard_reviews_session FOREIGN KEY (session_id) REFERENCES flashcard_sessions(id) ON DELETE CASCADE
|
|
338
|
+
)
|
|
339
|
+
`,await a`
|
|
340
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_card_id ON flashcard_reviews(card_id)
|
|
341
|
+
`,await a`
|
|
342
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_session_id ON flashcard_reviews(session_id)
|
|
343
|
+
`,await a`
|
|
344
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_rating ON flashcard_reviews(rating)
|
|
345
|
+
`,await a`
|
|
346
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_algorithm ON flashcard_reviews(algorithm)
|
|
347
|
+
`,await a`
|
|
348
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_reviewed_at ON flashcard_reviews(reviewed_at DESC)
|
|
349
|
+
`,await a`
|
|
350
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_was_lapse ON flashcard_reviews(was_lapse) WHERE was_lapse = true
|
|
351
|
+
`,await a`
|
|
352
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_language ON flashcard_reviews(language)
|
|
353
|
+
`,await a`
|
|
354
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_deleted_at ON flashcard_reviews(deleted_at)
|
|
355
|
+
`,await a`
|
|
356
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_is_public ON flashcard_reviews(is_public) WHERE deleted_at IS NULL
|
|
357
|
+
`,await a`
|
|
358
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_created_at ON flashcard_reviews(created_at DESC)
|
|
359
|
+
`,await a`
|
|
360
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_active ON flashcard_reviews(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
361
|
+
`,await a`
|
|
362
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_card_reviewed ON flashcard_reviews(card_id, reviewed_at DESC)
|
|
363
|
+
`,await a`
|
|
364
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_session_reviewed ON flashcard_reviews(session_id, reviewed_at DESC)
|
|
365
|
+
`}async down(a){await a`DROP TABLE IF EXISTS flashcard_reviews CASCADE`,await a`DROP TYPE IF EXISTS flashcard_rating CASCADE`}getVersion(){return"20251225181154489"}getDependencies(){return[s,_]}}r=e([D.migration()],r);import{decorator as u}from"@ooneex/migrations";class c{async up(a){await a`
|
|
366
|
+
CREATE TABLE IF NOT EXISTS flashcard_stats (
|
|
367
|
+
id VARCHAR(25) PRIMARY KEY,
|
|
368
|
+
cards_studied_today INT DEFAULT 0,
|
|
369
|
+
time_spent_today INT DEFAULT 0,
|
|
370
|
+
current_streak INT DEFAULT 0,
|
|
371
|
+
longest_streak INT DEFAULT 0,
|
|
372
|
+
total_reviews INT DEFAULT 0,
|
|
373
|
+
total_study_time INT DEFAULT 0,
|
|
374
|
+
retention_rate DECIMAL(5, 4) DEFAULT 0.0,
|
|
375
|
+
new_cards_count INT DEFAULT 0,
|
|
376
|
+
learning_cards_count INT DEFAULT 0,
|
|
377
|
+
review_cards_count INT DEFAULT 0,
|
|
378
|
+
suspended_cards_count INT DEFAULT 0,
|
|
379
|
+
mature_cards_count INT DEFAULT 0,
|
|
380
|
+
young_cards_count INT DEFAULT 0,
|
|
381
|
+
again_count INT DEFAULT 0,
|
|
382
|
+
hard_count INT DEFAULT 0,
|
|
383
|
+
good_count INT DEFAULT 0,
|
|
384
|
+
easy_count INT DEFAULT 0,
|
|
385
|
+
start_date TIMESTAMPTZ NOT NULL,
|
|
386
|
+
end_date TIMESTAMPTZ NOT NULL,
|
|
387
|
+
is_locked BOOLEAN DEFAULT false,
|
|
388
|
+
locked_at TIMESTAMPTZ,
|
|
389
|
+
is_blocked BOOLEAN DEFAULT false,
|
|
390
|
+
blocked_at TIMESTAMPTZ,
|
|
391
|
+
block_reason TEXT,
|
|
392
|
+
is_public BOOLEAN DEFAULT true,
|
|
393
|
+
language VARCHAR(10),
|
|
394
|
+
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
395
|
+
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
396
|
+
deleted_at TIMESTAMPTZ
|
|
397
|
+
)
|
|
398
|
+
`,await a`
|
|
399
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_start_date ON flashcard_stats(start_date DESC)
|
|
400
|
+
`,await a`
|
|
401
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_end_date ON flashcard_stats(end_date DESC)
|
|
402
|
+
`,await a`
|
|
403
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_current_streak ON flashcard_stats(current_streak DESC)
|
|
404
|
+
`,await a`
|
|
405
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_retention_rate ON flashcard_stats(retention_rate DESC)
|
|
406
|
+
`,await a`
|
|
407
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_language ON flashcard_stats(language)
|
|
408
|
+
`,await a`
|
|
409
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_deleted_at ON flashcard_stats(deleted_at)
|
|
410
|
+
`,await a`
|
|
411
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_is_public ON flashcard_stats(is_public) WHERE deleted_at IS NULL
|
|
412
|
+
`,await a`
|
|
413
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_created_at ON flashcard_stats(created_at DESC)
|
|
414
|
+
`,await a`
|
|
415
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_active ON flashcard_stats(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false
|
|
416
|
+
`,await a`
|
|
417
|
+
CREATE INDEX IF NOT EXISTS idx_flashcard_stats_date_range ON flashcard_stats(start_date, end_date) WHERE deleted_at IS NULL
|
|
418
|
+
`}async down(a){await a`DROP TABLE IF EXISTS flashcard_stats CASCADE`}getVersion(){return"20251225181154491"}getDependencies(){return[]}}c=e([u.migration()],c);export{c as Migration20251225181154491,r as Migration20251225181154489,_ as Migration20251225181154486,l as Migration20251225181154484,s as Migration20251225181154482,E as Migration20251225181154480,T as Migration20251225181154477};
|
|
419
|
+
|
|
420
|
+
//# debugId=406950EDCBB3A39064756E2164756E21
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/migrations/gamification/flashcard/Migration20251225181154477.ts", "src/migrations/gamification/flashcard/Migration20251225181154480.ts", "src/migrations/gamification/flashcard/Migration20251225181154482.ts", "src/migrations/gamification/flashcard/Migration20251225181154484.ts", "src/migrations/gamification/flashcard/Migration20251225181154486.ts", "src/migrations/gamification/flashcard/Migration20251225181154489.ts", "src/migrations/gamification/flashcard/Migration20251225181154491.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { decorator, type IMigration, type MigrationClassType } from \"@ooneex/migrations\";\nimport type { TransactionSQL } from \"bun\";\nimport { Migration20251225173350644 } from \"../../common/Migration20251225173350644\";\n\n@decorator.migration()\nexport class Migration20251225181154477 implements IMigration {\n public async up(tx: TransactionSQL): Promise<void> {\n await tx`\n CREATE TYPE flashcard_algorithm AS ENUM ('FSRS', 'SM2', 'ANKI')\n `;\n\n await tx`\n CREATE TABLE IF NOT EXISTS flashcard_decks (\n id VARCHAR(25) PRIMARY KEY,\n name VARCHAR(500) NOT NULL,\n description TEXT,\n total_cards INT DEFAULT 0,\n new_cards INT DEFAULT 0,\n learning_cards INT DEFAULT 0,\n due_cards INT DEFAULT 0,\n suspended_cards INT DEFAULT 0,\n algorithm flashcard_algorithm DEFAULT 'FSRS',\n max_new_cards_per_day INT DEFAULT 20,\n max_review_cards_per_day INT DEFAULT 200,\n desired_retention DECIMAL(4, 3) DEFAULT 0.9,\n learning_steps JSON DEFAULT '[1, 10]',\n relearning_steps JSON DEFAULT '[10]',\n graduating_interval INT DEFAULT 1,\n easy_interval INT DEFAULT 4,\n max_interval INT DEFAULT 36500,\n fsrs_parameters JSON,\n leech_threshold INT DEFAULT 8,\n bury_siblings BOOLEAN DEFAULT false,\n stat_id VARCHAR(25),\n status_id VARCHAR(25),\n is_locked BOOLEAN DEFAULT false,\n locked_at TIMESTAMPTZ,\n is_blocked BOOLEAN DEFAULT false,\n blocked_at TIMESTAMPTZ,\n block_reason TEXT,\n is_public BOOLEAN DEFAULT true,\n language VARCHAR(10),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n deleted_at TIMESTAMPTZ,\n CONSTRAINT fk_flashcard_decks_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL\n )\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_name ON flashcard_decks(name)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_algorithm ON flashcard_decks(algorithm)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_stat_id ON flashcard_decks(stat_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_status_id ON flashcard_decks(status_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_language ON flashcard_decks(language)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_deleted_at ON flashcard_decks(deleted_at)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_is_public ON flashcard_decks(is_public) WHERE deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_created_at ON flashcard_decks(created_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_updated_at ON flashcard_decks(updated_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_decks_active ON flashcard_decks(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false\n `;\n }\n\n public async down(tx: TransactionSQL): Promise<void> {\n await tx`DROP TABLE IF EXISTS flashcard_decks CASCADE`;\n await tx`DROP TYPE IF EXISTS flashcard_algorithm CASCADE`;\n }\n\n public getVersion(): string {\n return \"20251225181154477\";\n }\n\n public getDependencies(): MigrationClassType[] {\n return [\n Migration20251225173350644, // Statuses table (for status_id foreign key)\n ];\n }\n}\n",
|
|
6
|
+
"import { decorator, type IMigration, type MigrationClassType } from \"@ooneex/migrations\";\nimport type { TransactionSQL } from \"bun\";\n\n@decorator.migration()\nexport class Migration20251225181154480 implements IMigration {\n public async up(tx: TransactionSQL): Promise<void> {\n await tx`\n CREATE TYPE flashcard_state AS ENUM ('NEW', 'LEARNING', 'REVIEW', 'RELEARNING', 'SUSPENDED')\n `;\n\n await tx`\n CREATE TABLE IF NOT EXISTS flashcard_schedules (\n id VARCHAR(25) PRIMARY KEY,\n state flashcard_state DEFAULT 'NEW',\n interval INT DEFAULT 0,\n ease_factor DECIMAL(4, 2) DEFAULT 2.5,\n review_count INT DEFAULT 0,\n lapse_count INT DEFAULT 0,\n current_step INT DEFAULT 0,\n due_date TIMESTAMPTZ NOT NULL,\n last_reviewed_at TIMESTAMPTZ,\n difficulty DECIMAL(4, 2),\n stability DECIMAL(10, 4),\n retrievability DECIMAL(4, 3),\n learning_steps JSON DEFAULT '[]',\n relearning_steps JSON DEFAULT '[]',\n is_locked BOOLEAN DEFAULT false,\n locked_at TIMESTAMPTZ,\n is_blocked BOOLEAN DEFAULT false,\n blocked_at TIMESTAMPTZ,\n block_reason TEXT,\n is_public BOOLEAN DEFAULT true,\n language VARCHAR(10),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n deleted_at TIMESTAMPTZ\n )\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_state ON flashcard_schedules(state)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_due_date ON flashcard_schedules(due_date)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_last_reviewed_at ON flashcard_schedules(last_reviewed_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_interval ON flashcard_schedules(interval)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_language ON flashcard_schedules(language)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_deleted_at ON flashcard_schedules(deleted_at)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_is_public ON flashcard_schedules(is_public) WHERE deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_created_at ON flashcard_schedules(created_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_active ON flashcard_schedules(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_schedules_due ON flashcard_schedules(state, due_date) WHERE deleted_at IS NULL AND due_date <= CURRENT_TIMESTAMP\n `;\n }\n\n public async down(tx: TransactionSQL): Promise<void> {\n await tx`DROP TABLE IF EXISTS flashcard_schedules CASCADE`;\n await tx`DROP TYPE IF EXISTS flashcard_state CASCADE`;\n }\n\n public getVersion(): string {\n return \"20251225181154480\";\n }\n\n public getDependencies(): MigrationClassType[] {\n return [];\n }\n}\n",
|
|
7
|
+
"import { decorator, type IMigration, type MigrationClassType } from \"@ooneex/migrations\";\nimport type { TransactionSQL } from \"bun\";\nimport { Migration20251225173350644 } from \"../../common/Migration20251225173350644\";\nimport { Migration20251225173351645 } from \"../../common/Migration20251225173351645\";\nimport { Migration20251225181154477 } from \"./Migration20251225181154477\";\nimport { Migration20251225181154480 } from \"./Migration20251225181154480\";\n\n@decorator.migration()\nexport class Migration20251225181154482 implements IMigration {\n public async up(tx: TransactionSQL): Promise<void> {\n await tx`\n CREATE TABLE IF NOT EXISTS flashcards (\n id VARCHAR(25) PRIMARY KEY,\n front TEXT NOT NULL,\n back TEXT NOT NULL,\n hint TEXT,\n context VARCHAR(255),\n context_id VARCHAR(25),\n schedule_id VARCHAR(25) NOT NULL,\n deck_id VARCHAR(25),\n stat_id VARCHAR(25),\n status_id VARCHAR(25),\n image_id VARCHAR(25),\n is_locked BOOLEAN DEFAULT false,\n locked_at TIMESTAMPTZ,\n is_blocked BOOLEAN DEFAULT false,\n blocked_at TIMESTAMPTZ,\n block_reason TEXT,\n is_public BOOLEAN DEFAULT true,\n language VARCHAR(10),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n deleted_at TIMESTAMPTZ,\n CONSTRAINT fk_flashcards_schedule FOREIGN KEY (schedule_id) REFERENCES flashcard_schedules(id) ON DELETE CASCADE,\n CONSTRAINT fk_flashcards_deck FOREIGN KEY (deck_id) REFERENCES flashcard_decks(id) ON DELETE SET NULL,\n CONSTRAINT fk_flashcards_status FOREIGN KEY (status_id) REFERENCES statuses(id) ON DELETE SET NULL\n )\n `;\n\n await tx`\n CREATE TABLE IF NOT EXISTS flashcards_tags (\n flashcard_id VARCHAR(25) NOT NULL,\n tag_id VARCHAR(25) NOT NULL,\n PRIMARY KEY (flashcard_id, tag_id),\n CONSTRAINT fk_flashcards_tags_flashcard FOREIGN KEY (flashcard_id) REFERENCES flashcards(id) ON DELETE CASCADE,\n CONSTRAINT fk_flashcards_tags_tag FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE\n )\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_schedule_id ON flashcards(schedule_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_deck_id ON flashcards(deck_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_context ON flashcards(context, context_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_stat_id ON flashcards(stat_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_status_id ON flashcards(status_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_image_id ON flashcards(image_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_language ON flashcards(language)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_deleted_at ON flashcards(deleted_at)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_is_public ON flashcards(is_public) WHERE deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_created_at ON flashcards(created_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_updated_at ON flashcards(updated_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_active ON flashcards(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_tags_flashcard_id ON flashcards_tags(flashcard_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcards_tags_tag_id ON flashcards_tags(tag_id)\n `;\n }\n\n public async down(tx: TransactionSQL): Promise<void> {\n await tx`DROP TABLE IF EXISTS flashcards_tags CASCADE`;\n await tx`DROP TABLE IF EXISTS flashcards CASCADE`;\n }\n\n public getVersion(): string {\n return \"20251225181154482\";\n }\n\n public getDependencies(): MigrationClassType[] {\n return [\n Migration20251225181154480, // Flashcard schedules table (for schedule_id foreign key)\n Migration20251225181154477, // Flashcard decks table (for deck_id foreign key)\n Migration20251225173350644, // Statuses table (for status_id foreign key)\n Migration20251225173351645, // Tags table (for flashcards_tags junction table)\n ];\n }\n}\n",
|
|
8
|
+
"import { decorator, type IMigration, type MigrationClassType } from \"@ooneex/migrations\";\nimport type { TransactionSQL } from \"bun\";\n\n@decorator.migration()\nexport class Migration20251225181154484 implements IMigration {\n public async up(tx: TransactionSQL): Promise<void> {\n await tx`\n CREATE TABLE IF NOT EXISTS flashcard_presets (\n id VARCHAR(25) PRIMARY KEY,\n name VARCHAR(500) NOT NULL,\n description TEXT,\n algorithm flashcard_algorithm DEFAULT 'FSRS',\n learning_steps JSON DEFAULT '[1, 10]',\n relearning_steps JSON DEFAULT '[10]',\n graduating_interval INT DEFAULT 1,\n easy_interval INT DEFAULT 4,\n max_interval INT DEFAULT 36500,\n max_new_cards_per_day INT DEFAULT 20,\n max_review_cards_per_day INT DEFAULT 200,\n desired_retention DECIMAL(4, 3) DEFAULT 0.9,\n fsrs_parameters JSON,\n starting_ease_factor DECIMAL(4, 2) DEFAULT 2.5,\n easy_bonus DECIMAL(4, 2) DEFAULT 1.3,\n interval_modifier DECIMAL(4, 2) DEFAULT 1.0,\n hard_interval DECIMAL(4, 2) DEFAULT 1.2,\n new_interval DECIMAL(4, 2) DEFAULT 0.0,\n minimum_interval INT DEFAULT 1,\n leech_threshold INT DEFAULT 8,\n bury_siblings BOOLEAN DEFAULT false,\n show_timer BOOLEAN DEFAULT false,\n auto_play_audio BOOLEAN DEFAULT true,\n is_locked BOOLEAN DEFAULT false,\n locked_at TIMESTAMPTZ,\n is_blocked BOOLEAN DEFAULT false,\n blocked_at TIMESTAMPTZ,\n block_reason TEXT,\n is_public BOOLEAN DEFAULT true,\n language VARCHAR(10),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n deleted_at TIMESTAMPTZ\n )\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_presets_name ON flashcard_presets(name)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_presets_algorithm ON flashcard_presets(algorithm)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_presets_language ON flashcard_presets(language)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_presets_deleted_at ON flashcard_presets(deleted_at)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_presets_is_public ON flashcard_presets(is_public) WHERE deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_presets_created_at ON flashcard_presets(created_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_presets_active ON flashcard_presets(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false\n `;\n }\n\n public async down(tx: TransactionSQL): Promise<void> {\n await tx`DROP TABLE IF EXISTS flashcard_presets CASCADE`;\n }\n\n public getVersion(): string {\n return \"20251225181154484\";\n }\n\n public getDependencies(): MigrationClassType[] {\n return [];\n }\n}\n",
|
|
9
|
+
"import { decorator, type IMigration, type MigrationClassType } from \"@ooneex/migrations\";\nimport type { TransactionSQL } from \"bun\";\nimport { Migration20251225180910444 } from \"../Migration20251225180910444\";\nimport { Migration20251225181154482 } from \"./Migration20251225181154482\";\n\n@decorator.migration()\nexport class Migration20251225181154486 implements IMigration {\n public async up(tx: TransactionSQL): Promise<void> {\n await tx`\n CREATE TYPE flashcard_session_status AS ENUM ('DRAFT', 'IN_PROGRESS', 'PAUSED', 'COMPLETED', 'CANCELLED')\n `;\n\n await tx`\n CREATE TABLE IF NOT EXISTS flashcard_sessions (\n id VARCHAR(25) PRIMARY KEY,\n name VARCHAR(500) NOT NULL,\n total_cards INT DEFAULT 0,\n new_cards_count INT DEFAULT 0,\n learning_cards_count INT DEFAULT 0,\n review_cards_count INT DEFAULT 0,\n studied_count INT DEFAULT 0,\n correct_count INT DEFAULT 0,\n incorrect_count INT DEFAULT 0,\n study_time INT DEFAULT 0,\n status flashcard_session_status DEFAULT 'DRAFT',\n score DECIMAL(5, 2) DEFAULT 0,\n started_at TIMESTAMPTZ,\n paused_at TIMESTAMPTZ,\n resumed_at TIMESTAMPTZ,\n completed_at TIMESTAMPTZ,\n type session_type NOT NULL,\n level_id VARCHAR(25) NOT NULL,\n algorithm flashcard_algorithm DEFAULT 'FSRS',\n max_new_cards INT DEFAULT 20,\n max_review_cards INT DEFAULT 200,\n desired_retention DECIMAL(4, 3) DEFAULT 0.9,\n learning_steps JSON DEFAULT '[1, 10]',\n graduating_interval INT DEFAULT 1,\n easy_interval INT DEFAULT 4,\n max_interval INT DEFAULT 36500,\n is_locked BOOLEAN DEFAULT false,\n locked_at TIMESTAMPTZ,\n is_blocked BOOLEAN DEFAULT false,\n blocked_at TIMESTAMPTZ,\n block_reason TEXT,\n is_public BOOLEAN DEFAULT true,\n language VARCHAR(10),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n deleted_at TIMESTAMPTZ,\n CONSTRAINT fk_flashcard_sessions_level FOREIGN KEY (level_id) REFERENCES levels(id) ON DELETE RESTRICT\n )\n `;\n\n await tx`\n CREATE TABLE IF NOT EXISTS flashcard_sessions_cards (\n session_id VARCHAR(25) NOT NULL,\n flashcard_id VARCHAR(25) NOT NULL,\n PRIMARY KEY (session_id, flashcard_id),\n CONSTRAINT fk_flashcard_sessions_cards_session FOREIGN KEY (session_id) REFERENCES flashcard_sessions(id) ON DELETE CASCADE,\n CONSTRAINT fk_flashcard_sessions_cards_flashcard FOREIGN KEY (flashcard_id) REFERENCES flashcards(id) ON DELETE CASCADE\n )\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_name ON flashcard_sessions(name)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_status ON flashcard_sessions(status)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_type ON flashcard_sessions(type)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_level_id ON flashcard_sessions(level_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_algorithm ON flashcard_sessions(algorithm)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_score ON flashcard_sessions(score DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_started_at ON flashcard_sessions(started_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_completed_at ON flashcard_sessions(completed_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_language ON flashcard_sessions(language)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_deleted_at ON flashcard_sessions(deleted_at)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_is_public ON flashcard_sessions(is_public) WHERE deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_created_at ON flashcard_sessions(created_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_updated_at ON flashcard_sessions(updated_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_active ON flashcard_sessions(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_performance ON flashcard_sessions(type, score DESC, completed_at DESC) WHERE status = 'COMPLETED' AND deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_cards_session_id ON flashcard_sessions_cards(session_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_sessions_cards_flashcard_id ON flashcard_sessions_cards(flashcard_id)\n `;\n }\n\n public async down(tx: TransactionSQL): Promise<void> {\n await tx`DROP TABLE IF EXISTS flashcard_sessions_cards CASCADE`;\n await tx`DROP TABLE IF EXISTS flashcard_sessions CASCADE`;\n await tx`DROP TYPE IF EXISTS flashcard_session_status CASCADE`;\n }\n\n public getVersion(): string {\n return \"20251225181154486\";\n }\n\n public getDependencies(): MigrationClassType[] {\n return [\n Migration20251225180910444, // Levels table (for level_id foreign key)\n Migration20251225181154482, // Flashcards table (for flashcard_sessions_cards junction table)\n ];\n }\n}\n",
|
|
10
|
+
"import { decorator, type IMigration, type MigrationClassType } from \"@ooneex/migrations\";\nimport type { TransactionSQL } from \"bun\";\nimport { Migration20251225181154482 } from \"./Migration20251225181154482\";\nimport { Migration20251225181154486 } from \"./Migration20251225181154486\";\n\n@decorator.migration()\nexport class Migration20251225181154489 implements IMigration {\n public async up(tx: TransactionSQL): Promise<void> {\n await tx`\n CREATE TYPE flashcard_rating AS ENUM ('AGAIN', 'HARD', 'GOOD', 'EASY')\n `;\n\n await tx`\n CREATE TABLE IF NOT EXISTS flashcard_reviews (\n id VARCHAR(25) PRIMARY KEY,\n card_id VARCHAR(25) NOT NULL,\n session_id VARCHAR(25) NOT NULL,\n rating flashcard_rating NOT NULL,\n response_time INT NOT NULL,\n previous_interval INT NOT NULL,\n new_interval INT NOT NULL,\n previous_ease_factor DECIMAL(4, 2) NOT NULL,\n new_ease_factor DECIMAL(4, 2) NOT NULL,\n previous_due_date TIMESTAMPTZ NOT NULL,\n new_due_date TIMESTAMPTZ NOT NULL,\n previous_state flashcard_state NOT NULL,\n new_state flashcard_state NOT NULL,\n was_lapse BOOLEAN DEFAULT false,\n algorithm flashcard_algorithm NOT NULL,\n reviewed_at TIMESTAMPTZ NOT NULL,\n is_locked BOOLEAN DEFAULT false,\n locked_at TIMESTAMPTZ,\n is_blocked BOOLEAN DEFAULT false,\n blocked_at TIMESTAMPTZ,\n block_reason TEXT,\n is_public BOOLEAN DEFAULT true,\n language VARCHAR(10),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n deleted_at TIMESTAMPTZ,\n CONSTRAINT fk_flashcard_reviews_card FOREIGN KEY (card_id) REFERENCES flashcards(id) ON DELETE CASCADE,\n CONSTRAINT fk_flashcard_reviews_session FOREIGN KEY (session_id) REFERENCES flashcard_sessions(id) ON DELETE CASCADE\n )\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_card_id ON flashcard_reviews(card_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_session_id ON flashcard_reviews(session_id)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_rating ON flashcard_reviews(rating)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_algorithm ON flashcard_reviews(algorithm)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_reviewed_at ON flashcard_reviews(reviewed_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_was_lapse ON flashcard_reviews(was_lapse) WHERE was_lapse = true\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_language ON flashcard_reviews(language)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_deleted_at ON flashcard_reviews(deleted_at)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_is_public ON flashcard_reviews(is_public) WHERE deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_created_at ON flashcard_reviews(created_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_active ON flashcard_reviews(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_card_reviewed ON flashcard_reviews(card_id, reviewed_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_reviews_session_reviewed ON flashcard_reviews(session_id, reviewed_at DESC)\n `;\n }\n\n public async down(tx: TransactionSQL): Promise<void> {\n await tx`DROP TABLE IF EXISTS flashcard_reviews CASCADE`;\n await tx`DROP TYPE IF EXISTS flashcard_rating CASCADE`;\n }\n\n public getVersion(): string {\n return \"20251225181154489\";\n }\n\n public getDependencies(): MigrationClassType[] {\n return [\n Migration20251225181154482, // Flashcards table (for card_id foreign key)\n Migration20251225181154486, // Flashcard sessions table (for session_id foreign key)\n ];\n }\n}\n",
|
|
11
|
+
"import { decorator, type IMigration, type MigrationClassType } from \"@ooneex/migrations\";\nimport type { TransactionSQL } from \"bun\";\n\n@decorator.migration()\nexport class Migration20251225181154491 implements IMigration {\n public async up(tx: TransactionSQL): Promise<void> {\n await tx`\n CREATE TABLE IF NOT EXISTS flashcard_stats (\n id VARCHAR(25) PRIMARY KEY,\n cards_studied_today INT DEFAULT 0,\n time_spent_today INT DEFAULT 0,\n current_streak INT DEFAULT 0,\n longest_streak INT DEFAULT 0,\n total_reviews INT DEFAULT 0,\n total_study_time INT DEFAULT 0,\n retention_rate DECIMAL(5, 4) DEFAULT 0.0,\n new_cards_count INT DEFAULT 0,\n learning_cards_count INT DEFAULT 0,\n review_cards_count INT DEFAULT 0,\n suspended_cards_count INT DEFAULT 0,\n mature_cards_count INT DEFAULT 0,\n young_cards_count INT DEFAULT 0,\n again_count INT DEFAULT 0,\n hard_count INT DEFAULT 0,\n good_count INT DEFAULT 0,\n easy_count INT DEFAULT 0,\n start_date TIMESTAMPTZ NOT NULL,\n end_date TIMESTAMPTZ NOT NULL,\n is_locked BOOLEAN DEFAULT false,\n locked_at TIMESTAMPTZ,\n is_blocked BOOLEAN DEFAULT false,\n blocked_at TIMESTAMPTZ,\n block_reason TEXT,\n is_public BOOLEAN DEFAULT true,\n language VARCHAR(10),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n deleted_at TIMESTAMPTZ\n )\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_start_date ON flashcard_stats(start_date DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_end_date ON flashcard_stats(end_date DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_current_streak ON flashcard_stats(current_streak DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_retention_rate ON flashcard_stats(retention_rate DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_language ON flashcard_stats(language)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_deleted_at ON flashcard_stats(deleted_at)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_is_public ON flashcard_stats(is_public) WHERE deleted_at IS NULL\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_created_at ON flashcard_stats(created_at DESC)\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_active ON flashcard_stats(is_blocked, is_locked) WHERE deleted_at IS NULL AND is_blocked = false\n `;\n\n await tx`\n CREATE INDEX IF NOT EXISTS idx_flashcard_stats_date_range ON flashcard_stats(start_date, end_date) WHERE deleted_at IS NULL\n `;\n }\n\n public async down(tx: TransactionSQL): Promise<void> {\n await tx`DROP TABLE IF EXISTS flashcard_stats CASCADE`;\n }\n\n public getVersion(): string {\n return \"20251225181154491\";\n }\n\n public getDependencies(): MigrationClassType[] {\n return [];\n }\n}\n"
|
|
12
|
+
],
|
|
13
|
+
"mappings": "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",
|
|
14
|
+
"debugId": "406950EDCBB3A39064756E2164756E21",
|
|
15
|
+
"names": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IMigration, MigrationClassType } from "@ooneex/migrations";
|
|
2
|
+
import { TransactionSQL } from "bun";
|
|
3
|
+
declare class Migration20251225180910444 implements IMigration {
|
|
4
|
+
up(tx: TransactionSQL): Promise<void>;
|
|
5
|
+
down(tx: TransactionSQL): Promise<void>;
|
|
6
|
+
getVersion(): string;
|
|
7
|
+
getDependencies(): MigrationClassType[];
|
|
8
|
+
}
|
|
9
|
+
export { Migration20251225180910444 };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { IMigration, MigrationClassType } from "@ooneex/migrations";
|
|
2
|
+
import { TransactionSQL } from "bun";
|
|
3
|
+
declare class Migration20251225180910446 implements IMigration {
|
|
4
|
+
up(tx: TransactionSQL): Promise<void>;
|
|
5
|
+
down(tx: TransactionSQL): Promise<void>;
|
|
6
|
+
getVersion(): string;
|
|
7
|
+
getDependencies(): MigrationClassType[];
|
|
8
|
+
}
|
|
9
|
+
import { IMigration as IMigration2, MigrationClassType as MigrationClassType2 } from "@ooneex/migrations";
|
|
10
|
+
import { TransactionSQL as TransactionSQL2 } from "bun";
|
|
11
|
+
declare class Migration20251225180910449 implements IMigration2 {
|
|
12
|
+
up(tx: TransactionSQL2): Promise<void>;
|
|
13
|
+
down(tx: TransactionSQL2): Promise<void>;
|
|
14
|
+
getVersion(): string;
|
|
15
|
+
getDependencies(): MigrationClassType2[];
|
|
16
|
+
}
|
|
17
|
+
import { IMigration as IMigration3, MigrationClassType as MigrationClassType3 } from "@ooneex/migrations";
|
|
18
|
+
import { TransactionSQL as TransactionSQL3 } from "bun";
|
|
19
|
+
declare class Migration20251225180910451 implements IMigration3 {
|
|
20
|
+
up(tx: TransactionSQL3): Promise<void>;
|
|
21
|
+
down(tx: TransactionSQL3): Promise<void>;
|
|
22
|
+
getVersion(): string;
|
|
23
|
+
getDependencies(): MigrationClassType3[];
|
|
24
|
+
}
|
|
25
|
+
import { IMigration as IMigration4, MigrationClassType as MigrationClassType4 } from "@ooneex/migrations";
|
|
26
|
+
import { TransactionSQL as TransactionSQL4 } from "bun";
|
|
27
|
+
declare class Migration20251225180910453 implements IMigration4 {
|
|
28
|
+
up(tx: TransactionSQL4): Promise<void>;
|
|
29
|
+
down(tx: TransactionSQL4): Promise<void>;
|
|
30
|
+
getVersion(): string;
|
|
31
|
+
getDependencies(): MigrationClassType4[];
|
|
32
|
+
}
|
|
33
|
+
import { IMigration as IMigration5, MigrationClassType as MigrationClassType5 } from "@ooneex/migrations";
|
|
34
|
+
import { TransactionSQL as TransactionSQL5 } from "bun";
|
|
35
|
+
declare class Migration20251225180910455 implements IMigration5 {
|
|
36
|
+
up(tx: TransactionSQL5): Promise<void>;
|
|
37
|
+
down(tx: TransactionSQL5): Promise<void>;
|
|
38
|
+
getVersion(): string;
|
|
39
|
+
getDependencies(): MigrationClassType5[];
|
|
40
|
+
}
|
|
41
|
+
import { IMigration as IMigration6, MigrationClassType as MigrationClassType6 } from "@ooneex/migrations";
|
|
42
|
+
import { TransactionSQL as TransactionSQL6 } from "bun";
|
|
43
|
+
declare class Migration20251225180910458 implements IMigration6 {
|
|
44
|
+
up(tx: TransactionSQL6): Promise<void>;
|
|
45
|
+
down(tx: TransactionSQL6): Promise<void>;
|
|
46
|
+
getVersion(): string;
|
|
47
|
+
getDependencies(): MigrationClassType6[];
|
|
48
|
+
}
|
|
49
|
+
import { IMigration as IMigration7, MigrationClassType as MigrationClassType7 } from "@ooneex/migrations";
|
|
50
|
+
import { TransactionSQL as TransactionSQL7 } from "bun";
|
|
51
|
+
declare class Migration20251225180910460 implements IMigration7 {
|
|
52
|
+
up(tx: TransactionSQL7): Promise<void>;
|
|
53
|
+
down(tx: TransactionSQL7): Promise<void>;
|
|
54
|
+
getVersion(): string;
|
|
55
|
+
getDependencies(): MigrationClassType7[];
|
|
56
|
+
}
|
|
57
|
+
import { IMigration as IMigration8, MigrationClassType as MigrationClassType8 } from "@ooneex/migrations";
|
|
58
|
+
import { TransactionSQL as TransactionSQL8 } from "bun";
|
|
59
|
+
declare class Migration20251225180910462 implements IMigration8 {
|
|
60
|
+
up(tx: TransactionSQL8): Promise<void>;
|
|
61
|
+
down(tx: TransactionSQL8): Promise<void>;
|
|
62
|
+
getVersion(): string;
|
|
63
|
+
getDependencies(): MigrationClassType8[];
|
|
64
|
+
}
|
|
65
|
+
import { IMigration as IMigration9, MigrationClassType as MigrationClassType9 } from "@ooneex/migrations";
|
|
66
|
+
import { TransactionSQL as TransactionSQL9 } from "bun";
|
|
67
|
+
declare class Migration20251225180910465 implements IMigration9 {
|
|
68
|
+
up(tx: TransactionSQL9): Promise<void>;
|
|
69
|
+
down(tx: TransactionSQL9): Promise<void>;
|
|
70
|
+
getVersion(): string;
|
|
71
|
+
getDependencies(): MigrationClassType9[];
|
|
72
|
+
}
|
|
73
|
+
import { IMigration as IMigration10, MigrationClassType as MigrationClassType10 } from "@ooneex/migrations";
|
|
74
|
+
import { TransactionSQL as TransactionSQL10 } from "bun";
|
|
75
|
+
declare class Migration20251225180910467 implements IMigration10 {
|
|
76
|
+
up(tx: TransactionSQL10): Promise<void>;
|
|
77
|
+
down(tx: TransactionSQL10): Promise<void>;
|
|
78
|
+
getVersion(): string;
|
|
79
|
+
getDependencies(): MigrationClassType10[];
|
|
80
|
+
}
|
|
81
|
+
import { IMigration as IMigration11, MigrationClassType as MigrationClassType11 } from "@ooneex/migrations";
|
|
82
|
+
import { TransactionSQL as TransactionSQL11 } from "bun";
|
|
83
|
+
declare class Migration20251225180910469 implements IMigration11 {
|
|
84
|
+
up(tx: TransactionSQL11): Promise<void>;
|
|
85
|
+
down(tx: TransactionSQL11): Promise<void>;
|
|
86
|
+
getVersion(): string;
|
|
87
|
+
getDependencies(): MigrationClassType11[];
|
|
88
|
+
}
|
|
89
|
+
import { IMigration as IMigration12, MigrationClassType as MigrationClassType12 } from "@ooneex/migrations";
|
|
90
|
+
import { TransactionSQL as TransactionSQL12 } from "bun";
|
|
91
|
+
declare class Migration20251225180910472 implements IMigration12 {
|
|
92
|
+
up(tx: TransactionSQL12): Promise<void>;
|
|
93
|
+
down(tx: TransactionSQL12): Promise<void>;
|
|
94
|
+
getVersion(): string;
|
|
95
|
+
getDependencies(): MigrationClassType12[];
|
|
96
|
+
}
|
|
97
|
+
export { Migration20251225180910472, Migration20251225180910469, Migration20251225180910467, Migration20251225180910465, Migration20251225180910462, Migration20251225180910460, Migration20251225180910458, Migration20251225180910455, Migration20251225180910453, Migration20251225180910451, Migration20251225180910449, Migration20251225180910446 };
|