@nocobase/server 0.7.1-alpha.6 → 0.7.2-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -387,6 +387,16 @@ class Application extends _koa().default {
387
387
 
388
388
  return _asyncToGenerator(function* () {
389
389
  yield _this9.emitAsync('beforeInstall', _this9, options);
390
+ const r = yield _this9.db.version.satisfies({
391
+ mysql: '8.x',
392
+ sqlite: '3.x',
393
+ postgres: '>=10'
394
+ });
395
+
396
+ if (!r) {
397
+ console.log('The database only supports MySQL 8.x, SQLite 3.x and PostgreSQL 10+');
398
+ return;
399
+ }
390
400
 
391
401
  if (options === null || options === void 0 ? void 0 : options.clean) {
392
402
  yield _this9.db.clean((0, _lodash().isBoolean)(options.clean) ? {
@@ -14,6 +14,7 @@ var _default = app => {
14
14
  const opts = cliArgs[0];
15
15
  console.log('db sync...');
16
16
  const force = false;
17
+ yield app.start();
17
18
  yield app.db.sync({
18
19
  force,
19
20
  alter: {
@@ -36,7 +36,7 @@ var _default = app => {
36
36
  }
37
37
 
38
38
  if (!(opts === null || opts === void 0 ? void 0 : opts.clean) && !(opts === null || opts === void 0 ? void 0 : opts.force)) {
39
- if (yield app.db.collectionExistsInDb('applicationVersion')) {
39
+ if ((yield app.db.collectionExistsInDb('applicationVersion')) || (yield app.db.collectionExistsInDb('collections'))) {
40
40
  installed = true;
41
41
 
42
42
  if (!opts.silent) {
@@ -28,6 +28,7 @@ var _default = app => {
28
28
  app.command('upgrade').action( /*#__PURE__*/_asyncToGenerator(function* (...cliArgs) {
29
29
  const opts = cliArgs[0];
30
30
  console.log('upgrading...');
31
+ yield app.start();
31
32
  yield app.upgrade();
32
33
  yield app.stop({
33
34
  cliArgs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "0.7.1-alpha.6",
3
+ "version": "0.7.2-alpha.2",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -13,10 +13,10 @@
13
13
  "dependencies": {
14
14
  "@koa/cors": "^3.1.0",
15
15
  "@koa/router": "^9.4.0",
16
- "@nocobase/acl": "0.7.1-alpha.6",
17
- "@nocobase/actions": "0.7.1-alpha.6",
18
- "@nocobase/database": "0.7.1-alpha.6",
19
- "@nocobase/resourcer": "0.7.1-alpha.6",
16
+ "@nocobase/acl": "0.7.2-alpha.2",
17
+ "@nocobase/actions": "0.7.2-alpha.2",
18
+ "@nocobase/database": "0.7.2-alpha.2",
19
+ "@nocobase/resourcer": "0.7.2-alpha.2",
20
20
  "chalk": "^4.1.1",
21
21
  "commander": "^9.2.0",
22
22
  "find-package-json": "^1.2.0",
@@ -30,5 +30,5 @@
30
30
  "devDependencies": {
31
31
  "@types/semver": "^7.3.9"
32
32
  },
33
- "gitHead": "b6f96c97020d278ae597bf05553442d7516b2216"
33
+ "gitHead": "a0cc50154cc292248ef107c95a24bcc0c7a586fa"
34
34
  }