fix: error: SQLITE_ERROR: no such table: authenticators

This commit is contained in:
chenos 2023-09-11 15:50:27 +08:00
parent b9abbd5cbd
commit adf11bf624
3 changed files with 29 additions and 76 deletions

View File

@ -3,6 +3,12 @@ import { presetAuthType, presetAuthenticator } from '../../preset';
export default class AddBasicAuthMigration extends Migration {
async up() {
await this.db.getCollection('authenticators').sync({
force: false,
alter: {
drop: false,
},
});
const repo = this.context.db.getRepository('authenticators');
const existed = await repo.count();
if (existed) {

View File

@ -3,6 +3,12 @@ import { Migration } from '@nocobase/server';
export default class extends Migration {
async up() {
await this.db.getCollection('systemSettings').sync({
force: false,
alter: {
drop: false,
},
});
const systemSettings = this.db.getRepository('systemSettings');
let instance: Model = await systemSettings.findOne();
if (instance?.options?.adminSchemaUid) {
@ -13,7 +19,6 @@ export default class extends Migration {
if (!uiRoutes) {
return;
}
await this.db.getCollection('systemSettings').sync();
for (const route of routes) {
if (route.uiSchemaUid && route?.options?.component === 'AdminLayout') {
const options = instance.options || {};

View File

@ -4751,6 +4751,11 @@
version "1.7.1"
resolved "https://registry.npmjs.org/@remix-run/router/-/router-1.7.1.tgz#fea7ac35ae4014637c130011f59428f618730498"
"@remix-run/router@1.8.0":
version "1.8.0"
resolved "https://registry.npmjs.org/@remix-run/router/-/router-1.8.0.tgz#e848d2f669f601544df15ce2a313955e4bf0bafc"
integrity sha512-mrfKqIHnSZRyIzBcanNJmVQELTnX+qagEDlcKO90RgRBVOZGSGvZKeDihTRfWcqoDn5N/NkUcwWTccnpN18Tfg==
"@restart/hooks@^0.4.7":
version "0.4.9"
resolved "https://registry.npmmirror.com/@restart/hooks/-/hooks-0.4.9.tgz#ad858fb39d99e252cccce19416adc18fc3f18fcb"
@ -6033,19 +6038,12 @@
"@types/prop-types" "*"
"@types/react" "*"
"@types/react-dom@17.x", "@types/react-dom@^17.0.0":
"@types/react-dom@17.x", "@types/react-dom@^17.0.0", "@types/react-dom@^18.0.0":
version "17.0.20"
resolved "https://registry.npmmirror.com/@types/react-dom/-/react-dom-17.0.20.tgz#e0c8901469d732b36d8473b40b679ad899da1b53"
dependencies:
"@types/react" "^17"
"@types/react-dom@^18.0.0":
version "18.2.7"
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.7.tgz#67222a08c0a6ae0a0da33c3532348277c70abb63"
integrity sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==
dependencies:
"@types/react" "*"
"@types/react-redux@^7.1.20":
version "7.1.25"
resolved "https://registry.npmmirror.com/@types/react-redux/-/react-redux-7.1.25.tgz#de841631205b24f9dfb4967dd4a7901e048f9a88"
@ -6055,7 +6053,7 @@
hoist-non-react-statics "^3.3.0"
redux "^4.0.0"
"@types/react@*", "@types/react@16 || 17 || 18", "@types/react@17.x", "@types/react@>=16.9.11", "@types/react@^17", "@types/react@^17.0.0":
"@types/react@*", "@types/react@16 || 17 || 18", "@types/react@17.x", "@types/react@>=16.9.11", "@types/react@^17", "@types/react@^17.0.0", "@types/react@^18.0.0":
version "17.0.62"
resolved "https://registry.npmmirror.com/@types/react/-/react-17.0.62.tgz#2efe8ddf8533500ec44b1334dd1a97caa2f860e3"
dependencies:
@ -6063,15 +6061,6 @@
"@types/scheduler" "*"
csstype "^3.0.2"
"@types/react@^18.0.0":
version "18.2.21"
resolved "https://registry.npmjs.org/@types/react/-/react-18.2.21.tgz#774c37fd01b522d0b91aed04811b58e4e0514ed9"
integrity sha512-neFKG/sBAwGxHgXiIxnbm3/AAVQ/cMRS93hvBpg8xYRbeQSPVABp9U2bRnPf0iI4+Ucdv3plSxKK+3CW2ENJxA==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"
"@types/readdir-glob@*":
version "1.1.1"
resolved "https://registry.npmmirror.com/@types/readdir-glob/-/readdir-glob-1.1.1.tgz#27ac2db283e6aa3d110b14ff9da44fcd1a5c38b1"
@ -6275,17 +6264,7 @@
semver "^7.5.4"
ts-api-utils "^1.0.1"
"@typescript-eslint/parser@5.48.1":
version "5.48.1"
resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.1.tgz#d0125792dab7e232035434ab8ef0658154db2f10"
integrity sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==
dependencies:
"@typescript-eslint/scope-manager" "5.48.1"
"@typescript-eslint/types" "5.48.1"
"@typescript-eslint/typescript-estree" "5.48.1"
debug "^4.3.4"
"@typescript-eslint/parser@^6.2.0":
"@typescript-eslint/parser@5.48.1", "@typescript-eslint/parser@^6.2.0":
version "6.2.0"
resolved "https://registry.npmmirror.com/@typescript-eslint/parser/-/parser-6.2.0.tgz#d37c30b0f459c6f39455335d8f4f085919a1c644"
dependencies:
@ -13032,7 +13011,7 @@ highlight.js@^10.1.0, highlight.js@^10.2.0:
version "10.7.3"
resolved "https://registry.npmmirror.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531"
history@5.3.0, history@^5.2.0:
history@5.3.0:
version "5.3.0"
resolved "https://registry.npmmirror.com/history/-/history-5.3.0.tgz#1548abaa245ba47992f063a0783db91ef201c73b"
dependencies:
@ -19755,15 +19734,7 @@ react-copy-to-clipboard@^5.1.0:
copy-to-clipboard "^3.3.1"
prop-types "^15.8.1"
react-dom@18.1.0:
version "18.1.0"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.1.0.tgz#7f6dd84b706408adde05e1df575b3a024d7e8a2f"
integrity sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w==
dependencies:
loose-envify "^1.1.0"
scheduler "^0.22.0"
react-dom@18.x, react-dom@^18.0.0, react-dom@^18.2.0:
react-dom@18.1.0, react-dom@18.x, react-dom@^18.0.0, react-dom@^18.2.0:
version "18.2.0"
resolved "https://registry.npmmirror.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
dependencies:
@ -19926,34 +19897,19 @@ react-refresh@0.14.0, react-refresh@^0.14.0:
version "0.14.0"
resolved "https://registry.npmmirror.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e"
react-router-dom@6.3.0:
version "6.3.0"
resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.3.0.tgz#a0216da813454e521905b5fa55e0e5176123f43d"
integrity sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw==
dependencies:
history "^5.2.0"
react-router "6.3.0"
react-router-dom@6.x, react-router-dom@^6.11.2:
react-router-dom@6.3.0, react-router-dom@6.x, react-router-dom@^6.11.2:
version "6.14.1"
resolved "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-6.14.1.tgz#0ad7ba7abdf75baa61169d49f096f0494907a36f"
dependencies:
"@remix-run/router" "1.7.1"
react-router "6.14.1"
react-router@6.14.1:
version "6.14.1"
resolved "https://registry.npmjs.org/react-router/-/react-router-6.14.1.tgz#5e82bcdabf21add859dc04b1859f91066b3a5810"
integrity sha512-U4PfgvG55LdvbQjg5Y9QRWyVxIdO1LlpYT7x+tMAxd9/vmiPuJhIwdxZuIQLN/9e3O4KFDHYfR9gzGeYMasW8g==
react-router@6.14.1, react-router@6.3.0, react-router@^6.11.2:
version "6.15.0"
resolved "https://registry.npmjs.org/react-router/-/react-router-6.15.0.tgz#bf2cb5a4a7ed57f074d4ea88db0d95033f39cac8"
integrity sha512-NIytlzvzLwJkCQj2HLefmeakxxWHWAP+02EGqWEZy+DgfHHKQMUoBBjUQLOtFInBMhWtb3hiUy6MfFgwLjXhqg==
dependencies:
"@remix-run/router" "1.7.1"
react-router@6.3.0:
version "6.3.0"
resolved "https://registry.npmjs.org/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557"
integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==
dependencies:
history "^5.2.0"
"@remix-run/router" "1.8.0"
react-side-effect@^2.1.0:
version "2.1.2"
@ -19969,14 +19925,7 @@ react-to-print@^2.14.7:
version "2.14.13"
resolved "https://registry.npmmirror.com/react-to-print/-/react-to-print-2.14.13.tgz#cd0349f7ef93c8af5120fac0ef6c4f3d100df490"
react@18.1.0:
version "18.1.0"
resolved "https://registry.npmjs.org/react/-/react-18.1.0.tgz#6f8620382decb17fdc5cc223a115e2adbf104890"
integrity sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ==
dependencies:
loose-envify "^1.1.0"
react@18.x, react@^18.0.0, react@^18.2.0:
react@18.1.0, react@18.x, react@^18.0.0, react@^18.2.0:
version "18.2.0"
resolved "https://registry.npmmirror.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
dependencies:
@ -20814,13 +20763,6 @@ saxes@^5.0.1:
dependencies:
xmlchars "^2.2.0"
scheduler@^0.22.0:
version "0.22.0"
resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.22.0.tgz#83a5d63594edf074add9a7198b1bae76c3db01b8"
integrity sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ==
dependencies:
loose-envify "^1.1.0"
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.npmmirror.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"