Commit 5620b10
Fix schema migration gaps for v3
Critical fixes to match Dnote v3 server schema:
1. Remove separate accounts table
- In v3, email/password were merged into users table
- Migration now joins accounts with users during migration
2. Add missing FullSyncBefore field to users
- This field exists in v3 server but was missing from migration
3. Update migration logic
- Users migration now LEFT JOINs with accounts table
- Email and password are migrated directly to users table
- Remove migrateAccounts function (no longer needed)
4. Update tests to match new schema
- Verify email/password on users instead of separate accounts
- Add FullSyncBefore verification
- Tests pass ✓
This ensures the migrated SQLite database matches the v3 server
schema exactly, preventing any compatibility issues.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 9f61b89 commit 5620b10
File tree
5 files changed
+32
-109
lines changed5 files changed
+32
-109
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 37 | | |
46 | 38 | | |
47 | 39 | | |
| |||
78 | 70 | | |
79 | 71 | | |
80 | 72 | | |
81 | | - | |
82 | 73 | | |
83 | 74 | | |
84 | 75 | | |
| |||
89 | 80 | | |
90 | 81 | | |
91 | 82 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
95 | 89 | | |
96 | 90 | | |
97 | 91 | | |
98 | 92 | | |
99 | 93 | | |
100 | 94 | | |
101 | 95 | | |
102 | | - | |
103 | | - | |
| 96 | + | |
| 97 | + | |
104 | 98 | | |
105 | 99 | | |
106 | 100 | | |
| |||
112 | 106 | | |
113 | 107 | | |
114 | 108 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | 109 | | |
154 | 110 | | |
155 | | - | |
| 111 | + | |
156 | 112 | | |
157 | 113 | | |
158 | 114 | | |
159 | | - | |
| 115 | + | |
160 | 116 | | |
161 | 117 | | |
162 | | - | |
| 118 | + | |
163 | 119 | | |
164 | 120 | | |
165 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
| |||
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
| 261 | + | |
| 262 | + | |
286 | 263 | | |
287 | 264 | | |
288 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 63 | | |
73 | 64 | | |
74 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
0 commit comments