fix database migrations

This commit is contained in:
Oscar Beaumont 2022-10-25 06:53:24 +10:00
parent 130443d689
commit b099d47fec
3 changed files with 79 additions and 80 deletions

View file

@ -8,7 +8,8 @@
"vite": "vite",
"dev": "tauri dev",
"tauri": "tauri",
"build": "tauri build"
"build": "tauri build",
"dmg": "open ../../target/release/bundle/dmg/"
},
"dependencies": {
"@rspc/tauri": "^0.0.0-main-7c0a67c1",

View file

@ -0,0 +1,40 @@
/*
Warnings:
- You are about to drop the column `checksum` on the `key` table. All the data in the column will be lost.
- You are about to alter the column `algorithm` on the `key` table. The data in that column could be lost. The data in that column will be cast from `Int` to `Binary`.
- Added the required column `content_salt` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `default` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `hashing_algorithm` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `key` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `key_nonce` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `master_key` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `master_key_nonce` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `salt` to the `key` table without a default value. This is not possible if the table is not empty.
- Added the required column `uuid` to the `key` table without a default value. This is not possible if the table is not empty.
- Made the column `algorithm` on table `key` required. This step will fail if there are existing NULL values in that column.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_key" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"uuid" TEXT NOT NULL,
"name" TEXT,
"default" BOOLEAN NOT NULL,
"date_created" DATETIME DEFAULT CURRENT_TIMESTAMP,
"algorithm" BLOB NOT NULL,
"hashing_algorithm" BLOB NOT NULL,
"salt" BLOB NOT NULL,
"content_salt" BLOB NOT NULL,
"master_key" BLOB NOT NULL,
"master_key_nonce" BLOB NOT NULL,
"key_nonce" BLOB NOT NULL,
"key" BLOB NOT NULL
);
INSERT INTO "new_key" ("algorithm", "date_created", "id", "name") SELECT "algorithm", "date_created", "id", "name" FROM "key";
DROP TABLE "key";
ALTER TABLE "new_key" RENAME TO "key";
CREATE UNIQUE INDEX "key_uuid_key" ON "key"("uuid");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;

View file

@ -253,7 +253,7 @@ importers:
moti: 0.18.0_react@18.0.0
phosphor-react-native: 1.1.2_ipumakbosk2s7ylysjmrulvctq
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-gesture-handler: 2.5.0_jk6ntyzimkrv4hwdmdgaaf5yaa
react-native-heroicons: 2.2.0_wxlif5cfng7xfd3uerlw46xcs4
react-native-reanimated: 2.10.0_ifayjdo6vuwky63y7hdw4ayxzu
@ -361,7 +361,7 @@ importers:
'@types/node': 18.11.0
autoprefixer: 10.4.12_postcss@8.4.18
postcss: 8.4.18
tailwindcss: 3.1.8_postcss@8.4.18
tailwindcss: 3.1.8
typescript: 4.8.4
vite: 3.1.8
vite-plugin-solid: 2.3.9_solid-js@1.5.9+vite@3.1.8
@ -382,7 +382,7 @@ importers:
scripts: '*'
tsconfig: '*'
typescript: ^4.8.4
valtio: ^1.7.0
valtio: ^1.7.4
valtio-persist: ^1.0.2
dependencies:
'@rspc/client': 0.0.0-main-7c0a67c1
@ -2907,7 +2907,7 @@ packages:
'@gorhom/portal': 1.0.14_jk6ntyzimkrv4hwdmdgaaf5yaa
invariant: 2.2.4
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-gesture-handler: 2.5.0_jk6ntyzimkrv4hwdmdgaaf5yaa
react-native-reanimated: 2.10.0_ifayjdo6vuwky63y7hdw4ayxzu
dev: false
@ -2920,7 +2920,7 @@ packages:
dependencies:
nanoid: 3.3.4
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
dev: false
/@graphql-typed-document-node/core/3.1.1_graphql@15.8.0:
@ -4373,7 +4373,7 @@ packages:
react-native: ^0.0.0-0 || 0.60 - 0.70 || 1000.0.0
dependencies:
merge-options: 3.0.4
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
dev: false
/@react-native-community/cli-clean/8.0.4:
@ -4466,7 +4466,7 @@ packages:
transitivePeerDependencies:
- encoding
/@react-native-community/cli-plugin-metro/8.0.4_@babel+core@7.19.3:
/@react-native-community/cli-plugin-metro/8.0.4:
resolution: {integrity: sha512-UWzY1eMcEr/6262R2+d0Is5M3L/7Y/xXSDIFMoc5Rv5Wucl3hJM/TxHXmByvHpuJf6fJAfqOskyt4bZCvbI+wQ==}
dependencies:
'@react-native-community/cli-server-api': 8.0.4
@ -4475,12 +4475,11 @@ packages:
metro: 0.70.3
metro-config: 0.70.3
metro-core: 0.70.3
metro-react-native-babel-transformer: 0.70.3_@babel+core@7.19.3
metro-react-native-babel-transformer: 0.70.3
metro-resolver: 0.70.3
metro-runtime: 0.70.3
readline: 1.3.0
transitivePeerDependencies:
- '@babel/core'
- bufferutil
- encoding
- supports-color
@ -4525,7 +4524,7 @@ packages:
dependencies:
joi: 17.6.3
/@react-native-community/cli/8.0.6_2wrsnxuq7u2kmzd6diim7k7fvu:
/@react-native-community/cli/8.0.6_react-native@0.69.4:
resolution: {integrity: sha512-E36hU/if3quQCfJHGWVkpsCnwtByRCwORuAX0r6yr1ebKktpKeEO49zY9PAu/Z1gfyxCtgluXY0HfRxjKRFXTg==}
engines: {node: '>=12'}
hasBin: true
@ -4537,7 +4536,7 @@ packages:
'@react-native-community/cli-debugger-ui': 8.0.0
'@react-native-community/cli-doctor': 8.0.6
'@react-native-community/cli-hermes': 8.0.5
'@react-native-community/cli-plugin-metro': 8.0.4_@babel+core@7.19.3
'@react-native-community/cli-plugin-metro': 8.0.4
'@react-native-community/cli-server-api': 8.0.4
'@react-native-community/cli-tools': 8.0.4
'@react-native-community/cli-types': 8.0.0
@ -4551,10 +4550,9 @@ packages:
lodash: 4.17.21
minimist: 1.2.7
prompts: 2.4.2
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
semver: 6.3.0
transitivePeerDependencies:
- '@babel/core'
- bufferutil
- encoding
- supports-color
@ -4567,7 +4565,7 @@ packages:
react-native: '>=0.57'
dependencies:
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
dev: false
/@react-native/assets/1.0.0:
@ -4592,7 +4590,7 @@ packages:
'@react-navigation/native': 6.0.13_jk6ntyzimkrv4hwdmdgaaf5yaa
color: 4.2.3
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-safe-area-context: 4.3.1_jk6ntyzimkrv4hwdmdgaaf5yaa
react-native-screens: 3.15.0_jk6ntyzimkrv4hwdmdgaaf5yaa
warn-once: 0.1.1
@ -4627,7 +4625,7 @@ packages:
'@react-navigation/native': 6.0.13_jk6ntyzimkrv4hwdmdgaaf5yaa
color: 4.2.3
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-gesture-handler: 2.5.0_jk6ntyzimkrv4hwdmdgaaf5yaa
react-native-reanimated: 2.10.0_ifayjdo6vuwky63y7hdw4ayxzu
react-native-safe-area-context: 4.3.1_jk6ntyzimkrv4hwdmdgaaf5yaa
@ -4645,7 +4643,7 @@ packages:
dependencies:
'@react-navigation/native': 6.0.13_jk6ntyzimkrv4hwdmdgaaf5yaa
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-safe-area-context: 4.3.1_jk6ntyzimkrv4hwdmdgaaf5yaa
dev: false
@ -4660,7 +4658,7 @@ packages:
fast-deep-equal: 3.1.3
nanoid: 3.3.4
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
dev: false
/@react-navigation/routers/6.1.3:
@ -4683,7 +4681,7 @@ packages:
'@react-navigation/native': 6.0.13_jk6ntyzimkrv4hwdmdgaaf5yaa
color: 4.2.3
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-gesture-handler: 2.5.0_jk6ntyzimkrv4hwdmdgaaf5yaa
react-native-safe-area-context: 4.3.1_jk6ntyzimkrv4hwdmdgaaf5yaa
react-native-screens: 3.15.0_jk6ntyzimkrv4hwdmdgaaf5yaa
@ -4839,7 +4837,7 @@ packages:
'@rnx-kit/tools-node': 1.3.0
'@rnx-kit/tools-workspaces': 0.1.1
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
transitivePeerDependencies:
- '@babel/core'
- '@babel/plugin-transform-typescript'
@ -6808,7 +6806,7 @@ packages:
dependencies:
'@tanstack/query-core': 4.12.0
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
use-sync-external-store: 1.2.0_react@18.0.0
dev: false
@ -8532,7 +8530,6 @@ packages:
normalize-range: 0.1.2
picocolors: 1.0.0
postcss-value-parser: 4.2.0
dev: false
/autoprefixer/10.4.12_postcss@8.4.18:
resolution: {integrity: sha512-WrCGV9/b97Pa+jtwf5UGaRjgQIg7OK3D06GnoYoZNcG1Xb8Gt3EfuKjlhh9i/VtT16g6PYjZ69jdJ2g8FxSC4Q==}
@ -8778,7 +8775,7 @@ packages:
'@babel/preset-env': 7.19.4_@babel+core@7.19.3
babel-plugin-module-resolver: 4.1.0
babel-plugin-react-native-web: 0.18.9
metro-react-native-babel-preset: 0.70.3_@babel+core@7.19.3
metro-react-native-babel-preset: 0.70.3
transitivePeerDependencies:
- '@babel/core'
- supports-color
@ -15225,7 +15222,7 @@ packages:
dependencies:
invariant: 2.2.4
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-safe-modules: 1.0.3_react-native@0.69.4
dev: false
@ -15657,10 +15654,8 @@ packages:
dependencies:
uglify-es: 3.3.9
/metro-react-native-babel-preset/0.70.3_@babel+core@7.19.3:
/metro-react-native-babel-preset/0.70.3:
resolution: {integrity: sha512-4Nxc1zEiHEu+GTdEMEsHnRgfaBkg8f/Td3+FcQ8NTSvs+xL3LBrQy6N07idWSQZHIdGFf+tTHvRfSIWLD8u8Tg==}
peerDependencies:
'@babel/core': '*'
dependencies:
'@babel/core': 7.19.3
'@babel/plugin-proposal-async-generator-functions': 7.19.1_@babel+core@7.19.3
@ -15704,16 +15699,14 @@ packages:
transitivePeerDependencies:
- supports-color
/metro-react-native-babel-transformer/0.70.3_@babel+core@7.19.3:
/metro-react-native-babel-transformer/0.70.3:
resolution: {integrity: sha512-WKBU6S/G50j9cfmFM4k4oRYprd8u3qjleD4so1E2zbTNILg+gYla7ZFGCAvi2G0ZcqS2XuGCR375c2hF6VVvwg==}
peerDependencies:
'@babel/core': '*'
dependencies:
'@babel/core': 7.19.3
babel-preset-fbjs: 3.4.0_@babel+core@7.19.3
hermes-parser: 0.6.0
metro-babel-transformer: 0.70.3
metro-react-native-babel-preset: 0.70.3_@babel+core@7.19.3
metro-react-native-babel-preset: 0.70.3
metro-source-map: 0.70.3
nullthrows: 1.1.1
transitivePeerDependencies:
@ -15826,7 +15819,7 @@ packages:
metro-hermes-compiler: 0.70.3
metro-inspector-proxy: 0.70.3
metro-minify-uglify: 0.70.3
metro-react-native-babel-preset: 0.70.3_@babel+core@7.19.3
metro-react-native-babel-preset: 0.70.3
metro-resolver: 0.70.3
metro-runtime: 0.70.3
metro-source-map: 0.70.3
@ -17088,7 +17081,7 @@ packages:
dependencies:
caniuse-lite: 1.0.30001421
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-svg: 13.0.0_jk6ntyzimkrv4hwdmdgaaf5yaa
dev: false
@ -18083,7 +18076,7 @@ packages:
lodash: 4.17.21
prop-types: 15.8.1
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
dev: false
/react-native-gradle-plugin/0.0.7:
@ -18113,7 +18106,7 @@ packages:
invariant: 2.2.4
lodash.isequal: 4.5.0
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
setimmediate: 1.0.5
string-hash-64: 1.0.3
transitivePeerDependencies:
@ -18127,7 +18120,7 @@ packages:
react-native: '*'
dependencies:
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
dev: false
/react-native-safe-modules/1.0.3_react-native@0.69.4:
@ -18136,7 +18129,7 @@ packages:
react-native: '*'
dependencies:
dedent: 0.6.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
dev: false
/react-native-screens/3.15.0_jk6ntyzimkrv4hwdmdgaaf5yaa:
@ -18147,7 +18140,7 @@ packages:
dependencies:
react: 18.0.0
react-freeze: 1.0.3_react@18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
warn-once: 0.1.1
dev: false
@ -18160,7 +18153,7 @@ packages:
'@svgr/core': 6.5.0
'@svgr/plugin-svgo': 6.5.0_@svgr+core@6.5.0
path-dirname: 1.0.2
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
react-native-svg: 13.0.0_jk6ntyzimkrv4hwdmdgaaf5yaa
transitivePeerDependencies:
- supports-color
@ -18175,9 +18168,9 @@ packages:
css-select: 5.1.0
css-tree: 1.1.3
react: 18.0.0
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
/react-native/0.69.4_qwcebhcz7kt2t6qvska3nnpfdm:
/react-native/0.69.4_react@18.0.0:
resolution: {integrity: sha512-rqNMialM/T4pHRKWqTIpOxA65B/9kUjtnepxwJqvsdCeMP9Q2YdSx4VASFR9RoEFYcPRU41yGf6EKrChNfns3g==}
engines: {node: '>=14'}
hasBin: true
@ -18185,7 +18178,7 @@ packages:
react: 18.0.0
dependencies:
'@jest/create-cache-key-function': 27.5.1
'@react-native-community/cli': 8.0.6_2wrsnxuq7u2kmzd6diim7k7fvu
'@react-native-community/cli': 8.0.6_react-native@0.69.4
'@react-native-community/cli-platform-android': 8.0.5
'@react-native-community/cli-platform-ios': 8.0.6
'@react-native/assets': 1.0.0
@ -18199,7 +18192,7 @@ packages:
invariant: 2.2.4
jsc-android: 250230.2.1
memoize-one: 5.2.1
metro-react-native-babel-transformer: 0.70.3_@babel+core@7.19.3
metro-react-native-babel-transformer: 0.70.3
metro-runtime: 0.70.3
metro-source-map: 0.70.3
mkdirp: 0.5.6
@ -18219,7 +18212,6 @@ packages:
whatwg-fetch: 3.6.2
ws: 6.2.2
transitivePeerDependencies:
- '@babel/core'
- '@babel/preset-env'
- bufferutil
- encoding
@ -20256,39 +20248,6 @@ packages:
transitivePeerDependencies:
- ts-node
/tailwindcss/3.1.8_postcss@8.4.18:
resolution: {integrity: sha512-YSneUCZSFDYMwk+TGq8qYFdCA3yfBRdBlS7txSq0LUmzyeqRe3a8fBQzbz9M3WS/iFT4BNf/nmw9mEzrnSaC0g==}
engines: {node: '>=12.13.0'}
hasBin: true
peerDependencies:
postcss: ^8.0.9
dependencies:
arg: 5.0.2
chokidar: 3.5.3
color-name: 1.1.4
detective: 5.2.1
didyoumean: 1.2.2
dlv: 1.1.3
fast-glob: 3.2.12
glob-parent: 6.0.2
is-glob: 4.0.3
lilconfig: 2.0.6
normalize-path: 3.0.0
object-hash: 3.0.0
picocolors: 1.0.0
postcss: 8.4.18
postcss-import: 14.1.0_postcss@8.4.18
postcss-js: 4.0.0_postcss@8.4.18
postcss-load-config: 3.1.4_postcss@8.4.18
postcss-nested: 5.0.6_postcss@8.4.18
postcss-selector-parser: 6.0.10
postcss-value-parser: 4.2.0
quick-lru: 5.1.1
resolve: 1.22.1
transitivePeerDependencies:
- ts-node
dev: true
/tapable/1.1.3:
resolution: {integrity: sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==}
engines: {node: '>=6'}
@ -21133,10 +21092,9 @@ packages:
peerDependencies:
react-native: '>=0.63.0'
dependencies:
react-native: 0.69.4_qwcebhcz7kt2t6qvska3nnpfdm
react-native: 0.69.4_react@18.0.0
tailwindcss: 3.1.8
transitivePeerDependencies:
- postcss
- ts-node
dev: false