mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 15:56:29 +01:00
Compare commits
901 Commits
v0.47.3
...
v0.52.1-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec4fac421b | ||
|
|
f587e0dfd9 | ||
|
|
b5214e6cea | ||
|
|
5fbaed61c1 | ||
|
|
8fcc76ad6d | ||
|
|
15a9ff4450 | ||
|
|
0a4f419e5e | ||
|
|
7fa531b3d6 | ||
|
|
3cfca27b54 | ||
|
|
103aa95ccf | ||
|
|
339a6d7817 | ||
|
|
93dd9274e7 | ||
|
|
ca35527aeb | ||
|
|
388dcadef3 | ||
|
|
8905148dbc | ||
|
|
daa36192cc | ||
|
|
ade77e5fb8 | ||
|
|
f250b72563 | ||
|
|
37cb5f5e9a | ||
|
|
82fcc97ed2 | ||
|
|
53e9c8cdac | ||
|
|
541d451168 | ||
|
|
7c64dc9440 | ||
|
|
27570a7756 | ||
|
|
d6931f7441 | ||
|
|
7d39d080f5 | ||
|
|
13ccd2ba67 | ||
|
|
81fd7397e4 | ||
|
|
6f75f944a3 | ||
|
|
308b0f7464 | ||
|
|
678e883044 | ||
|
|
819cf0907d | ||
|
|
942f17b2f4 | ||
|
|
2085dc5ed4 | ||
|
|
a1d1b4580a | ||
|
|
9e089cc7cd | ||
|
|
cd622cbdd7 | ||
|
|
4978a3ff1a | ||
|
|
fca0b82610 | ||
|
|
6cef1082b2 | ||
|
|
37eb16b2f3 | ||
|
|
c24c807921 | ||
|
|
5bc629d1c7 | ||
|
|
04379b4e1f | ||
|
|
c51e6107a1 | ||
|
|
bb7ad496bf | ||
|
|
c50d8e85dc | ||
|
|
1d8664927d | ||
|
|
dbb5d02ecf | ||
|
|
593a275795 | ||
|
|
6778e1e60e | ||
|
|
36308c307b | ||
|
|
078fc420b0 | ||
|
|
8ec814c29f | ||
|
|
e87e065100 | ||
|
|
8318ab7ac0 | ||
|
|
87b75a9a22 | ||
|
|
8df3b0a5bd | ||
|
|
6906c82408 | ||
|
|
45edef2d71 | ||
|
|
bf49648896 | ||
|
|
91d23c540a | ||
|
|
1cbf918024 | ||
|
|
26f3c1d453 | ||
|
|
c421ee79b0 | ||
|
|
77f8474d83 | ||
|
|
9a04a76672 | ||
|
|
963c18b8e4 | ||
|
|
bbbad67764 | ||
|
|
3491e71084 | ||
|
|
c85f70e197 | ||
|
|
3df712b64f | ||
|
|
160bd0a790 | ||
|
|
81e0c6dcc2 | ||
|
|
11bd48a1b5 | ||
|
|
61657087f5 | ||
|
|
87f436c6ea | ||
|
|
065e4f55c3 | ||
|
|
92adcf82e4 | ||
|
|
06e0f2418c | ||
|
|
35c4c61d15 | ||
|
|
a168edb168 | ||
|
|
d2975bbd21 | ||
|
|
358e8c548c | ||
|
|
f85ed672cc | ||
|
|
83f1a68bfd | ||
|
|
552e5d7d06 | ||
|
|
9c7f8cf5d8 | ||
|
|
f0f9274a3c | ||
|
|
65c725c21e | ||
|
|
dfa30358c5 | ||
|
|
2394fe6ed9 | ||
|
|
6cae68288d | ||
|
|
83afb89a16 | ||
|
|
93cc6b12ec | ||
|
|
dc35df9f63 | ||
|
|
1a4bc0b989 | ||
|
|
a37d75a08f | ||
|
|
8d510a3fdd | ||
|
|
7bcd1c3009 | ||
|
|
5dab189815 | ||
|
|
a9dc62505d | ||
|
|
26e1ff4e16 | ||
|
|
b3763eed61 | ||
|
|
f9c01851ef | ||
|
|
6b61b0604a | ||
|
|
f705c432fd | ||
|
|
70edd9a210 | ||
|
|
0a45b58784 | ||
|
|
dbd312c88d | ||
|
|
11578b1bc3 | ||
|
|
569c80f551 | ||
|
|
3b58b83f8b | ||
|
|
643a5e5b16 | ||
|
|
4e4010e15e | ||
|
|
6bdaf050c5 | ||
|
|
05c8c6cfaa | ||
|
|
2441515666 | ||
|
|
c42bcd6c59 | ||
|
|
fc95bb8f18 | ||
|
|
cb88f316db | ||
|
|
e19ddc10d3 | ||
|
|
d3e86acfaa | ||
|
|
536643ed3b | ||
|
|
9771b441ad | ||
|
|
c295fdb142 | ||
|
|
ee7aa3d3da | ||
|
|
e437a9d70f | ||
|
|
a8655fcd27 | ||
|
|
aefc9f1593 | ||
|
|
73671671d7 | ||
|
|
f53a93e828 | ||
|
|
e156c6292b | ||
|
|
e365521d5e | ||
|
|
f354821f25 | ||
|
|
82e278a2a2 | ||
|
|
b4d4606c73 | ||
|
|
b14b7b6ad1 | ||
|
|
32aa7bb540 | ||
|
|
300f4ad357 | ||
|
|
cf6b5c3b6e | ||
|
|
f1c9dda366 | ||
|
|
7f01032b6d | ||
|
|
f08afd4723 | ||
|
|
afe2a03aef | ||
|
|
272bb136d8 | ||
|
|
27d0388d79 | ||
|
|
025032de42 | ||
|
|
15a3b42124 | ||
|
|
4266156cee | ||
|
|
45a66ab694 | ||
|
|
49f4ce7149 | ||
|
|
220df662ad | ||
|
|
6e535bac05 | ||
|
|
3b1dcc7199 | ||
|
|
ae75ac424f | ||
|
|
5c46fe792d | ||
|
|
a33b0f1e1c | ||
|
|
bd28ed07d7 | ||
|
|
12185fbd32 | ||
|
|
24911da8db | ||
|
|
da84d16421 | ||
|
|
53666cbfe8 | ||
|
|
8897d98bd9 | ||
|
|
93e485cea9 | ||
|
|
22363f5b74 | ||
|
|
2a2c82cd29 | ||
|
|
5ebe717da8 | ||
|
|
2f2d8327e4 | ||
|
|
a894c19c2b | ||
|
|
0469962c5e | ||
|
|
f6ebc76917 | ||
|
|
73425ec29d | ||
|
|
51e5f591b2 | ||
|
|
d1b3d8a58a | ||
|
|
534c71491b | ||
|
|
987f8e9961 | ||
|
|
a45cf033aa | ||
|
|
06b6097f29 | ||
|
|
75c8e700d4 | ||
|
|
c1092c97b5 | ||
|
|
a04becc4ec | ||
|
|
f7d6bda49d | ||
|
|
b250f0a3bf | ||
|
|
df1d94ec61 | ||
|
|
e00fcd93a1 | ||
|
|
0a95d0f6f5 | ||
|
|
569b8898ef | ||
|
|
091d6a1cf1 | ||
|
|
228564f843 | ||
|
|
17dd6141fb | ||
|
|
2f57d55bea | ||
|
|
0cd690d980 | ||
|
|
316a2aee1a | ||
|
|
77ce56ba84 | ||
|
|
eba824a5b1 | ||
|
|
c9e72f8fb9 | ||
|
|
4dd3fd9674 | ||
|
|
1690a55f7d | ||
|
|
dd29fc26e3 | ||
|
|
67b5921d6c | ||
|
|
1b7bcc5cc1 | ||
|
|
ea56bb772a | ||
|
|
9f33791922 | ||
|
|
d940590add | ||
|
|
a009b4cb6d | ||
|
|
781be527ce | ||
|
|
f7e5d8f62d | ||
|
|
d6c0fc734f | ||
|
|
db79b5ff53 | ||
|
|
18d439dd44 | ||
|
|
d2d2a6c086 | ||
|
|
5260689b8e | ||
|
|
78a2863b78 | ||
|
|
5481375347 | ||
|
|
4da2d2f516 | ||
|
|
23de8e881d | ||
|
|
59e8720866 | ||
|
|
67cce5f817 | ||
|
|
9924727729 | ||
|
|
6c9fc364a3 | ||
|
|
40598d2663 | ||
|
|
1aeb674733 | ||
|
|
832cac106e | ||
|
|
23daaa2387 | ||
|
|
d6016f9b81 | ||
|
|
1dfde76b95 | ||
|
|
83f8fac088 | ||
|
|
0ca9bff61b | ||
|
|
df91192b97 | ||
|
|
97fd550402 | ||
|
|
eb579de199 | ||
|
|
5f2984aa57 | ||
|
|
98a79f6475 | ||
|
|
c09da2b7eb | ||
|
|
600f74576d | ||
|
|
a21c49cba7 | ||
|
|
91e3dd022a | ||
|
|
478eca47f4 | ||
|
|
1c4358086d | ||
|
|
0917fc8be1 | ||
|
|
6833959f3b | ||
|
|
398376108d | ||
|
|
61aa029582 | ||
|
|
46eaa63625 | ||
|
|
1b54596c5e | ||
|
|
2feb778d8d | ||
|
|
2075e89239 | ||
|
|
be44431fde | ||
|
|
99cc4078c6 | ||
|
|
b8b6b38a20 | ||
|
|
efd8556129 | ||
|
|
b10a76f150 | ||
|
|
780b520506 | ||
|
|
3055ed86ec | ||
|
|
4fc3305080 | ||
|
|
d1b39ee8fa | ||
|
|
52b118df7f | ||
|
|
a97a7cdcdd | ||
|
|
1aff3db81f | ||
|
|
fc89e098b1 | ||
|
|
64172a7f6b | ||
|
|
66a6c76552 | ||
|
|
c8884f1917 | ||
|
|
4933b901f6 | ||
|
|
b679f4218d | ||
|
|
77c6c4617b | ||
|
|
8240a208dd | ||
|
|
1c34f73f61 | ||
|
|
a5444fd6ad | ||
|
|
6fbd5a77e4 | ||
|
|
c102089731 | ||
|
|
742ec44f55 | ||
|
|
7495777d97 | ||
|
|
da4f26d7ce | ||
|
|
fa2ffd7574 | ||
|
|
d4325db207 | ||
|
|
48d93cb3da | ||
|
|
2248d98cc7 | ||
|
|
ce046b2e20 | ||
|
|
4f4cbccf08 | ||
|
|
412c745e53 | ||
|
|
28df5d4aa2 | ||
|
|
42e85aefdc | ||
|
|
91e78998d1 | ||
|
|
6f406f9aa2 | ||
|
|
86fa80f3eb | ||
|
|
7119d08022 | ||
|
|
916ff5f2ee | ||
|
|
913d2c06f3 | ||
|
|
cbb5b31f72 | ||
|
|
91dec23d5e | ||
|
|
d04d356429 | ||
|
|
be59f248e8 | ||
|
|
2d2641dbd7 | ||
|
|
96f4230bc1 | ||
|
|
1995b54770 | ||
|
|
7159b13c9d | ||
|
|
f2732bcab7 | ||
|
|
0e9d76890b | ||
|
|
9df521109b | ||
|
|
75b65c396e | ||
|
|
d4d48f3834 | ||
|
|
b90ba3d1a9 | ||
|
|
c448d34a38 | ||
|
|
c33bc7e12c | ||
|
|
c5366abf75 | ||
|
|
2532ea525d | ||
|
|
d74371c9f5 | ||
|
|
9ee1c9f3da | ||
|
|
82ba0d5b1d | ||
|
|
590eea1183 | ||
|
|
e6f3cc7988 | ||
|
|
7a650c605c | ||
|
|
dfa7c64b1f | ||
|
|
82b2871a08 | ||
|
|
e3114e0602 | ||
|
|
e8acf3f9f3 | ||
|
|
2b10023055 | ||
|
|
e25a904a84 | ||
|
|
dcba6ad70d | ||
|
|
ffdd917717 | ||
|
|
168645cce9 | ||
|
|
f4c81ecefb | ||
|
|
5a85fe92aa | ||
|
|
feffd57f24 | ||
|
|
faf81ae056 | ||
|
|
003fec4b11 | ||
|
|
5ecb603e86 | ||
|
|
1fed71a92e | ||
|
|
dad82ea4e8 | ||
|
|
a38ccde8bc | ||
|
|
8120f1bf25 | ||
|
|
067251861d | ||
|
|
6bc8773d5f | ||
|
|
f92016f9ec | ||
|
|
4e31af8c84 | ||
|
|
7e48d214ca | ||
|
|
a910034c96 | ||
|
|
257cc66f62 | ||
|
|
00f24bdb63 | ||
|
|
fada3fe623 | ||
|
|
d97e454463 | ||
|
|
3128a7d62f | ||
|
|
b8fe9a41db | ||
|
|
8366a94bde | ||
|
|
f56123b864 | ||
|
|
ae951bfe23 | ||
|
|
ad8d35efe9 | ||
|
|
0217b1c85d | ||
|
|
c0aa14f586 | ||
|
|
b54cfab4ff | ||
|
|
a08985e7a6 | ||
|
|
a789025025 | ||
|
|
3f307b117e | ||
|
|
a232035d47 | ||
|
|
9d38e9342d | ||
|
|
4bc4b9ade7 | ||
|
|
f0217cae5e | ||
|
|
da050c6369 | ||
|
|
842c317568 | ||
|
|
47845930f4 | ||
|
|
972f2f40bf | ||
|
|
265401775b | ||
|
|
94111c464b | ||
|
|
94e18dfb7c | ||
|
|
bc9903191e | ||
|
|
cd8c24ceae | ||
|
|
f9709c9c39 | ||
|
|
c0964a4f12 | ||
|
|
bcef8579ce | ||
|
|
1180be75d1 | ||
|
|
cfa49c7b1b | ||
|
|
8e4926ed7f | ||
|
|
2430dcba65 | ||
|
|
7c885a8b76 | ||
|
|
402e29d6dc | ||
|
|
e7faebfac3 | ||
|
|
10a5773c66 | ||
|
|
1e8472266f | ||
|
|
b30792a3da | ||
|
|
8b56fb10fd | ||
|
|
26602e8226 | ||
|
|
b8eeb0371c | ||
|
|
b1c4737e78 | ||
|
|
3860028a9e | ||
|
|
16d97b95af | ||
|
|
20465a4f71 | ||
|
|
2ff6e50af4 | ||
|
|
e0378c5064 | ||
|
|
e29aee1aae | ||
|
|
1aff42f453 | ||
|
|
a098630e09 | ||
|
|
074eb1c02f | ||
|
|
657496ea37 | ||
|
|
034aaa7209 | ||
|
|
a81ea3771f | ||
|
|
4ceba8cc6e | ||
|
|
d9550dd59b | ||
|
|
97f7fe7b18 | ||
|
|
a810c08c02 | ||
|
|
ab550a1e8d | ||
|
|
08e8047d8a | ||
|
|
67da877135 | ||
|
|
263b7a84bb | ||
|
|
9d18bebb13 | ||
|
|
2d339dec6b | ||
|
|
b78ab1ee02 | ||
|
|
2f5f116345 | ||
|
|
64f1671566 | ||
|
|
26bcfe5160 | ||
|
|
89c04e6b6b | ||
|
|
e079359c15 | ||
|
|
c4ab6b4866 | ||
|
|
630d9f2e45 | ||
|
|
bbceb6251a | ||
|
|
89f117da5b | ||
|
|
40fb4ff56b | ||
|
|
d64c14482b | ||
|
|
61f197dd81 | ||
|
|
564366861e | ||
|
|
1ee2abcc42 | ||
|
|
f4242b4096 | ||
|
|
d59542dd6f | ||
|
|
211ff90ee8 | ||
|
|
8c11d022fb | ||
|
|
24210ef80c | ||
|
|
3f40a52f65 | ||
|
|
df4cf80be4 | ||
|
|
bc854ee149 | ||
|
|
b23ead8097 | ||
|
|
886fdf7cd6 | ||
|
|
2135aa058e | ||
|
|
de20183a22 | ||
|
|
42b5437c87 | ||
|
|
67542f448d | ||
|
|
ae29c6bac4 | ||
|
|
1dce96b4c1 | ||
|
|
08e9b59696 | ||
|
|
db9e35a7e1 | ||
|
|
fe605c012a | ||
|
|
7a383a1314 | ||
|
|
5290aab781 | ||
|
|
86c3bbe5a2 | ||
|
|
4c7c53d8c8 | ||
|
|
21854b4a04 | ||
|
|
83f125a79f | ||
|
|
e36bc42519 | ||
|
|
15ac81627c | ||
|
|
57fae2c8c6 | ||
|
|
87b76abef9 | ||
|
|
d345b7ed56 | ||
|
|
298af217e9 | ||
|
|
89322c4b03 | ||
|
|
7d64f6a7dd | ||
|
|
b7efc92099 | ||
|
|
bc8b6284a6 | ||
|
|
20a187fab9 | ||
|
|
0b001f41c0 | ||
|
|
242977c7a5 | ||
|
|
364ac331da | ||
|
|
fcc0a80f4e | ||
|
|
8996f35cc0 | ||
|
|
ed5eb5c6db | ||
|
|
acb50f44a1 | ||
|
|
c946030106 | ||
|
|
df0411197b | ||
|
|
600c16551a | ||
|
|
5710c9e997 | ||
|
|
550a9fa711 | ||
|
|
51348cfbad | ||
|
|
7400a6723e | ||
|
|
e57dee2f14 | ||
|
|
b02a5b872a | ||
|
|
4733de23ba | ||
|
|
57b7f6199e | ||
|
|
a9df0c485f | ||
|
|
21dedff9bf | ||
|
|
6f60cf1a86 | ||
|
|
930d29d64a | ||
|
|
c345e7031b | ||
|
|
fc46398a3c | ||
|
|
7e41226549 | ||
|
|
b0c0ed8512 | ||
|
|
5978447185 | ||
|
|
ec4d445f97 | ||
|
|
e378435fbe | ||
|
|
e4dca4750f | ||
|
|
311b98ffcb | ||
|
|
126f41ae5e | ||
|
|
4b1678c416 | ||
|
|
da74272f13 | ||
|
|
9ce224d4c5 | ||
|
|
ce57a13002 | ||
|
|
e42357f1f8 | ||
|
|
ab7d121290 | ||
|
|
5209583a73 | ||
|
|
35fc4ba9a4 | ||
|
|
7f9019322b | ||
|
|
8a455e83f0 | ||
|
|
79b8d91025 | ||
|
|
bcabe5786f | ||
|
|
a7d3dafcf1 | ||
|
|
e6af84df39 | ||
|
|
674172f0b8 | ||
|
|
7ec20f9384 | ||
|
|
6135de8507 | ||
|
|
63b0d30e74 | ||
|
|
9e29fba8da | ||
|
|
8910ae92c7 | ||
|
|
3413074235 | ||
|
|
33aa72eb97 | ||
|
|
6e0a65b59c | ||
|
|
56e49cfc19 | ||
|
|
af40d73cee | ||
|
|
50b7063811 | ||
|
|
ee1b377bc2 | ||
|
|
51dfe8bb14 | ||
|
|
e426ee3e4f | ||
|
|
a434aa113d | ||
|
|
3b551e3e4d | ||
|
|
3d98644bf6 | ||
|
|
a22e4d60b6 | ||
|
|
069fbee3a6 | ||
|
|
8b21867c5c | ||
|
|
980309ae2a | ||
|
|
6a6bd4541a | ||
|
|
a14aa461ca | ||
|
|
2cc4367b37 | ||
|
|
241d1b1035 | ||
|
|
449081807e | ||
|
|
dc0d6d24bd | ||
|
|
4111a2f0e8 | ||
|
|
8ef4b2bf50 | ||
|
|
53875d26bc | ||
|
|
f505f9d65a | ||
|
|
6434889cd6 | ||
|
|
21d2ca3c54 | ||
|
|
64a3a8b561 | ||
|
|
6738f2cd24 | ||
|
|
1cdd644b8f | ||
|
|
f5dc05e79a | ||
|
|
e2c37a6f8c | ||
|
|
cfea2440fb | ||
|
|
23e34e8c02 | ||
|
|
8bd7b657f8 | ||
|
|
899d9e65fd | ||
|
|
ec732c0a98 | ||
|
|
66797f34c4 | ||
|
|
1ad25b063d | ||
|
|
e09b2902fa | ||
|
|
f6776df645 | ||
|
|
f0c672445d | ||
|
|
a033ddfcb7 | ||
|
|
d02d846024 | ||
|
|
a8b6538c4e | ||
|
|
4eb4a44331 | ||
|
|
c1e1f3df24 | ||
|
|
11e9f8403e | ||
|
|
ba676587df | ||
|
|
20696aa0ab | ||
|
|
a08690b123 | ||
|
|
79f54b4e97 | ||
|
|
973fe52275 | ||
|
|
5938e033d4 | ||
|
|
eecba725b0 | ||
|
|
fa40a5f496 | ||
|
|
abbba6501d | ||
|
|
824f5dbaac | ||
|
|
24a45b03f5 | ||
|
|
e10e18e63a | ||
|
|
7152c5e51d | ||
|
|
711af02928 | ||
|
|
df8706026e | ||
|
|
17fe9a6a1b | ||
|
|
2d08eb7366 | ||
|
|
8d42ffca6d | ||
|
|
0654dc855f | ||
|
|
0571f02830 | ||
|
|
b2b1c9ebb7 | ||
|
|
1f75b9c92f | ||
|
|
e2c4f32b5e | ||
|
|
18ffcf7880 | ||
|
|
6ae8508413 | ||
|
|
ec3b844026 | ||
|
|
a1ca538106 | ||
|
|
75fc9e2048 | ||
|
|
a1c1c7c830 | ||
|
|
e4a483aefe | ||
|
|
8c2a5d19f2 | ||
|
|
2c450fc72d | ||
|
|
831de3ffed | ||
|
|
291b434d70 | ||
|
|
a68fd5ab83 | ||
|
|
8a8bdaf80e | ||
|
|
26b89fc801 | ||
|
|
af3fd61974 | ||
|
|
f4dde84f06 | ||
|
|
bc920dc5dc | ||
|
|
896c9cec04 | ||
|
|
b37bcd294c | ||
|
|
14f24c646a | ||
|
|
fea46bb150 | ||
|
|
37c30bf88a | ||
|
|
d975acc99a | ||
|
|
c2d35dac4d | ||
|
|
5358b58191 | ||
|
|
0264e847ef | ||
|
|
c5917bfc78 | ||
|
|
533fcd06e4 | ||
|
|
192a2fe9f9 | ||
|
|
e6bc8ed3b5 | ||
|
|
8ff563ba40 | ||
|
|
d5bd9875f9 | ||
|
|
113bebed3b | ||
|
|
2fcb0c05c0 | ||
|
|
fdb7b7721d | ||
|
|
3d9260c974 | ||
|
|
8769fd71cb | ||
|
|
a2baa9bdb3 | ||
|
|
88714cce94 | ||
|
|
bc1d438075 | ||
|
|
fd00f6bd97 | ||
|
|
b041d081db | ||
|
|
fabf24a065 | ||
|
|
e3fc0968ba | ||
|
|
a766374bf4 | ||
|
|
0f693dae5e | ||
|
|
208492bee1 | ||
|
|
b0d767df69 | ||
|
|
476b8250c9 | ||
|
|
e4ba7d65e8 | ||
|
|
9c9a3fc030 | ||
|
|
b85cf07a28 | ||
|
|
bdde52f004 | ||
|
|
dd37f09309 | ||
|
|
a0caa21458 | ||
|
|
43e829ca99 | ||
|
|
ed26e32ccb | ||
|
|
5866004e23 | ||
|
|
06bcfe1aee | ||
|
|
2d82da32d4 | ||
|
|
2b017a956e | ||
|
|
0448883782 | ||
|
|
9b9be5d155 | ||
|
|
3f2ee4aefd | ||
|
|
b90ae8eb79 | ||
|
|
266807179c | ||
|
|
4023c28f5e | ||
|
|
010f075ac5 | ||
|
|
151687cd9b | ||
|
|
f24ea8137b | ||
|
|
b8d8e01908 | ||
|
|
79d492d0f0 | ||
|
|
f0af26a57b | ||
|
|
2b8c6e3dd0 | ||
|
|
061f8acf11 | ||
|
|
5cfd1c030d | ||
|
|
6e300c7cf5 | ||
|
|
167d4816fd | ||
|
|
3e5db71652 | ||
|
|
1bc50ed976 | ||
|
|
08c638c2fa | ||
|
|
5f22864a93 | ||
|
|
cfcc34fa8e | ||
|
|
635f5fdc5b | ||
|
|
d0747b125c | ||
|
|
66374bf95f | ||
|
|
d27fcaf317 | ||
|
|
0ee093f038 | ||
|
|
06eb0ce910 | ||
|
|
c59b3a0c5c | ||
|
|
08eda83700 | ||
|
|
d23bb5fd17 | ||
|
|
8cb07525cf | ||
|
|
dc4c922edb | ||
|
|
c3ed673453 | ||
|
|
3fd16a16e8 | ||
|
|
3448eba7b9 | ||
|
|
ad8f374276 | ||
|
|
19a6d89d4f | ||
|
|
b99d83af50 | ||
|
|
e050e380b9 | ||
|
|
68d599ed19 | ||
|
|
9d9bc31d91 | ||
|
|
b619a6515b | ||
|
|
13a16e8251 | ||
|
|
86a53ceebb | ||
|
|
669eaa7509 | ||
|
|
f50084dc1b | ||
|
|
3a78a75afc | ||
|
|
6e7b722bf2 | ||
|
|
4ca0f4b06b | ||
|
|
a33661d050 | ||
|
|
f1338bb643 | ||
|
|
b6b6d11ef7 | ||
|
|
17a6c94f66 | ||
|
|
e74979ccc1 | ||
|
|
e003341dff | ||
|
|
5c4369206a | ||
|
|
507a0e2e1d | ||
|
|
b381331029 | ||
|
|
af703445e1 | ||
|
|
c508217604 | ||
|
|
6a1287a3de | ||
|
|
7261ab69bc | ||
|
|
f9cfd134b7 | ||
|
|
89d28ef27c | ||
|
|
9da8d466b8 | ||
|
|
74d0626dc9 | ||
|
|
830a357b9a | ||
|
|
7b129c7c34 | ||
|
|
adc98d4515 | ||
|
|
f3959cf2aa | ||
|
|
6fdabbc73b | ||
|
|
de6ff09bb9 | ||
|
|
c82308489b | ||
|
|
98ee3b029a | ||
|
|
a6bef45a30 | ||
|
|
05d077ce28 | ||
|
|
9adf4d7e8e | ||
|
|
e2819109e9 | ||
|
|
3c8e267aad | ||
|
|
da0670188b | ||
|
|
65938c5272 | ||
|
|
7ea72632b8 | ||
|
|
9ca225b40f | ||
|
|
b68bdc5005 | ||
|
|
9e77a424a4 | ||
|
|
e25b965cb3 | ||
|
|
8d3a3d4873 | ||
|
|
c115628f1f | ||
|
|
703fbd30df | ||
|
|
5011b6a51a | ||
|
|
4cc02ffb31 | ||
|
|
1e767482b4 | ||
|
|
2035304b63 | ||
|
|
5be7f003ca | ||
|
|
b660238a40 | ||
|
|
b9ff481eb7 | ||
|
|
eebbf74517 | ||
|
|
61e78858bc | ||
|
|
0351d7eff1 | ||
|
|
9e1c9782ff | ||
|
|
b2148f4a18 | ||
|
|
16cc84be99 | ||
|
|
0265c190db | ||
|
|
32c88219c3 | ||
|
|
962d5a5674 | ||
|
|
995e6c2fef | ||
|
|
0a2807c0b3 | ||
|
|
1b9c3b0759 | ||
|
|
f1a36f6cea | ||
|
|
d9ec8bba80 | ||
|
|
02da5b598c | ||
|
|
2220c4491b | ||
|
|
fb31acc8e0 | ||
|
|
92cf2c18fa | ||
|
|
c5182b8757 | ||
|
|
e054a1694e | ||
|
|
3a7da1d561 | ||
|
|
3893f663d0 | ||
|
|
a0de3c97a5 | ||
|
|
c886583396 | ||
|
|
e48609aa68 | ||
|
|
882912826f | ||
|
|
6d51593b7d | ||
|
|
faab6be48d | ||
|
|
8debf18984 | ||
|
|
4bf1c25721 | ||
|
|
a1d7737551 | ||
|
|
2bfd7b844c | ||
|
|
ac04be4433 | ||
|
|
5e5df72020 | ||
|
|
f1344e3b95 | ||
|
|
9216e430db | ||
|
|
855b876d50 | ||
|
|
c04bbd4973 | ||
|
|
1a615398aa | ||
|
|
b557a44f34 | ||
|
|
f50bb2278c | ||
|
|
6b68068cde | ||
|
|
7ed816f1b2 | ||
|
|
f8dd8ebf1a | ||
|
|
4c64bd852e | ||
|
|
af62b07d5b | ||
|
|
4338f65e01 | ||
|
|
9a147365f5 | ||
|
|
e48bbe5b19 | ||
|
|
bdff1c1246 | ||
|
|
d4a955a3f5 | ||
|
|
07e214c564 | ||
|
|
b351157a6a | ||
|
|
56378cd0f5 | ||
|
|
a76e3f6e2d | ||
|
|
f5573fcad4 | ||
|
|
60f88574b0 | ||
|
|
65c3bcb565 | ||
|
|
ef4bc13dd1 | ||
|
|
aa901b67ed | ||
|
|
7a389baf08 | ||
|
|
57b6271c0b | ||
|
|
9532a5662f | ||
|
|
520db931ae | ||
|
|
5e19a37df7 | ||
|
|
4b6b8b1678 | ||
|
|
a3d44fbdef | ||
|
|
7fcf90437a | ||
|
|
614b1bdbaf | ||
|
|
4d213300ac | ||
|
|
b7ca3dec54 | ||
|
|
c4987c4fd1 | ||
|
|
f176191efb | ||
|
|
dc5304faa0 | ||
|
|
205f9953f9 | ||
|
|
58d61800f3 | ||
|
|
b9639bffce | ||
|
|
3c7232f427 | ||
|
|
5707b7e29a | ||
|
|
2f5d3729de | ||
|
|
bae8551652 | ||
|
|
1f5e4530c3 | ||
|
|
7d94202460 | ||
|
|
30cc566518 | ||
|
|
85933771f8 | ||
|
|
e924662a29 | ||
|
|
2985100801 | ||
|
|
d68ea201a3 | ||
|
|
7528181ca2 | ||
|
|
1302765478 | ||
|
|
5b220adc31 | ||
|
|
98dfc77195 | ||
|
|
1a0aaf4a30 | ||
|
|
79a85a0aa7 | ||
|
|
274cf7312c | ||
|
|
29e4e2afbb | ||
|
|
39f0f26f28 | ||
|
|
1a13132a69 | ||
|
|
a3847842cb | ||
|
|
b7bd5396d1 | ||
|
|
8c1c9b00e2 | ||
|
|
845f5d15c4 | ||
|
|
d18b95d87c | ||
|
|
731051154b | ||
|
|
a093508fbe | ||
|
|
5860b2eebb | ||
|
|
a4aaa49774 | ||
|
|
a4c7069856 | ||
|
|
7cad65b370 | ||
|
|
3ead734323 | ||
|
|
2451596e8c | ||
|
|
a5d702b143 | ||
|
|
439ef4a8cb | ||
|
|
8bd3e17a3b | ||
|
|
7a7c890946 | ||
|
|
04f249e800 | ||
|
|
a65eda5e4a | ||
|
|
9645a07f2f | ||
|
|
16563eaba4 | ||
|
|
caa6e9ee72 | ||
|
|
f4a58a2598 | ||
|
|
8a9bd4deb4 | ||
|
|
8417d4a4ea | ||
|
|
5d58520949 | ||
|
|
d8d15b528e | ||
|
|
1d008cad13 | ||
|
|
ef0941479c | ||
|
|
9afea492db | ||
|
|
84246fd197 | ||
|
|
9441cb177f | ||
|
|
bcfe097dd6 | ||
|
|
a410ed1b74 | ||
|
|
2edc7dbf58 | ||
|
|
051b9dff21 | ||
|
|
1308dc20e8 | ||
|
|
e257634ccf | ||
|
|
3091119893 | ||
|
|
c035627f0a | ||
|
|
273d4e0052 | ||
|
|
77eac8f764 | ||
|
|
1af10d48a2 | ||
|
|
d13c8771ca | ||
|
|
6626f100ad | ||
|
|
ccadff5015 | ||
|
|
e41be520a8 | ||
|
|
43eb248450 | ||
|
|
219098ab53 | ||
|
|
e466c393eb | ||
|
|
d8f1c39282 | ||
|
|
cb3a5bba61 | ||
|
|
93cae44ba0 | ||
|
|
a5ee590544 | ||
|
|
6c5b1420d2 | ||
|
|
8d8d654fe8 | ||
|
|
7494491560 | ||
|
|
79bb249f3b | ||
|
|
1fdf889ccf | ||
|
|
42510fda5c | ||
|
|
f7e86c5be0 | ||
|
|
af5b1021c7 | ||
|
|
4311834d75 |
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [zadam]
|
github: [zadam]
|
||||||
|
custom: ["https://paypal.me/za4am"]
|
||||||
|
|||||||
46
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
46
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: Report a bug
|
||||||
|
title: "(Bug report) "
|
||||||
|
labels: "Type: Bug"
|
||||||
|
body:
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Trilium Version
|
||||||
|
description: What version of Trilium are you using?
|
||||||
|
placeholder: 0.48.0-beta
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: What operating system are you using?
|
||||||
|
options:
|
||||||
|
- Windows
|
||||||
|
- macOS
|
||||||
|
- Ubuntu
|
||||||
|
- Other Linux
|
||||||
|
- Other (specify below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: What is your setup?
|
||||||
|
description: https://github.com/zadam/trilium/wiki#choose-the-setup
|
||||||
|
options:
|
||||||
|
- Local (no sync)
|
||||||
|
- Local + server sync
|
||||||
|
- Server access only
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Operating System Version
|
||||||
|
description: What operating system version are you using? On Windows, click Start button > Settings > System > About. On macOS, click the Apple Menu > About This Mac. On Linux, use lsb_release or uname -a.
|
||||||
|
placeholder: "e.g. Windows 10 version 1909, macOS Catalina 10.15.7, or Ubuntu 20.04"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: A clear and concise description of the bug and any additional information.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
15
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
15
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
name: Feature Request
|
||||||
|
description: Ask for a new feature to be added
|
||||||
|
title: "(Feature request) "
|
||||||
|
labels: "Type: Enhancement"
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Describe feature
|
||||||
|
description: A clear and concise description of what you want to be added..
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional Information
|
||||||
|
description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
|
||||||
71
.github/workflows/codeql-analysis.yml
vendored
Normal file
71
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ master ]
|
||||||
|
schedule:
|
||||||
|
- cron: '37 4 * * 1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'javascript' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
|
# Learn more:
|
||||||
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
53
.github/workflows/docker.yaml
vendored
Normal file
53
.github/workflows/docker.yaml
vendored
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
name: Publish Docker image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: [v*]
|
||||||
|
jobs:
|
||||||
|
push_to_registries:
|
||||||
|
name: Push Docker image to multiple registries
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
zadam/trilium
|
||||||
|
ghcr.io/zadam/trilium
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}-latest
|
||||||
|
type=match,pattern=(\d+.\d+).\d+\-beta,enable=${{ endsWith(github.ref, 'beta') }},group=1,suffix=-latest
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
- name: Log in to GitHub Docker Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Create server-package.json
|
||||||
|
run: cat package.json | grep -v electron > server-package.json
|
||||||
|
- name: Build and Push
|
||||||
|
uses: docker/build-push-action@v2.7.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||||
|
push: true
|
||||||
|
cache-from: type=registry,ref=zadam/trilium:buildcache
|
||||||
|
cache-to: type=registry,ref=zadam/trilium:buildcache,mode=max
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -8,4 +8,6 @@ yarn-error.log
|
|||||||
config.ini
|
config.ini
|
||||||
cert.key
|
cert.key
|
||||||
cert.crt
|
cert.crt
|
||||||
server-package.json
|
server-package.json
|
||||||
|
.idea/httpRequests/
|
||||||
|
data/
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ image:
|
|||||||
file: .gitpod.dockerfile
|
file: .gitpod.dockerfile
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- before: nvm install 10 && nvm use 10
|
- before: nvm install 16.15.0 && nvm use 16.15.0
|
||||||
init: npm install
|
init: npm install
|
||||||
command: npm run start-server
|
command: npm run start-server
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- port: 8080
|
- port: 8080
|
||||||
onOpen: open-preview
|
onOpen: open-preview
|
||||||
|
|||||||
5
.idea/dataSources.xml
generated
5
.idea/dataSources.xml
generated
@@ -1,11 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
<data-source source="LOCAL" name="document.db" uuid="4e69c96a-8a2b-43f5-9b40-d1608f75f7a4">
|
<data-source source="LOCAL" name="SQLite - document.db" uuid="30cef30d-e704-484d-a4ca-5d3bfc2ece63">
|
||||||
<driver-ref>sqlite.xerial</driver-ref>
|
<driver-ref>sqlite.xerial</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||||
<jdbc-url>jdbc:sqlite:$USER_HOME$/trilium-data/document.db</jdbc-url>
|
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/../trilium-data/document.db</jdbc-url>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
</data-source>
|
</data-source>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,7 +3,7 @@
|
|||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="ES6" />
|
<option name="languageLevel" value="ES6" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" project-jdk-name="openjdk-16" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
1
CODE_OF_CONDUCT
Normal file
1
CODE_OF_CONDUCT
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Please treat each other with respect and understanding.
|
||||||
14
Dockerfile
14
Dockerfile
@@ -1,4 +1,5 @@
|
|||||||
FROM node:12.19.0-alpine
|
# !!! Don't try to build this Dockerfile directly, run it through bin/build-docker.sh script !!!
|
||||||
|
FROM node:16.15.0-alpine
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
@@ -16,14 +17,19 @@ RUN set -x \
|
|||||||
make \
|
make \
|
||||||
nasm \
|
nasm \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
python \
|
python3 \
|
||||||
&& npm install --production \
|
&& npm install --production \
|
||||||
&& apk del .build-dependencies
|
&& apk del .build-dependencies
|
||||||
|
|
||||||
|
# Some setup tools need to be kept
|
||||||
|
RUN apk add --no-cache su-exec
|
||||||
|
|
||||||
# Bundle app source
|
# Bundle app source
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
USER node
|
# Add application user and setup proper volume permissions
|
||||||
|
RUN adduser -s /bin/false node; exit 0
|
||||||
|
|
||||||
|
# Start the application
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD [ "node", "./src/www" ]
|
CMD [ "./start-docker.sh" ]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Trilium注意事项
|
# Trilium笔记
|
||||||
|
|
||||||
[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md)
|
[English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md)
|
||||||
|
|
||||||
@@ -7,6 +7,10 @@ Trilium Notes是一个分层的笔记应用程序,专注于建立大型个人
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/).
|
||||||
|
|
||||||
|
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
* 笔记可以排列成任意深的树。单个笔记可以放在树中的多个位置(请参阅[克隆](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
* 笔记可以排列成任意深的树。单个笔记可以放在树中的多个位置(请参阅[克隆](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||||
@@ -37,6 +41,8 @@ Trilium是作为桌面应用程序(Linux和Windows)或服务器上托管的W
|
|||||||
|
|
||||||
[有关文档页面的完整列表,请参见Wiki。](https://github.com/zadam/trilium/wiki/)
|
[有关文档页面的完整列表,请参见Wiki。](https://github.com/zadam/trilium/wiki/)
|
||||||
|
|
||||||
|
[中文Wiki在这里](https://github.com/baddate/trilium/wiki/)
|
||||||
|
|
||||||
您还可以阅读[个人知识库模式](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base),以获取有关如何使用Trilium的灵感。
|
您还可以阅读[个人知识库模式](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base),以获取有关如何使用Trilium的灵感。
|
||||||
|
|
||||||
## 贡献
|
## 贡献
|
||||||
@@ -57,4 +63,4 @@ npm run start-server
|
|||||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - 市场上最好的所见即所得编辑器,互动性强且聆听能力强的团队
|
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - 市场上最好的所见即所得编辑器,互动性强且聆听能力强的团队
|
||||||
* [FancyTree](https://github.com/mar10/fancytree) - 一个非常丰富的关于树的库,强大的没有对手。没有它,Trilium Notes将不会如此。
|
* [FancyTree](https://github.com/mar10/fancytree) - 一个非常丰富的关于树的库,强大的没有对手。没有它,Trilium Notes将不会如此。
|
||||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - 支持大量语言的代码编辑器
|
* [CodeMirror](https://github.com/codemirror/CodeMirror) - 支持大量语言的代码编辑器
|
||||||
* [jsPlumb](https://github.com/jsplumb/jsplumb)强大的可视化连接库。- 用于[关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map)
|
* [jsPlumb](https://github.com/jsplumb/jsplumb)强大的可视化连接库。- 用于[关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map)
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -7,6 +7,10 @@ Trilium Notes is a hierarchical note taking application with focus on building l
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/).
|
||||||
|
|
||||||
|
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
* Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||||
@@ -16,9 +20,12 @@ Trilium Notes is a hierarchical note taking application with focus on building l
|
|||||||
* Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions)
|
* Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions)
|
||||||
* Note [attributes](https://github.com/zadam/trilium/wiki/Attributes) can be used for note organization, querying and advanced [scripting](https://github.com/zadam/trilium/wiki/Scripts)
|
* Note [attributes](https://github.com/zadam/trilium/wiki/Attributes) can be used for note organization, querying and advanced [scripting](https://github.com/zadam/trilium/wiki/Scripts)
|
||||||
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization) with self-hosted sync server
|
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization) with self-hosted sync server
|
||||||
|
* there's a [3rd party service for hosting synchronisation server](https://trilium.cc/paid-hosting)
|
||||||
|
* [Sharing](https://github.com/zadam/trilium/wiki/Sharing) (publishing) notes to public internet
|
||||||
* Strong [note encryption](https://github.com/zadam/trilium/wiki/Protected-notes) with per-note granularity
|
* Strong [note encryption](https://github.com/zadam/trilium/wiki/Protected-notes) with per-note granularity
|
||||||
* [Relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map) for visualizing notes and their relations
|
* [Relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map) for visualizing notes and their relations
|
||||||
* [Scripting](https://github.com/zadam/trilium/wiki/Scripts) - see [Advanced showcases](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
* [Scripting](https://github.com/zadam/trilium/wiki/Scripts) - see [Advanced showcases](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
||||||
|
* [REST API](https://github.com/zadam/trilium/wiki/ETAPI) for automation
|
||||||
* Scales well in both usability and performance upwards of 100 000 notes
|
* Scales well in both usability and performance upwards of 100 000 notes
|
||||||
* Touch optimized [mobile frontend](https://github.com/zadam/trilium/wiki/Mobile-frontend) for smartphones and tablets
|
* Touch optimized [mobile frontend](https://github.com/zadam/trilium/wiki/Mobile-frontend) for smartphones and tablets
|
||||||
* [Night theme](https://github.com/zadam/trilium/wiki/Themes)
|
* [Night theme](https://github.com/zadam/trilium/wiki/Themes)
|
||||||
@@ -58,6 +65,10 @@ npm run start-server
|
|||||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - code editor with support for huge amount of languages
|
* [CodeMirror](https://github.com/codemirror/CodeMirror) - code editor with support for huge amount of languages
|
||||||
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)
|
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)
|
||||||
|
|
||||||
|
## Donating
|
||||||
|
|
||||||
|
You can donate using GitHub Sponsors, [PayPal](https://paypal.me/za4am) or Bitcoin (bitcoin:bc1qv3svjn40v89mnkre5vyvs2xw6y8phaltl385d2).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ Trilium Notes – это приложение для заметок с иера
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/).
|
||||||
|
|
||||||
|
<img src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" alt="drawing" width="600"/>
|
||||||
|
|
||||||
## Возможности
|
## Возможности
|
||||||
|
|
||||||
* Заметки можно расположить в виде дерева произвольной глубины. Отдельную заметку можно разместить в нескольких местах дерева (см. [клонирование](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
* Заметки можно расположить в виде дерева произвольной глубины. Отдельную заметку можно разместить в нескольких местах дерева (см. [клонирование](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,4 +4,19 @@ echo "Packaging debian x64 distribution..."
|
|||||||
|
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
|
||||||
./node_modules/.bin/electron-installer-debian --config bin/deb-options.json --options.version=${VERSION} --arch amd64
|
./node_modules/.bin/electron-installer-debian --config bin/deb-options.json --options.version=${VERSION} --arch amd64
|
||||||
|
|
||||||
|
|
||||||
|
# hacky stop-gag measure to produce debian compatible XZ compressed debs until this is fixed: https://github.com/electron-userland/electron-installer-debian/issues/272
|
||||||
|
cd dist
|
||||||
|
ar x trilium_${VERSION}_amd64.deb
|
||||||
|
rm trilium_${VERSION}_amd64.deb
|
||||||
|
# recompress
|
||||||
|
< control.tar.zst zstd -d | xz > control.tar.xz
|
||||||
|
< data.tar.zst zstd -d | xz > data.tar.xz
|
||||||
|
# create deb archive (I really do not know, what argument "sdsd" is for but something is required for ar to create the archive as desired)
|
||||||
|
ar -m -c -a sdsd trilium_${VERSION}_amd64.deb debian-binary control.tar.xz data.tar.xz
|
||||||
|
|
||||||
|
rm control* data* debian-binary
|
||||||
|
|
||||||
|
echo "Converted to XZ deb"
|
||||||
|
|||||||
@@ -27,9 +27,16 @@ cp images/app-icons/png/128x128.png $BUILD_DIR/icon.png
|
|||||||
# removing software WebGL binaries because they are pretty huge and not necessary
|
# removing software WebGL binaries because they are pretty huge and not necessary
|
||||||
rm -r $BUILD_DIR/swiftshader
|
rm -r $BUILD_DIR/swiftshader
|
||||||
|
|
||||||
|
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
|
||||||
|
|
||||||
|
cp -r dump-db $BUILD_DIR/
|
||||||
|
|
||||||
cp bin/tpl/trilium-portable.sh $BUILD_DIR/
|
cp bin/tpl/trilium-portable.sh $BUILD_DIR/
|
||||||
chmod 755 $BUILD_DIR/trilium-portable.sh
|
chmod 755 $BUILD_DIR/trilium-portable.sh
|
||||||
|
|
||||||
|
cp bin/tpl/trilium-safe-mode.sh $BUILD_DIR/
|
||||||
|
chmod 755 $BUILD_DIR/trilium-safe-mode.sh
|
||||||
|
|
||||||
cp bin/tpl/trilium-no-cert-check.sh $BUILD_DIR/
|
cp bin/tpl/trilium-no-cert-check.sh $BUILD_DIR/
|
||||||
chmod 755 $BUILD_DIR/trilium-no-cert-check.sh
|
chmod 755 $BUILD_DIR/trilium-no-cert-check.sh
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ rm -rf $BUILD_DIR
|
|||||||
# Mac build has by default useless directory level
|
# Mac build has by default useless directory level
|
||||||
mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR
|
mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR
|
||||||
|
|
||||||
|
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
|
||||||
|
|
||||||
|
cp -r dump-db $BUILD_DIR/
|
||||||
|
|
||||||
echo "Zipping mac x64 electron distribution..."
|
echo "Zipping mac x64 electron distribution..."
|
||||||
|
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PKG_DIR=dist/trilium-linux-x64-server
|
PKG_DIR=dist/trilium-linux-x64-server
|
||||||
NODE_VERSION=14.16.1
|
NODE_VERSION=16.15.0
|
||||||
|
|
||||||
if [ "$1" != "DONTCOPY" ]
|
if [ "$1" != "DONTCOPY" ]
|
||||||
then
|
then
|
||||||
@@ -20,12 +20,18 @@ rm -r $PKG_DIR/node/lib/node_modules/npm
|
|||||||
rm -r $PKG_DIR/node/include/node
|
rm -r $PKG_DIR/node/include/node
|
||||||
|
|
||||||
rm -r $PKG_DIR/node_modules/electron*
|
rm -r $PKG_DIR/node_modules/electron*
|
||||||
|
rm -r $PKG_DIR/webpack*
|
||||||
|
rm -r $PKG_DIR/electron.js
|
||||||
|
|
||||||
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
|
||||||
printf "#!/bin/sh\n./node/bin/node src/www" > $PKG_DIR/trilium.sh
|
printf "#!/bin/sh\n./node/bin/node src/www" > $PKG_DIR/trilium.sh
|
||||||
chmod 755 $PKG_DIR/trilium.sh
|
chmod 755 $PKG_DIR/trilium.sh
|
||||||
|
|
||||||
|
cp bin/tpl/anonymize-database.sql $PKG_DIR/
|
||||||
|
|
||||||
|
cp -r dump-db $PKG_DIR/
|
||||||
|
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
|
||||||
cd dist
|
cd dist
|
||||||
|
|||||||
@@ -25,8 +25,11 @@ mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
|
|||||||
# removing software WebGL binaries because they are pretty huge and not necessary
|
# removing software WebGL binaries because they are pretty huge and not necessary
|
||||||
rm -r $BUILD_DIR/swiftshader
|
rm -r $BUILD_DIR/swiftshader
|
||||||
|
|
||||||
cp bin/tpl/trilium-portable.bat $BUILD_DIR/
|
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
|
||||||
cp bin/tpl/trilium-no-cert-check.bat $BUILD_DIR/
|
|
||||||
|
cp -r dump-db $BUILD_DIR/
|
||||||
|
|
||||||
|
cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.{bat,ps1} $BUILD_DIR/
|
||||||
|
|
||||||
echo "Zipping windows x64 electron distribution..."
|
echo "Zipping windows x64 electron distribution..."
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ if [[ $# -eq 0 ]] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
n exec 12 npm run webpack
|
n exec 16.15.0 npm run webpack
|
||||||
|
|
||||||
DIR=$1
|
DIR=$1
|
||||||
|
|
||||||
@@ -14,6 +14,9 @@ mkdir $DIR
|
|||||||
|
|
||||||
echo "Copying Trilium to build directory $DIR"
|
echo "Copying Trilium to build directory $DIR"
|
||||||
|
|
||||||
|
cp -r dump-db $DIR/
|
||||||
|
rm -rf $DIR/dump-db/node_modules
|
||||||
|
|
||||||
cp -r images $DIR/
|
cp -r images $DIR/
|
||||||
cp -r libraries $DIR/
|
cp -r libraries $DIR/
|
||||||
cp -r src $DIR/
|
cp -r src $DIR/
|
||||||
@@ -27,7 +30,7 @@ cp -r electron.js $DIR/
|
|||||||
cp webpack-* $DIR/
|
cp webpack-* $DIR/
|
||||||
|
|
||||||
# run in subshell (so we return to original dir)
|
# run in subshell (so we return to original dir)
|
||||||
(cd $DIR && n exec 12 npm install --only=prod)
|
(cd $DIR && n exec 16.15.0 npm install --only=prod)
|
||||||
|
|
||||||
# cleanup of useless files in dependencies
|
# cleanup of useless files in dependencies
|
||||||
rm -r $DIR/node_modules/image-q/demo
|
rm -r $DIR/node_modules/image-q/demo
|
||||||
@@ -44,8 +47,11 @@ find $DIR/node_modules -name demo -exec rm -rf {} \;
|
|||||||
|
|
||||||
find $DIR/libraries -name "*.map" -type f -delete
|
find $DIR/libraries -name "*.map" -type f -delete
|
||||||
|
|
||||||
rm -r $DIR/src/public/app
|
cp $DIR/src/public/app/share.js $DIR/src/public/app-dist/
|
||||||
|
|
||||||
|
rm -rf $DIR/src/public/app
|
||||||
|
|
||||||
sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejs
|
sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejs
|
||||||
sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejs
|
sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejs
|
||||||
sed -i -e 's/app\/setup.js/app-dist\/setup.js/g' $DIR/src/views/setup.ejs
|
sed -i -e 's/app\/setup.js/app-dist\/setup.js/g' $DIR/src/views/setup.ejs
|
||||||
|
sed -i -e 's/app\/share.js/app-dist\/share.js/g' $DIR/src/views/share/*.ejs
|
||||||
|
|||||||
7
bin/create-anonymization-script.js
Normal file
7
bin/create-anonymization-script.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const anonymizationService = require('../src/services/anonymization');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
fs.writeFileSync(path.resolve(__dirname, 'tpl', 'anonymize-database.sql'), anonymizationService.getFullAnonymizationScript());
|
||||||
@@ -69,13 +69,3 @@ gh release create "$TAG" \
|
|||||||
"dist/$WINDOWS_X64_BUILD" \
|
"dist/$WINDOWS_X64_BUILD" \
|
||||||
"dist/$MAC_X64_BUILD" \
|
"dist/$MAC_X64_BUILD" \
|
||||||
"dist/$SERVER_BUILD"
|
"dist/$SERVER_BUILD"
|
||||||
|
|
||||||
echo "Building docker image"
|
|
||||||
|
|
||||||
bin/build-docker.sh $VERSION
|
|
||||||
|
|
||||||
echo "Pushing docker image to dockerhub"
|
|
||||||
|
|
||||||
bin/push-docker-image.sh $VERSION
|
|
||||||
|
|
||||||
echo "Release finished!"
|
|
||||||
|
|||||||
17
bin/tpl/anonymize-database.sql
Normal file
17
bin/tpl/anonymize-database.sql
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
UPDATE etapi_tokens SET tokenHash = 'API token hash value';
|
||||||
|
UPDATE notes SET title = 'title' WHERE title NOT IN ('root', 'hidden', 'share');
|
||||||
|
UPDATE note_contents SET content = 'text' WHERE content IS NOT NULL;
|
||||||
|
UPDATE note_revisions SET title = 'title';
|
||||||
|
UPDATE note_revision_contents SET content = 'text' WHERE content IS NOT NULL;
|
||||||
|
|
||||||
|
UPDATE attributes SET name = 'name', value = 'value' WHERE type = 'label' AND name NOT IN('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'hoistedCssClass', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'hoistedInbox', 'hoistedSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarked', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
|
||||||
|
UPDATE attributes SET name = 'name' WHERE type = 'relation' AND name NOT IN ('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'hoistedCssClass', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'hoistedInbox', 'hoistedSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarked', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon');
|
||||||
|
UPDATE branches SET prefix = 'prefix' WHERE prefix IS NOT NULL AND prefix != 'recovered';
|
||||||
|
UPDATE options SET value = 'anonymized' WHERE name IN
|
||||||
|
('documentId', 'documentSecret', 'encryptedDataKey',
|
||||||
|
'passwordVerificationHash', 'passwordVerificationSalt',
|
||||||
|
'passwordDerivedKeySalt', 'username', 'syncServerHost', 'syncProxy')
|
||||||
|
AND value != '';
|
||||||
|
|
||||||
|
VACUUM;
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
SET DIR=%~dp0
|
SET DIR=%~dp0
|
||||||
set NODE_TLS_REJECT_UNAUTHORIZED=0
|
set NODE_TLS_REJECT_UNAUTHORIZED=0
|
||||||
cd %DIR%
|
cd %DIR%
|
||||||
start trilium.exe
|
WHERE powershell.exe
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-no-cert-check.ps1)
|
||||||
2
bin/tpl/trilium-no-cert-check.ps1
Normal file
2
bin/tpl/trilium-no-cert-check.ps1
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0
|
||||||
|
./trilium.exe
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
SET DIR=%~dp0
|
SET DIR=%~dp0
|
||||||
SET TRILIUM_DATA_DIR=%DIR%\trilium-data
|
SET TRILIUM_DATA_DIR=%DIR%\trilium-data
|
||||||
cd %DIR%
|
cd %DIR%
|
||||||
start trilium.exe
|
WHERE powershell.exe
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-portable.ps1)
|
||||||
2
bin/tpl/trilium-portable.ps1
Normal file
2
bin/tpl/trilium-portable.ps1
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'
|
||||||
|
./trilium.exe
|
||||||
5
bin/tpl/trilium-safe-mode.bat
Normal file
5
bin/tpl/trilium-safe-mode.bat
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
SET DIR=%~dp0
|
||||||
|
SET TRILIUM_SAFE_MODE=1
|
||||||
|
cd %DIR%
|
||||||
|
WHERE powershell.exe
|
||||||
|
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-safe-mode.ps1)
|
||||||
2
bin/tpl/trilium-safe-mode.ps1
Normal file
2
bin/tpl/trilium-safe-mode.ps1
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1
|
||||||
|
./trilium.exe
|
||||||
7
bin/tpl/trilium-safe-mode.sh
Normal file
7
bin/tpl/trilium-safe-mode.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
DIR=`dirname "$0"`
|
||||||
|
export TRILIUM_SAFE_MODE=1
|
||||||
|
|
||||||
|
"$DIR/trilium"
|
||||||
|
|
||||||
11
db/TODO.txt
Normal file
11
db/TODO.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
- drop branches.utcDateCreated - not used for anything
|
||||||
|
- drop options.utcDateCreated - not used for anything
|
||||||
|
- isDeleted = 0 by default
|
||||||
|
- rename openTabs to openNoteContexts
|
||||||
|
- migrate black theme to dark theme
|
||||||
|
- unify readOnly handling to a single attribute:
|
||||||
|
* readOnly - like now
|
||||||
|
* readOnly=auto - like without readOnly (used to override inherited readOnly)
|
||||||
|
* readOnly=never - like autoReadOnlyDisabled
|
||||||
|
- remove focusOnAttributesKeyboardShortcut
|
||||||
|
- rename white theme to "light" theme (it's not completely white and matches well to dark theme)
|
||||||
BIN
db/demo.zip
BIN
db/demo.zip
Binary file not shown.
@@ -1,5 +0,0 @@
|
|||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
VALUES ('leftPaneMinWidth', '350', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
VALUES ('leftPaneWidthPercent', '20', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
update branches set parentNoteId = 'none' where branchId = 'root'
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
-- first fix deleted status of existing images
|
|
||||||
UPDATE note_images SET isDeleted = 1 WHERE noteId IN (SELECT noteId FROM notes WHERE isDeleted = 1);
|
|
||||||
|
|
||||||
-- we don't need set data to null because table is going to be dropped anyway and we want image size into attribute
|
|
||||||
UPDATE images SET isDeleted = 1 WHERE imageId NOT IN (SELECT imageId FROM note_images WHERE isDeleted = 0);
|
|
||||||
|
|
||||||
-- allow null for note content (for deleted notes)
|
|
||||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO notes_mig (noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash)
|
|
||||||
SELECT noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
|
|
||||||
ALTER TABLE notes_mig RENAME TO notes;
|
|
||||||
|
|
||||||
CREATE TABLE "links" (
|
|
||||||
`linkId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`targetNoteId` TEXT NOT NULL,
|
|
||||||
`type` TEXT NOT NULL,
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`linkId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO links (linkId, noteId, targetNoteId, type, isDeleted, dateCreated, dateModified)
|
|
||||||
SELECT 'L' || SUBSTR(noteImageId, 2), noteId, imageId, 'image', isDeleted, dateCreated, dateModified FROM note_images;
|
|
||||||
|
|
||||||
INSERT INTO branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified, hash, dateCreated)
|
|
||||||
SELECT 'B' || SUBSTR(noteImageId, 2), imageId, noteId, 100, '', 0, isDeleted, dateModified, hash, dateCreated FROM note_images;
|
|
||||||
|
|
||||||
DROP TABLE note_images;
|
|
||||||
|
|
||||||
INSERT INTO notes (noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash)
|
|
||||||
SELECT imageId, name, data, 0, isDeleted, dateCreated, dateModified, 'image', 'image/' || format, hash FROM images;
|
|
||||||
|
|
||||||
INSERT INTO attributes (attributeId, noteId, type, name, value, position, dateCreated, dateModified, isDeleted, hash, isInheritable)
|
|
||||||
SELECT 'O' || SUBSTR(imageId, 2), imageId, 'label', 'originalFileName', name, 0, dateCreated, dateModified, isDeleted, '', 0 FROM images;
|
|
||||||
|
|
||||||
INSERT INTO attributes (attributeId, noteId, type, name, value, position, dateCreated, dateModified, isDeleted, hash, isInheritable)
|
|
||||||
SELECT 'F' || SUBSTR(imageId, 2), imageId, 'label', 'fileSize', LENGTH(data), 0, dateCreated, dateModified, isDeleted, '', 0 FROM images;
|
|
||||||
|
|
||||||
DROP TABLE images;
|
|
||||||
|
|
||||||
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
|
|
||||||
SELECT 'attributes', 'O' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'images';
|
|
||||||
|
|
||||||
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
|
|
||||||
SELECT 'attributes', 'F' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'images';
|
|
||||||
|
|
||||||
UPDATE sync SET entityName = 'notes' WHERE entityName = 'images';
|
|
||||||
|
|
||||||
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
|
|
||||||
SELECT 'links', 'L' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'note_images';
|
|
||||||
|
|
||||||
INSERT INTO sync (entityName, entityId, sourceId, syncDate)
|
|
||||||
SELECT 'branches', 'B' || SUBSTR(entityId, 2), sourceId, syncDate FROM sync WHERE entityName = 'note_images';
|
|
||||||
|
|
||||||
DELETE FROM sync WHERE entityName = 'note_images';
|
|
||||||
DELETE FROM sync WHERE entityName = 'images';
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
create index IDX_links_noteId_index
|
|
||||||
on links (noteId);
|
|
||||||
|
|
||||||
create index IDX_links_targetNoteId_index
|
|
||||||
on links (targetNoteId);
|
|
||||||
|
|
||||||
create index IDX_attributes_name_index
|
|
||||||
on attributes (name);
|
|
||||||
|
|
||||||
create index IDX_attributes_noteId_index
|
|
||||||
on attributes (noteId);
|
|
||||||
|
|
||||||
create index IDX_attributes_value_index
|
|
||||||
on attributes (value);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
UPDATE attributes SET isDeleted = 1 WHERE noteId IN (SELECT noteId FROM notes WHERE isDeleted = 1);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
UPDATE attributes SET isDeleted = 1 WHERE type = 'relation' AND value NOT IN (SELECT noteId FROM notes WHERE notes.isDeleted = 0);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
UPDATE attributes SET value = replace(value, 'mirrorRelation', 'inverseRelation') WHERE type = 'relation-definition';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
UPDATE attributes SET name = 'archived' where name = 'hideInAutocomplete';
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
VALUES ('hoistedNoteId', 'root', '2018-12-11T18:31:00.874Z', '2018-12-11T18:31:00.874Z', 0);
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
const sql = require('../../src/services/sql');
|
|
||||||
|
|
||||||
function prependIv(cipherText, ivText) {
|
|
||||||
const arr = ivText.split("").map(c => parseInt(c) || 0);
|
|
||||||
const iv = Buffer.from(arr);
|
|
||||||
const payload = Buffer.from(cipherText, 'base64');
|
|
||||||
const complete = Buffer.concat([iv, payload]);
|
|
||||||
|
|
||||||
return complete.toString('base64');
|
|
||||||
}
|
|
||||||
|
|
||||||
async function updateEncryptedDataKey() {
|
|
||||||
const encryptedDataKey = await sql.getValue("SELECT value FROM options WHERE name = 'encryptedDataKey'");
|
|
||||||
const encryptedDataKeyIv = await sql.getValue("SELECT value FROM options WHERE name = 'encryptedDataKeyIv'");
|
|
||||||
|
|
||||||
const newEncryptedDataKey = prependIv(encryptedDataKey, encryptedDataKeyIv);
|
|
||||||
|
|
||||||
await sql.execute("UPDATE options SET value = ? WHERE name = 'encryptedDataKey'", [newEncryptedDataKey]);
|
|
||||||
|
|
||||||
await sql.execute("DELETE FROM options WHERE name = 'encryptedDataKeyIv'");
|
|
||||||
await sql.execute("DELETE FROM sync WHERE entityName = 'options' AND entityId = 'encryptedDataKeyIv'");
|
|
||||||
}
|
|
||||||
|
|
||||||
async function updateNotes() {
|
|
||||||
const protectedNotes = await sql.getRows("SELECT noteId, title, content FROM notes WHERE isProtected = 1");
|
|
||||||
|
|
||||||
for (const note of protectedNotes) {
|
|
||||||
if (note.title !== null) {
|
|
||||||
note.title = prependIv(note.title, "0" + note.noteId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (note.content !== null) {
|
|
||||||
note.content = prependIv(note.content, "1" + note.noteId);
|
|
||||||
}
|
|
||||||
|
|
||||||
await sql.execute("UPDATE notes SET title = ?, content = ? WHERE noteId = ?", [note.title, note.content, note.noteId]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function updateNoteRevisions() {
|
|
||||||
const protectedNoteRevisions = await sql.getRows("SELECT noteRevisionId, title, content FROM note_revisions WHERE isProtected = 1");
|
|
||||||
|
|
||||||
for (const noteRevision of protectedNoteRevisions) {
|
|
||||||
if (noteRevision.title !== null) {
|
|
||||||
noteRevision.title = prependIv(noteRevision.title, "0" + noteRevision.noteRevisionId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (noteRevision.content !== null) {
|
|
||||||
noteRevision.content = prependIv(noteRevision.content, "1" + noteRevision.noteRevisionId);
|
|
||||||
}
|
|
||||||
|
|
||||||
await sql.execute("UPDATE note_revisions SET title = ?, content = ? WHERE noteRevisionId = ?", [noteRevision.title, noteRevision.content, noteRevision.noteRevisionId]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
await updateEncryptedDataKey();
|
|
||||||
|
|
||||||
await updateNotes();
|
|
||||||
|
|
||||||
await updateNoteRevisions();
|
|
||||||
};
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
VALUES ('mainFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
VALUES ('treeFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
VALUES ('detailFontSize', '110', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
SELECT 'mainFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
|
|
||||||
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'mainFontSize');
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
SELECT 'treeFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
|
|
||||||
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'treeFontSize');
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
|
|
||||||
SELECT 'detailFontSize', '110', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0
|
|
||||||
WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'detailFontSize');
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
|
||||||
`noteContentId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteContentId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX `IDX_note_contents_noteId` ON `note_contents` (`noteId`);
|
|
||||||
|
|
||||||
INSERT INTO note_contents (noteContentId, noteId, isProtected, content, dateCreated, dateModified)
|
|
||||||
SELECT 'C' || SUBSTR(noteId, 2), noteId, isProtected, content, dateCreated, dateModified FROM notes;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO notes_mig (noteId, title, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash)
|
|
||||||
SELECT noteId, title, isProtected, isDeleted, dateCreated, dateModified, type, mime, hash FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
|
|
||||||
ALTER TABLE notes_mig RENAME TO notes;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
INSERT OR REPLACE INTO sync (entityName, entityId, sourceId, syncDate)
|
|
||||||
SELECT 'note_contents', noteContentId, '', '2019-03-02T18:07:29.182Z' FROM note_contents;
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
UPDATE notes SET title = 'Recovered protected note', isProtected = 0 WHERE noteId IN (
|
|
||||||
SELECT noteId FROM notes JOIN note_contents USING(noteId)
|
|
||||||
WHERE notes.isProtected = 1
|
|
||||||
AND note_contents.isProtected = 0
|
|
||||||
AND notes.isDeleted = 0
|
|
||||||
)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
module.exports = async () => {};
|
|
||||||
@@ -1,236 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "sync_mig" (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
`entityName` TEXT NOT NULL,
|
|
||||||
`entityId` TEXT NOT NULL,
|
|
||||||
`sourceId` TEXT NOT NULL,
|
|
||||||
`utcSyncDate` TEXT NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO sync_mig (id, entityName, entityId, sourceId, utcSyncDate)
|
|
||||||
SELECT id, entityName, entityId, sourceId, REPLACE(syncDate, 'T', ' ') FROM sync;
|
|
||||||
|
|
||||||
DROP TABLE sync;
|
|
||||||
ALTER TABLE sync_mig RENAME TO sync;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "source_ids_mig" (
|
|
||||||
`sourceId` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`sourceId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO source_ids_mig (sourceId, utcDateCreated)
|
|
||||||
SELECT sourceId, REPLACE(dateCreated, 'T', ' ') FROM source_ids;
|
|
||||||
|
|
||||||
DROP TABLE source_ids;
|
|
||||||
ALTER TABLE source_ids_mig RENAME TO source_ids;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (
|
|
||||||
`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT,
|
|
||||||
`content` TEXT,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`utcDateModifiedFrom` TEXT NOT NULL,
|
|
||||||
`utcDateModifiedTo` TEXT NOT NULL,
|
|
||||||
`dateModifiedFrom` TEXT NOT NULL,
|
|
||||||
`dateModifiedTo` TEXT NOT NULL,
|
|
||||||
type TEXT DEFAULT '' NOT NULL,
|
|
||||||
mime TEXT DEFAULT '' NOT NULL,
|
|
||||||
hash TEXT DEFAULT "" NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, content, isProtected, utcDateModifiedFrom, utcDateModifiedTo, dateModifiedFrom, dateModifiedTo, type, mime, hash)
|
|
||||||
SELECT noteRevisionId, noteId, title, content, isProtected, REPLACE(dateModifiedFrom, 'T', ' '), REPLACE(dateModifiedTo, 'T', ' '), REPLACE(REPLACE(dateModifiedFrom, 'T', ' '), 'Z', '+0000'), REPLACE(REPLACE(dateModifiedTo, 'T', ' '), 'Z', '+0000'), type, mime, hash FROM note_revisions;
|
|
||||||
|
|
||||||
DROP TABLE note_revisions;
|
|
||||||
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "api_tokens_mig"
|
|
||||||
(
|
|
||||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
|
||||||
token TEXT NOT NULL,
|
|
||||||
utcDateCreated TEXT NOT NULL,
|
|
||||||
isDeleted INT NOT NULL DEFAULT 0,
|
|
||||||
hash TEXT DEFAULT "" NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO api_tokens_mig (apiTokenId, token, utcDateCreated, isDeleted, hash)
|
|
||||||
SELECT apiTokenId, token, REPLACE(dateCreated, 'T', ' '), isDeleted, hash FROM api_tokens;
|
|
||||||
|
|
||||||
DROP TABLE api_tokens;
|
|
||||||
ALTER TABLE api_tokens_mig RENAME TO api_tokens;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "branches_mig" (
|
|
||||||
`branchId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`parentNoteId` TEXT NOT NULL,
|
|
||||||
`notePosition` INTEGER NOT NULL,
|
|
||||||
`prefix` TEXT,
|
|
||||||
`isExpanded` BOOLEAN,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
utcDateCreated TEXT NOT NULL,
|
|
||||||
hash TEXT DEFAULT "" NOT NULL,
|
|
||||||
PRIMARY KEY(`branchId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO branches_mig (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash)
|
|
||||||
SELECT branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, REPLACE(dateModified, 'T', ' '), REPLACE(dateCreated, 'T', ' '), hash FROM branches;
|
|
||||||
|
|
||||||
DROP TABLE branches;
|
|
||||||
ALTER TABLE branches_mig RENAME TO branches;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "recent_notes_mig" (
|
|
||||||
`branchId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`notePath` TEXT NOT NULL,
|
|
||||||
hash TEXT DEFAULT "" NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
isDeleted INT
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO recent_notes_mig (branchId, notePath, hash, utcDateCreated, isDeleted)
|
|
||||||
SELECT branchId, notePath, hash, REPLACE(dateCreated, 'T', ' '), isDeleted FROM recent_notes;
|
|
||||||
|
|
||||||
DROP TABLE recent_notes;
|
|
||||||
ALTER TABLE recent_notes_mig RENAME TO recent_notes;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "event_log_mig" (
|
|
||||||
`eventId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`noteId` TEXT,
|
|
||||||
`comment` TEXT,
|
|
||||||
`utcDateCreated` TEXT NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO event_log_mig (eventId, noteId, comment, utcDateCreated)
|
|
||||||
SELECT eventId, noteId, comment, REPLACE(dateCreated, 'T', ' ') FROM event_log;
|
|
||||||
|
|
||||||
DROP TABLE event_log;
|
|
||||||
ALTER TABLE event_log_mig RENAME TO event_log;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "options_mig"
|
|
||||||
(
|
|
||||||
name TEXT not null PRIMARY KEY,
|
|
||||||
value TEXT,
|
|
||||||
isSynced INTEGER default 0 not null,
|
|
||||||
hash TEXT default "" not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
utcDateModified TEXT NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO options_mig (name, value, isSynced, hash, utcDateCreated, utcDateModified)
|
|
||||||
SELECT name, value, isSynced, hash, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM options;
|
|
||||||
|
|
||||||
DROP TABLE options;
|
|
||||||
ALTER TABLE options_mig RENAME TO options;
|
|
||||||
|
|
||||||
CREATE TABLE attributes_mig
|
|
||||||
(
|
|
||||||
attributeId TEXT not null primary key,
|
|
||||||
noteId TEXT not null,
|
|
||||||
type TEXT not null,
|
|
||||||
name TEXT not null,
|
|
||||||
value TEXT default '' not null,
|
|
||||||
position INT default 0 not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
utcDateModified TEXT not null,
|
|
||||||
isDeleted INT not null,
|
|
||||||
hash TEXT default "" not null,
|
|
||||||
isInheritable int DEFAULT 0 NULL);
|
|
||||||
|
|
||||||
INSERT INTO attributes_mig (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable)
|
|
||||||
SELECT attributeId, noteId, type, name, value, position, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' '), isDeleted, hash, isInheritable FROM attributes;
|
|
||||||
|
|
||||||
DROP TABLE attributes;
|
|
||||||
ALTER TABLE attributes_mig RENAME TO attributes;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "links_mig" (
|
|
||||||
`linkId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`targetNoteId` TEXT NOT NULL,
|
|
||||||
`type` TEXT NOT NULL,
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`linkId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO links_mig (linkId, noteId, targetNoteId, type, hash, isDeleted, utcDateCreated, utcDateModified)
|
|
||||||
SELECT linkId, noteId, targetNoteId, type, hash, isDeleted, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM links;
|
|
||||||
|
|
||||||
DROP TABLE links;
|
|
||||||
ALTER TABLE links_mig RENAME TO links;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "note_contents_mig" (
|
|
||||||
`noteContentId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteContentId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO note_contents_mig (noteContentId, noteId, isProtected, content, hash, utcDateCreated, utcDateModified)
|
|
||||||
SELECT noteContentId, noteId, isProtected, content, hash, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM note_contents;
|
|
||||||
|
|
||||||
DROP TABLE note_contents;
|
|
||||||
ALTER TABLE note_contents_mig RENAME TO note_contents;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO notes_mig (noteId, title, isProtected, type, mime, hash, isDeleted, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
|
||||||
SELECT noteId, title, isProtected, type, mime, hash, isDeleted, REPLACE(REPLACE(dateCreated, 'T', ' '), 'Z', '+0000'), REPLACE(REPLACE(dateModified, 'T', ' '), 'Z', '+0000'), REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
ALTER TABLE notes_mig RENAME TO notes;
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
|
||||||
`entityName`,
|
|
||||||
`entityId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
|
||||||
`utcSyncDate`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (
|
|
||||||
`noteId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateModifiedFrom` ON `note_revisions` (
|
|
||||||
`utcDateModifiedFrom`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateModifiedTo` ON `note_revisions` (
|
|
||||||
`utcDateModifiedTo`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_branches_noteId` ON `branches` (
|
|
||||||
`noteId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (
|
|
||||||
`noteId`,
|
|
||||||
`parentNoteId`
|
|
||||||
);
|
|
||||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
|
||||||
CREATE INDEX IDX_attributes_name_value
|
|
||||||
on attributes (name, value);
|
|
||||||
CREATE INDEX IDX_links_noteId_index
|
|
||||||
on links (noteId);
|
|
||||||
CREATE INDEX IDX_links_targetNoteId_index
|
|
||||||
on links (targetNoteId);
|
|
||||||
CREATE INDEX IDX_attributes_name_index
|
|
||||||
on attributes (name);
|
|
||||||
CREATE INDEX IDX_attributes_noteId_index
|
|
||||||
on attributes (noteId);
|
|
||||||
CREATE INDEX IDX_attributes_value_index
|
|
||||||
on attributes (value);
|
|
||||||
CREATE UNIQUE INDEX `IDX_note_contents_noteId` ON `note_contents` (`noteId`);
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "note_contents_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO note_contents_mig (noteId, content, hash, utcDateModified)
|
|
||||||
SELECT noteId, content, hash, utcDateModified FROM note_contents;
|
|
||||||
|
|
||||||
DROP TABLE note_contents;
|
|
||||||
ALTER TABLE note_contents_mig RENAME TO note_contents;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
const syncTableService = require('../../src/services/entity_changes.js');
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
await syncTableService.fillAllSyncRows();
|
|
||||||
};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
DROP TABLE IF EXISTS note_fulltext;
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
SELECT 'openTabs', '[{"notePath":"' || value || '","active": true,"tabId":"1111"}]', '2019-05-01T18:31:00.874Z', '2019-05-01T18:31:00.874Z', 0 FROM options WHERE name = 'startNotePath';
|
|
||||||
|
|
||||||
DELETE FROM options WHERE name = 'startNotePath';
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('hideTabRowForOneTab', 'false', '2019-05-01T18:31:00.874Z', '2019-05-01T18:31:00.874Z', 0);
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
drop table recent_notes;
|
|
||||||
|
|
||||||
create table recent_notes
|
|
||||||
(
|
|
||||||
noteId TEXT not null primary key,
|
|
||||||
notePath TEXT not null,
|
|
||||||
hash TEXT default "" not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
isDeleted INT
|
|
||||||
);
|
|
||||||
|
|
||||||
delete from sync where entityName = 'recent_notes';
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
UPDATE links SET type = 'internal-link' WHERE type = 'hyper';
|
|
||||||
UPDATE links SET type = 'image-link' WHERE type = 'image';
|
|
||||||
UPDATE links SET type = 'relation-map-link' WHERE type = 'relation-map';
|
|
||||||
|
|
||||||
INSERT INTO attributes (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable)
|
|
||||||
SELECT linkId, noteId, 'relation', type, targetNoteId, 0, utcDateCreated, utcDateModified, isDeleted, hash, 0 FROM links;
|
|
||||||
|
|
||||||
UPDATE sync SET entityName = 'attributes' WHERE entityName = 'links';
|
|
||||||
|
|
||||||
DROP TABLE links;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('sidebarMinWidth', '350', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('sidebarWidthPercent', '25', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('showSidebarInNewTab', 'true', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('noteInfoWidget', '{"enabled":true,"expanded":true,"position":100}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('attributesWidget', '{"enabled":true,"expanded":true,"position":200}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('linkMapWidget', '{"enabled":true,"expanded":true,"position":300}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('noteRevisionsWidget', '{"enabled":true,"expanded":true,"position":400}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('whatLinksHereWidget', '{"enabled":false,"expanded":true,"position":500}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('codeNotesMimeTypes', '["text/x-csrc","text/x-c++src","text/x-csharp","text/css","text/x-go","text/x-groovy","text/x-haskell","text/html","message/http","text/x-java","application/javascript;env=frontend","application/javascript;env=backend","application/json","text/x-kotlin","text/x-markdown","text/x-perl","text/x-php","text/x-python","text/x-ruby",null,"text/x-sql","text/x-swift","text/xml","text/x-yaml"]', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 1);
|
|
||||||
|
|
||||||
INSERT INTO sync (entityName, entityId, sourceId, utcSyncDate)
|
|
||||||
VALUES ('options' ,'codeNotesMimeTypes', 'SYNC_FILL', '2018-01-01T00:00:00.000Z');
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('similarNotesWidget', '{"enabled":true,"expanded":true,"position":600}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
DROP TABLE event_log;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('editedNotesWidget', '{"enabled":true,"expanded":true,"position":50}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('calendarWidget', '{"enabled":true,"expanded":true,"position":20}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('spellCheckEnabled', 'true', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
|
|
||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
VALUES ('spellCheckLanguageCode', 'en-US', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
|
||||||
SELECT 'hideTabRowForOneTab', 'false', '2019-05-01T18:31:00.874Z', '2019-05-01T18:31:00.874Z', 0
|
|
||||||
WHERE NOT EXISTS(SELECT 1 FROM options WHERE name = 'hideTabRowForOneTab');
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "mig_branches" (
|
|
||||||
`branchId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`parentNoteId` TEXT NOT NULL,
|
|
||||||
`notePosition` INTEGER NOT NULL,
|
|
||||||
`prefix` TEXT,
|
|
||||||
`isExpanded` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
utcDateCreated TEXT NOT NULL,
|
|
||||||
hash TEXT DEFAULT "" NOT NULL,
|
|
||||||
PRIMARY KEY(`branchId`));
|
|
||||||
|
|
||||||
INSERT INTO mig_branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash)
|
|
||||||
SELECT branchId, noteId, parentNoteId, notePosition, prefix, COALESCE(isExpanded, 0), isDeleted, utcDateModified, utcDateCreated, hash FROM branches;
|
|
||||||
|
|
||||||
DROP TABLE branches;
|
|
||||||
ALTER TABLE mig_branches RENAME TO branches;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_branches_noteId` ON `branches` (`noteId`);
|
|
||||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
|
||||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
UPDATE branches SET notePosition = notePosition * 10;
|
|
||||||
UPDATE attributes SET position = position * 10;
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT,
|
|
||||||
`contentLength` INT NOT NULL,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`utcDateLastEdited` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
`dateLastEdited` TEXT NOT NULL,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
type TEXT DEFAULT '' NOT NULL,
|
|
||||||
mime TEXT DEFAULT '' NOT NULL,
|
|
||||||
hash TEXT DEFAULT '' NOT NULL);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`content` TEXT,
|
|
||||||
hash TEXT DEFAULT '' NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO note_revision_contents (noteRevisionId, content, hash, utcDateModified)
|
|
||||||
SELECT noteRevisionId, content, hash, utcDateModifiedTo FROM note_revisions;
|
|
||||||
|
|
||||||
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, contentLength, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
|
|
||||||
SELECT noteRevisionId, noteId, title, COALESCE(LENGTH(content), 0), isProtected, utcDateModifiedFrom, utcDateModifiedTo, utcDateModifiedTo, dateModifiedFrom, dateModifiedTo, type, mime, hash FROM note_revisions;
|
|
||||||
|
|
||||||
DROP TABLE note_revisions;
|
|
||||||
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
|
||||||
|
|
||||||
INSERT INTO sync (entityName, entityId, sourceId, utcSyncDate)
|
|
||||||
SELECT 'note_revision_contents', entityId, sourceId, utcSyncDate FROM sync WHERE entityName = 'note_revisions';
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`));
|
|
||||||
|
|
||||||
INSERT INTO notes_mig (noteId, title, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
|
||||||
SELECT noteId, title, isProtected, type, mime, hash, isDeleted, 0, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
ALTER TABLE notes_mig RENAME TO notes;
|
|
||||||
|
|
||||||
UPDATE notes SET isErased = 1 WHERE isDeleted = 1
|
|
||||||
AND 1=(SELECT CASE WHEN content IS NULL THEN 1 ELSE 0 END FROM note_contents WHERE note_contents.noteId = notes.noteId);
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
|
||||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
|
||||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
|
||||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`contentLength` INT NOT NULL,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`));
|
|
||||||
|
|
||||||
INSERT INTO notes_mig (noteId, title, contentLength, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
|
||||||
SELECT noteId, title, -1, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
ALTER TABLE notes_mig RENAME TO notes;
|
|
||||||
|
|
||||||
UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1);
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
|
||||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
|
||||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
|
||||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
|
||||||
|
|
||||||
-- should be OK since sync protocol changes so all instances must upgrade
|
|
||||||
UPDATE attributes SET isDeleted = 1 WHERE name = 'fileSize';
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT,
|
|
||||||
`contentLength` INT NOT NULL,
|
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`utcDateLastEdited` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
`dateLastEdited` TEXT NOT NULL,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
type TEXT DEFAULT '' NOT NULL,
|
|
||||||
mime TEXT DEFAULT '' NOT NULL,
|
|
||||||
hash TEXT DEFAULT '' NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, contentLength, isErased, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
|
|
||||||
SELECT noteRevisionId, noteId, title, contentLength, 0, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash FROM note_revisions;
|
|
||||||
|
|
||||||
DROP TABLE note_revisions;
|
|
||||||
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
|
|
||||||
|
|
||||||
UPDATE note_revisions SET isErased = (SELECT isErased FROM notes WHERE notes.noteId = note_revisions.noteId);
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
UPDATE attributes SET name = 'internalLink' WHERE name = 'internal-link';
|
|
||||||
UPDATE attributes SET name = 'imageLink' WHERE name = 'image-link';
|
|
||||||
UPDATE attributes SET name = 'relationMapLink' WHERE name = 'relation-map-link';
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
DROP INDEX IF EXISTS IDX_attributes_name_index;
|
|
||||||
DROP INDEX IF EXISTS IDX_branches_noteId;
|
|
||||||
|
|
||||||
CREATE INDEX IDX_source_ids_utcDateCreated
|
|
||||||
on source_ids (utcDateCreated);
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`contentLength` INT NOT NULL,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`));
|
|
||||||
|
|
||||||
INSERT INTO notes_mig (noteId, title, contentLength, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
|
||||||
SELECT noteId, title, -1, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
ALTER TABLE notes_mig RENAME TO notes;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
|
||||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
|
||||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
|
||||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "branches_mig" (
|
|
||||||
`branchId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`parentNoteId` TEXT NOT NULL,
|
|
||||||
`notePosition` INTEGER NOT NULL,
|
|
||||||
`prefix` TEXT,
|
|
||||||
`isExpanded` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
utcDateCreated TEXT NOT NULL,
|
|
||||||
hash TEXT DEFAULT "" NOT NULL,
|
|
||||||
PRIMARY KEY(`branchId`));
|
|
||||||
|
|
||||||
INSERT INTO branches_mig (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash)
|
|
||||||
SELECT branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash FROM branches;
|
|
||||||
|
|
||||||
DROP TABLE branches;
|
|
||||||
ALTER TABLE branches_mig RENAME TO branches;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
|
||||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "attributes_mig"
|
|
||||||
(
|
|
||||||
attributeId TEXT not null primary key,
|
|
||||||
noteId TEXT not null,
|
|
||||||
type TEXT not null,
|
|
||||||
name TEXT not null,
|
|
||||||
value TEXT default '' not null,
|
|
||||||
position INT default 0 not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
utcDateModified TEXT not null,
|
|
||||||
isDeleted INT not null,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
hash TEXT default "" not null,
|
|
||||||
isInheritable int DEFAULT 0 NULL);
|
|
||||||
|
|
||||||
INSERT INTO attributes_mig (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable)
|
|
||||||
SELECT attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable FROM attributes;
|
|
||||||
|
|
||||||
DROP TABLE attributes;
|
|
||||||
ALTER TABLE attributes_mig RENAME TO attributes;
|
|
||||||
|
|
||||||
CREATE INDEX IDX_attributes_name_value
|
|
||||||
on attributes (name, value);
|
|
||||||
CREATE INDEX IDX_attributes_noteId_index
|
|
||||||
on attributes (noteId);
|
|
||||||
CREATE INDEX IDX_attributes_value_index
|
|
||||||
on attributes (value);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1);
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "sync_mig" (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
`entityName` TEXT NOT NULL,
|
|
||||||
`entityId` TEXT NOT NULL,
|
|
||||||
`sourceId` TEXT NOT NULL,
|
|
||||||
`isSynced` INTEGER default 0 not null,
|
|
||||||
`utcSyncDate` TEXT NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO sync_mig (id, entityName, entityId, sourceId, isSynced, utcSyncDate)
|
|
||||||
SELECT id, entityName, entityId, sourceId, 1, utcSyncDate FROM sync;
|
|
||||||
|
|
||||||
DROP TABLE sync;
|
|
||||||
|
|
||||||
ALTER TABLE sync_mig RENAME TO sync;
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
|
||||||
`entityName`,
|
|
||||||
`entityId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
|
||||||
`utcSyncDate`
|
|
||||||
);
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
UPDATE sync SET isSynced = 1 WHERE entityName != 'options' OR (
|
|
||||||
entityName = 'options'
|
|
||||||
AND 1 = (SELECT isSynced FROM options WHERE name = sync.entityId)
|
|
||||||
)
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
UPDATE attributes SET type = 'label', name = 'label:' || name WHERE type = 'label-definition';
|
|
||||||
UPDATE attributes SET type = 'label', name = 'relation:' || name WHERE type = 'relation-definition';
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
const sql = require('../../src/services/sql');
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
for (const attr of sql.getRows("SELECT * FROM attributes WHERE name LIKE 'label:%'")) {
|
|
||||||
let obj;
|
|
||||||
|
|
||||||
try {
|
|
||||||
obj = JSON.parse(attr.value);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log(`Parsing attribute definition "${attr.value}" of ${attr.attributeId} failed with error "${e.message}", setting to default value.`);
|
|
||||||
|
|
||||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?',
|
|
||||||
["multi,text", attr.attributeId]);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tokens = [];
|
|
||||||
|
|
||||||
if (obj.isPromoted) {
|
|
||||||
tokens.push('promoted');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.multiplicityType === 'singlevalue') {
|
|
||||||
tokens.push('single');
|
|
||||||
} else if (obj.multiplicityType === 'multivalue') {
|
|
||||||
tokens.push('multi');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.labelType) {
|
|
||||||
tokens.push(obj.labelType);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.numberPrecision) {
|
|
||||||
tokens.push('precision='+obj.numberPrecision);
|
|
||||||
}
|
|
||||||
|
|
||||||
const newValue = tokens.join(',');
|
|
||||||
|
|
||||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?', [newValue, attr.attributeId]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const attr of sql.getRows("SELECT * FROM attributes WHERE name LIKE 'relation:%'")) {
|
|
||||||
let obj;
|
|
||||||
|
|
||||||
try {
|
|
||||||
obj = JSON.parse(attr.value);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log(`Parsing attribute definition "${attr.value}" of ${attr.attributeId} failed with error "${e.message}", setting to default value.`);
|
|
||||||
|
|
||||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?',
|
|
||||||
["multi", attr.attributeId]);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tokens = [];
|
|
||||||
|
|
||||||
if (obj.isPromoted) {
|
|
||||||
tokens.push('promoted');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.multiplicityType === 'singlevalue') {
|
|
||||||
tokens.push('single');
|
|
||||||
} else if (obj.multiplicityType === 'multivalue') {
|
|
||||||
tokens.push('multi');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.inverseRelation) {
|
|
||||||
tokens.push('inverse=' + obj.inverseRelation);
|
|
||||||
}
|
|
||||||
|
|
||||||
const newValue = tokens.join(',');
|
|
||||||
|
|
||||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?', [newValue, attr.attributeId]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
DROP TABLE source_ids;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ALTER TABLE sync RENAME TO entity_changes;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
`entityName` TEXT NOT NULL,
|
|
||||||
`entityId` TEXT NOT NULL,
|
|
||||||
`sourceId` TEXT NOT NULL,
|
|
||||||
`isSynced` INTEGER default 0 not null,
|
|
||||||
`utcChangedDate` TEXT NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO mig_entity_changes (id, entityName, entityId, sourceId, isSynced, utcChangedDate)
|
|
||||||
SELECT id, entityName, entityId, sourceId, isSynced, utcSyncDate FROM entity_changes;
|
|
||||||
|
|
||||||
DROP TABLE entity_changes;
|
|
||||||
|
|
||||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
|
||||||
`entityName`,
|
|
||||||
`entityId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_entityChanges_utcChangedDate` ON "entity_changes" (
|
|
||||||
`utcChangedDate`
|
|
||||||
);
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`));
|
|
||||||
|
|
||||||
INSERT INTO notes_mig (noteId, title, isProtected, type, mime, hash, isDeleted, deleteId, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
|
||||||
SELECT noteId, title, isProtected, type, mime, hash, isDeleted, deleteId, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
ALTER TABLE notes_mig RENAME TO notes;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
|
||||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
|
||||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
|
||||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT,
|
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`utcDateLastEdited` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
`dateLastEdited` TEXT NOT NULL,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
type TEXT DEFAULT '' NOT NULL,
|
|
||||||
mime TEXT DEFAULT '' NOT NULL,
|
|
||||||
hash TEXT DEFAULT '' NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, isErased, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
|
|
||||||
SELECT noteRevisionId, noteId, title, isErased, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash FROM note_revisions;
|
|
||||||
|
|
||||||
DROP TABLE note_revisions;
|
|
||||||
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "note_contents_mig" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO note_contents_mig (noteId, content, hash, dateModified, utcDateModified)
|
|
||||||
SELECT noteId,
|
|
||||||
content,
|
|
||||||
hash,
|
|
||||||
COALESCE((SELECT dateModified FROM notes WHERE noteId = note_contents.noteId), utcDateModified),
|
|
||||||
utcDateModified
|
|
||||||
FROM note_contents;
|
|
||||||
|
|
||||||
DROP TABLE note_contents;
|
|
||||||
|
|
||||||
ALTER TABLE note_contents_mig RENAME TO note_contents;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
DELETE FROM options WHERE name = 'keyboardShortcutsActivateParentNote';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
UPDATE attributes SET name = 'archived' WHERE name = 'hideInAutocomplete';
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
const repository = require('../../src/services/repository');
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
for (const note of repository.getEntities("SELECT * FROM notes WHERE type = 'text' AND isProtected = 0")) {
|
|
||||||
try {
|
|
||||||
let origContent = note.getContent();
|
|
||||||
|
|
||||||
const newContent = origContent
|
|
||||||
.replace(/<h1/ig, "<h2")
|
|
||||||
.replace(/<\/h1/ig, "</h2");
|
|
||||||
|
|
||||||
if (newContent !== origContent) {
|
|
||||||
note.setContent(newContent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log(`Changing note content for note ${note.noteId} failed with: ${e.message} ${e.stack}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
const repository = require('../../src/services/repository');
|
|
||||||
const sql = require('../../src/services/sql');
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
for (const note of repository.getEntities("SELECT * FROM notes")) {
|
|
||||||
let position = 0;
|
|
||||||
|
|
||||||
for (const branch of note.getChildBranches()) {
|
|
||||||
sql.execute(`UPDATE branches SET notePosition = ? WHERE branchId = ?`, [position, branch.branchId]);
|
|
||||||
|
|
||||||
position += 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
DELETE FROM options WHERE name IN (
|
|
||||||
'noteInfoWidget',
|
|
||||||
'attributesWidget',
|
|
||||||
'linkMapWidget',
|
|
||||||
'noteRevisionsWidget',
|
|
||||||
'whatLinksHereWidget',
|
|
||||||
'codeNotesMimeTypes',
|
|
||||||
'similarNotesWidget',
|
|
||||||
'editedNotesWidget',
|
|
||||||
'calendarWidget',
|
|
||||||
'sidebarMinWidth',
|
|
||||||
'sidebarWidthPercent',
|
|
||||||
'showSidebarInNewTab',
|
|
||||||
'hoistedNoteId'
|
|
||||||
);
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
`entityName` TEXT NOT NULL,
|
|
||||||
`entityId` TEXT NOT NULL,
|
|
||||||
`hash` TEXT NOT NULL,
|
|
||||||
`sourceId` TEXT NOT NULL,
|
|
||||||
`isErased` INT NOT NULL,
|
|
||||||
`utcDateChanged` TEXT NOT NULL,
|
|
||||||
`isSynced` INTEGER NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, utcDateChanged, isErased)
|
|
||||||
SELECT id, entityName, entityId, '', sourceId, isSynced, utcChangedDate, 0 FROM entity_changes;
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET isErased = COALESCE((SELECT isErased FROM notes WHERE noteId = entityId), 0) WHERE entityName = 'notes';
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'notes';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET isErased = COALESCE((SELECT isErased FROM notes WHERE noteId = entityId), 0) WHERE entityName = 'note_contents';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET isErased = COALESCE((
|
|
||||||
SELECT isErased
|
|
||||||
FROM attributes
|
|
||||||
JOIN notes USING(noteId)
|
|
||||||
WHERE attributeId = entityId
|
|
||||||
), 0) WHERE entityName = 'attributes';
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM attributes WHERE attributeId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'attributes';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET isErased = COALESCE((
|
|
||||||
SELECT isErased
|
|
||||||
FROM branches
|
|
||||||
JOIN notes USING(noteId)
|
|
||||||
WHERE branchId = entityId
|
|
||||||
), 0) WHERE entityName = 'branches';
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM branches WHERE branchId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'branches';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET isErased = COALESCE((
|
|
||||||
SELECT isErased
|
|
||||||
FROM note_revisions
|
|
||||||
WHERE noteRevisionId = entityId
|
|
||||||
), 0) WHERE entityName = 'note_revisions';
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_revisions WHERE noteRevisionId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_revisions';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateCreated FROM api_tokens WHERE apiTokenId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'api_tokens';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_contents WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_contents';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_revision_contents WHERE noteRevisionId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_revision_contents';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM options WHERE name = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'options';
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateCreated FROM recent_notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'options';
|
|
||||||
|
|
||||||
DROP TABLE entity_changes;
|
|
||||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
|
||||||
`entityName`,
|
|
||||||
`entityId`
|
|
||||||
);
|
|
||||||
|
|
||||||
DELETE FROM attributes WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
|
||||||
DELETE FROM branches WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
|
||||||
DELETE FROM note_contents WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
|
||||||
DELETE FROM note_revision_contents WHERE noteRevisionId IN (
|
|
||||||
SELECT noteRevisionId FROM note_revisions WHERE isErased = 1
|
|
||||||
);
|
|
||||||
DELETE FROM note_revisions WHERE isErased = 1;
|
|
||||||
DELETE FROM notes WHERE isErased = 1;
|
|
||||||
|
|
||||||
UPDATE entity_changes SET isErased = COALESCE((SELECT isErased FROM entity_changes AS sub WHERE sub.entityId = entity_changes.entityId AND sub.entityName = 'note_revisions'), 0) WHERE entityName = 'note_revision_contents';
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
`entityName` TEXT NOT NULL,
|
|
||||||
`entityId` TEXT NOT NULL,
|
|
||||||
`hash` TEXT NOT NULL,
|
|
||||||
`isErased` INT NOT NULL,
|
|
||||||
`sourceId` TEXT NOT NULL,
|
|
||||||
`isSynced` INTEGER NOT NULL,
|
|
||||||
`utcDateChanged` TEXT NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, isErased, utcDateChanged)
|
|
||||||
SELECT id, entityName, entityId, '', sourceId, isSynced, isErased, utcDateChanged FROM entity_changes;
|
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM api_tokens WHERE apiTokenId = entityId), '') WHERE entityName = 'api_tokens';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM attributes WHERE attributeId = entityId), '') WHERE entityName = 'attributes';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM branches WHERE branchId = entityId), '') WHERE entityName = 'branches';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM notes WHERE noteId = entityId), '') WHERE entityName = 'notes';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_contents WHERE noteId = entityId), '') WHERE entityName = 'note_contents';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_revisions WHERE noteRevisionId = entityId), '') WHERE entityName = 'note_revisions';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_revision_contents WHERE noteRevisionId = entityId), '') WHERE entityName = 'note_revision_contents';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM options WHERE name = entityId), '') WHERE entityName = 'options';
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM recent_notes WHERE noteId = entityId), '') WHERE entityName = 'recent_notes';
|
|
||||||
|
|
||||||
DROP TABLE entity_changes;
|
|
||||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
|
||||||
`entityName`,
|
|
||||||
`entityId`
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_api_tokens"
|
|
||||||
(
|
|
||||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
|
||||||
token TEXT NOT NULL,
|
|
||||||
utcDateCreated TEXT NOT NULL,
|
|
||||||
isDeleted INT NOT NULL DEFAULT 0);
|
|
||||||
|
|
||||||
INSERT INTO mig_api_tokens (apiTokenId, token, utcDateCreated, isDeleted)
|
|
||||||
SELECT apiTokenId, token, utcDateCreated, isDeleted FROM api_tokens;
|
|
||||||
|
|
||||||
DROP TABLE api_tokens;
|
|
||||||
ALTER TABLE mig_api_tokens RENAME TO api_tokens;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_attributes"
|
|
||||||
(
|
|
||||||
attributeId TEXT not null primary key,
|
|
||||||
noteId TEXT not null,
|
|
||||||
type TEXT not null,
|
|
||||||
name TEXT not null,
|
|
||||||
value TEXT default '' not null,
|
|
||||||
position INT default 0 not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
utcDateModified TEXT not null,
|
|
||||||
isDeleted INT not null,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
isInheritable int DEFAULT 0 NULL);
|
|
||||||
|
|
||||||
INSERT INTO mig_attributes (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, deleteId, isInheritable)
|
|
||||||
SELECT attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, deleteId, isInheritable FROM attributes;
|
|
||||||
|
|
||||||
DROP TABLE attributes;
|
|
||||||
ALTER TABLE mig_attributes RENAME TO attributes;
|
|
||||||
|
|
||||||
CREATE INDEX IDX_attributes_name_value
|
|
||||||
on attributes (name, value);
|
|
||||||
CREATE INDEX IDX_attributes_noteId_index
|
|
||||||
on attributes (noteId);
|
|
||||||
CREATE INDEX IDX_attributes_value_index
|
|
||||||
on attributes (value);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_branches" (
|
|
||||||
`branchId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`parentNoteId` TEXT NOT NULL,
|
|
||||||
`notePosition` INTEGER NOT NULL,
|
|
||||||
`prefix` TEXT,
|
|
||||||
`isExpanded` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
utcDateCreated TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`branchId`));
|
|
||||||
|
|
||||||
INSERT INTO mig_branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, deleteId, utcDateModified, utcDateCreated)
|
|
||||||
SELECT branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, deleteId, utcDateModified, utcDateCreated FROM branches;
|
|
||||||
|
|
||||||
DROP TABLE branches;
|
|
||||||
ALTER TABLE mig_branches RENAME TO branches;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
|
||||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_notes" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`));
|
|
||||||
|
|
||||||
INSERT INTO mig_notes (noteId, title, isProtected, type, mime, isDeleted, deleteId, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
|
||||||
SELECT noteId, title, isProtected, type, mime, isDeleted, deleteId, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
|
||||||
|
|
||||||
DROP TABLE notes;
|
|
||||||
ALTER TABLE mig_notes RENAME TO notes;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
|
||||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
|
||||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
|
||||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_note_contents" (
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`noteId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO mig_note_contents (noteId, content, dateModified, utcDateModified)
|
|
||||||
SELECT noteId, content, dateModified, utcDateModified FROM note_contents;
|
|
||||||
|
|
||||||
DROP TABLE note_contents;
|
|
||||||
ALTER TABLE mig_note_contents RENAME TO note_contents;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
type TEXT DEFAULT '' NOT NULL,
|
|
||||||
mime TEXT DEFAULT '' NOT NULL,
|
|
||||||
`title` TEXT,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`utcDateLastEdited` TEXT NOT NULL,
|
|
||||||
`utcDateCreated` TEXT NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL,
|
|
||||||
`dateLastEdited` TEXT NOT NULL,
|
|
||||||
`dateCreated` TEXT NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO mig_note_revisions (noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated)
|
|
||||||
SELECT noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated FROM note_revisions;
|
|
||||||
|
|
||||||
DROP TABLE note_revisions;
|
|
||||||
ALTER TABLE mig_note_revisions RENAME TO note_revisions;
|
|
||||||
|
|
||||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`content` TEXT,
|
|
||||||
`utcDateModified` TEXT NOT NULL);
|
|
||||||
|
|
||||||
INSERT INTO mig_note_revision_contents (noteRevisionId, content, utcDateModified)
|
|
||||||
SELECT noteRevisionId, content, utcDateModified FROM note_revision_contents;
|
|
||||||
|
|
||||||
DROP TABLE note_revision_contents;
|
|
||||||
ALTER TABLE mig_note_revision_contents RENAME TO note_revision_contents;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS "mig_options"
|
|
||||||
(
|
|
||||||
name TEXT not null PRIMARY KEY,
|
|
||||||
value TEXT,
|
|
||||||
isSynced INTEGER default 0 not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
utcDateModified TEXT NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO mig_options (name, value, isSynced, utcDateCreated, utcDateModified)
|
|
||||||
SELECT name, value, isSynced, utcDateCreated, utcDateModified FROM options;
|
|
||||||
|
|
||||||
DROP TABLE options;
|
|
||||||
ALTER TABLE mig_options RENAME TO options;
|
|
||||||
|
|
||||||
CREATE TABLE mig_recent_notes
|
|
||||||
(
|
|
||||||
noteId TEXT not null primary key,
|
|
||||||
notePath TEXT not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
isDeleted INT NOT NULL DEFAULT 0
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO mig_recent_notes (noteId, notePath, utcDateCreated, isDeleted)
|
|
||||||
SELECT noteId, notePath, utcDateCreated, isDeleted FROM recent_notes;
|
|
||||||
|
|
||||||
DROP TABLE recent_notes;
|
|
||||||
ALTER TABLE mig_recent_notes RENAME TO recent_notes;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
UPDATE options SET name = 'eraseEntitiesAfterTimeInSeconds' WHERE name = 'eraseNotesAfterTimeInSeconds';
|
|
||||||
UPDATE entity_changes SET entityId = 'eraseEntitiesAfterTimeInSeconds' WHERE entityName = 'options' AND entityId = 'eraseNotesAfterTimeInSeconds';
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "mig_attributes"
|
|
||||||
(
|
|
||||||
attributeId TEXT not null primary key,
|
|
||||||
noteId TEXT not null,
|
|
||||||
type TEXT not null,
|
|
||||||
name TEXT not null,
|
|
||||||
value TEXT default '' not null,
|
|
||||||
position INT default 0 not null,
|
|
||||||
utcDateModified TEXT not null,
|
|
||||||
isDeleted INT not null,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
isInheritable int DEFAULT 0 NULL);
|
|
||||||
|
|
||||||
INSERT INTO mig_attributes (attributeId, noteId, type, name, value, position, utcDateModified, isDeleted, deleteId, isInheritable)
|
|
||||||
SELECT attributeId, noteId, type, name, value, position, utcDateModified, isDeleted, deleteId, isInheritable FROM attributes;
|
|
||||||
|
|
||||||
DROP TABLE attributes;
|
|
||||||
ALTER TABLE mig_attributes RENAME TO attributes;
|
|
||||||
|
|
||||||
CREATE INDEX IDX_attributes_name_value
|
|
||||||
on attributes (name, value);
|
|
||||||
CREATE INDEX IDX_attributes_noteId_index
|
|
||||||
on attributes (noteId);
|
|
||||||
CREATE INDEX IDX_attributes_value_index
|
|
||||||
on attributes (value);
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
DELETE FROM options WHERE name = 'keyboardShortcutsCreateNoteIntoInbox'; -- in case there is already one which shouldn't (except for in-dev documents)
|
|
||||||
UPDATE options SET name = 'keyboardShortcutsCreateNoteIntoInbox' WHERE name = 'keyboardShortcutsCreateNoteIntoDayNote';
|
|
||||||
|
|
||||||
DELETE FROM options WHERE name = 'keyboardShortcutsShowAttributes';
|
|
||||||
DELETE FROM entity_changes WHERE entityName = 'options' AND entityId = 'keyboardShortcutsShowAttributes';
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user