@strapi/database 4.5.4 → 4.5.5

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.
@@ -328,7 +328,7 @@ const cleanOrderColumnsForInnoDB = async ({
328
328
  await db.connection
329
329
  .raw(
330
330
  `
331
- CREATE TEMPORARY TABLE ??
331
+ CREATE TABLE ??
332
332
  SELECT
333
333
  id,
334
334
  (
@@ -361,9 +361,7 @@ const cleanOrderColumnsForInnoDB = async ({
361
361
  )
362
362
  .transacting(trx);
363
363
  } finally {
364
- await db.connection
365
- .raw(`DROP TEMPORARY TABLE IF EXISTS ??`, [tempInvOrderTableName])
366
- .transacting(trx);
364
+ await db.connection.raw(`DROP TABLE IF EXISTS ??`, [tempInvOrderTableName]).transacting(trx);
367
365
  }
368
366
  }
369
367
  };
package/lib/index.js CHANGED
@@ -20,6 +20,8 @@ class Database {
20
20
  connection: {},
21
21
  settings: {
22
22
  forceMigration: true,
23
+ runMigrations: true,
24
+ ...config.settings,
23
25
  },
24
26
  ...config,
25
27
  };
@@ -61,7 +61,7 @@ const createMigrationsProvider = (db) => {
61
61
  async shouldRun() {
62
62
  const pending = await migrations.pending();
63
63
 
64
- return pending.length > 0;
64
+ return pending.length > 0 && db.settings.runMigrations;
65
65
  },
66
66
  async up() {
67
67
  await migrations.up();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/database",
3
- "version": "4.5.4",
3
+ "version": "4.5.5",
4
4
  "description": "Strapi's database layer",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -31,7 +31,7 @@
31
31
  "test:unit": "jest --verbose"
32
32
  },
33
33
  "dependencies": {
34
- "date-fns": "2.29.2",
34
+ "date-fns": "2.29.3",
35
35
  "debug": "4.3.4",
36
36
  "fs-extra": "10.0.0",
37
37
  "knex": "1.0.7",
@@ -43,5 +43,5 @@
43
43
  "node": ">=14.19.1 <=18.x.x",
44
44
  "npm": ">=6.0.0"
45
45
  },
46
- "gitHead": "8716ecc920130db5341b0904cf868c6e6b581a5d"
46
+ "gitHead": "8f1988367c1ccbbb1c44866d9dc9fa512e4f3b31"
47
47
  }