@strapi/database 5.33.3 → 5.34.0

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.
@@ -0,0 +1,3 @@
1
+ import type { Migration } from '../common';
2
+ export declare const addDocumentIdIndexes: Migration;
3
+ //# sourceMappingURL=5.0.0-06-add-document-id-indexes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"5.0.0-06-add-document-id-indexes.d.ts","sourceRoot":"","sources":["../../../src/migrations/internal-migrations/5.0.0-06-add-document-id-indexes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAgE3C,eAAO,MAAM,oBAAoB,EAAE,SAelC,CAAC"}
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ // Add an index if it does not already exist
4
+ const createIndex = async (knex, tableName, columns, indexName)=>{
5
+ try {
6
+ // If the database can check for indexes, avoid duplicates
7
+ const hasIndex = knex.schema.hasIndex;
8
+ if (hasIndex) {
9
+ const exists = await hasIndex.call(knex.schema, tableName, indexName);
10
+ if (exists) {
11
+ return;
12
+ }
13
+ }
14
+ await knex.schema.alterTable(tableName, (table)=>{
15
+ table.index(columns, indexName);
16
+ });
17
+ } catch (error) {
18
+ // If the index exists (or cannot be created), move on
19
+ }
20
+ };
21
+ const addIndexesForTable = async (knex, tableName)=>{
22
+ // Only add indexes when the column is present
23
+ const hasDocumentId = await knex.schema.hasColumn(tableName, 'document_id');
24
+ if (!hasDocumentId) {
25
+ return;
26
+ }
27
+ const hasLocale = await knex.schema.hasColumn(tableName, 'locale');
28
+ const hasPublishedAt = await knex.schema.hasColumn(tableName, 'published_at');
29
+ // Single column index for basic lookups
30
+ await createIndex(knex, tableName, [
31
+ 'document_id'
32
+ ], `${tableName}_document_id_idx`);
33
+ if (hasLocale && hasPublishedAt) {
34
+ // Composite index for common filters
35
+ await createIndex(knex, tableName, [
36
+ 'document_id',
37
+ 'locale',
38
+ 'published_at'
39
+ ], `${tableName}_document_id_locale_published_at_idx`);
40
+ } else if (hasLocale) {
41
+ await createIndex(knex, tableName, [
42
+ 'document_id',
43
+ 'locale'
44
+ ], `${tableName}_document_id_locale_idx`);
45
+ } else if (hasPublishedAt) {
46
+ await createIndex(knex, tableName, [
47
+ 'document_id',
48
+ 'published_at'
49
+ ], `${tableName}_document_id_published_at_idx`);
50
+ }
51
+ };
52
+ const addDocumentIdIndexes = {
53
+ name: '5.0.0-06-add-document-id-indexes',
54
+ async up (knex, db) {
55
+ for (const meta of db.metadata.values()){
56
+ const hasTable = await knex.schema.hasTable(meta.tableName);
57
+ if (!hasTable) {
58
+ continue;
59
+ }
60
+ await addIndexesForTable(knex, meta.tableName);
61
+ }
62
+ },
63
+ async down () {
64
+ throw new Error('not implemented');
65
+ }
66
+ };
67
+
68
+ exports.addDocumentIdIndexes = addDocumentIdIndexes;
69
+ //# sourceMappingURL=5.0.0-06-add-document-id-indexes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"5.0.0-06-add-document-id-indexes.js","sources":["../../../src/migrations/internal-migrations/5.0.0-06-add-document-id-indexes.ts"],"sourcesContent":["import type { Knex } from 'knex';\n\nimport type { Migration } from '../common';\n\n// Add an index if it does not already exist\nconst createIndex = async (knex: Knex, tableName: string, columns: string[], indexName: string) => {\n try {\n // If the database can check for indexes, avoid duplicates\n const hasIndex = (\n knex.schema as unknown as {\n hasIndex?: (tableName: string, indexName: string) => Promise<boolean>;\n }\n ).hasIndex;\n if (hasIndex) {\n const exists = await hasIndex.call(knex.schema, tableName, indexName);\n if (exists) {\n return;\n }\n }\n\n await knex.schema.alterTable(tableName, (table) => {\n table.index(columns, indexName);\n });\n } catch (error) {\n // If the index exists (or cannot be created), move on\n }\n};\n\nconst addIndexesForTable = async (knex: Knex, tableName: string) => {\n // Only add indexes when the column is present\n const hasDocumentId = await knex.schema.hasColumn(tableName, 'document_id');\n if (!hasDocumentId) {\n return;\n }\n\n const hasLocale = await knex.schema.hasColumn(tableName, 'locale');\n const hasPublishedAt = await knex.schema.hasColumn(tableName, 'published_at');\n\n // Single column index for basic lookups\n await createIndex(knex, tableName, ['document_id'], `${tableName}_document_id_idx`);\n\n if (hasLocale && hasPublishedAt) {\n // Composite index for common filters\n await createIndex(\n knex,\n tableName,\n ['document_id', 'locale', 'published_at'],\n `${tableName}_document_id_locale_published_at_idx`\n );\n } else if (hasLocale) {\n await createIndex(\n knex,\n tableName,\n ['document_id', 'locale'],\n `${tableName}_document_id_locale_idx`\n );\n } else if (hasPublishedAt) {\n await createIndex(\n knex,\n tableName,\n ['document_id', 'published_at'],\n `${tableName}_document_id_published_at_idx`\n );\n }\n};\n\nexport const addDocumentIdIndexes: Migration = {\n name: '5.0.0-06-add-document-id-indexes',\n async up(knex, db) {\n for (const meta of db.metadata.values()) {\n const hasTable = await knex.schema.hasTable(meta.tableName);\n if (!hasTable) {\n continue;\n }\n\n await addIndexesForTable(knex, meta.tableName);\n }\n },\n async down() {\n throw new Error('not implemented');\n },\n};\n"],"names":["createIndex","knex","tableName","columns","indexName","hasIndex","schema","exists","call","alterTable","table","index","error","addIndexesForTable","hasDocumentId","hasColumn","hasLocale","hasPublishedAt","addDocumentIdIndexes","name","up","db","meta","metadata","values","hasTable","down","Error"],"mappings":";;AAIA;AACA,MAAMA,WAAc,GAAA,OAAOC,IAAYC,EAAAA,SAAAA,EAAmBC,OAAmBC,EAAAA,SAAAA,GAAAA;IAC3E,IAAI;;AAEF,QAAA,MAAMC,QAAW,GACfJ,IAAKK,CAAAA,MAAM,CAGXD,QAAQ;AACV,QAAA,IAAIA,QAAU,EAAA;YACZ,MAAME,MAAAA,GAAS,MAAMF,QAASG,CAAAA,IAAI,CAACP,IAAKK,CAAAA,MAAM,EAAEJ,SAAWE,EAAAA,SAAAA,CAAAA;AAC3D,YAAA,IAAIG,MAAQ,EAAA;AACV,gBAAA;AACF;AACF;AAEA,QAAA,MAAMN,KAAKK,MAAM,CAACG,UAAU,CAACP,WAAW,CAACQ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,CAAA;MAEagB,oBAAkC,GAAA;IAC7CC,IAAM,EAAA,kCAAA;IACN,MAAMC,EAAAA,CAAAA,CAAGnB,IAAI,EAAEoB,EAAE,EAAA;AACf,QAAA,KAAK,MAAMC,IAAQD,IAAAA,EAAAA,CAAGE,QAAQ,CAACC,MAAM,EAAI,CAAA;YACvC,MAAMC,QAAAA,GAAW,MAAMxB,IAAKK,CAAAA,MAAM,CAACmB,QAAQ,CAACH,KAAKpB,SAAS,CAAA;AAC1D,YAAA,IAAI,CAACuB,QAAU,EAAA;AACb,gBAAA;AACF;YAEA,MAAMZ,kBAAAA,CAAmBZ,IAAMqB,EAAAA,IAAAA,CAAKpB,SAAS,CAAA;AAC/C;AACF,KAAA;IACA,MAAMwB,IAAAA,CAAAA,GAAAA;AACJ,QAAA,MAAM,IAAIC,KAAM,CAAA,iBAAA,CAAA;AAClB;AACF;;;;"}
@@ -0,0 +1,67 @@
1
+ // Add an index if it does not already exist
2
+ const createIndex = async (knex, tableName, columns, indexName)=>{
3
+ try {
4
+ // If the database can check for indexes, avoid duplicates
5
+ const hasIndex = knex.schema.hasIndex;
6
+ if (hasIndex) {
7
+ const exists = await hasIndex.call(knex.schema, tableName, indexName);
8
+ if (exists) {
9
+ return;
10
+ }
11
+ }
12
+ await knex.schema.alterTable(tableName, (table)=>{
13
+ table.index(columns, indexName);
14
+ });
15
+ } catch (error) {
16
+ // If the index exists (or cannot be created), move on
17
+ }
18
+ };
19
+ const addIndexesForTable = async (knex, tableName)=>{
20
+ // Only add indexes when the column is present
21
+ const hasDocumentId = await knex.schema.hasColumn(tableName, 'document_id');
22
+ if (!hasDocumentId) {
23
+ return;
24
+ }
25
+ const hasLocale = await knex.schema.hasColumn(tableName, 'locale');
26
+ const hasPublishedAt = await knex.schema.hasColumn(tableName, 'published_at');
27
+ // Single column index for basic lookups
28
+ await createIndex(knex, tableName, [
29
+ 'document_id'
30
+ ], `${tableName}_document_id_idx`);
31
+ if (hasLocale && hasPublishedAt) {
32
+ // Composite index for common filters
33
+ await createIndex(knex, tableName, [
34
+ 'document_id',
35
+ 'locale',
36
+ 'published_at'
37
+ ], `${tableName}_document_id_locale_published_at_idx`);
38
+ } else if (hasLocale) {
39
+ await createIndex(knex, tableName, [
40
+ 'document_id',
41
+ 'locale'
42
+ ], `${tableName}_document_id_locale_idx`);
43
+ } else if (hasPublishedAt) {
44
+ await createIndex(knex, tableName, [
45
+ 'document_id',
46
+ 'published_at'
47
+ ], `${tableName}_document_id_published_at_idx`);
48
+ }
49
+ };
50
+ const addDocumentIdIndexes = {
51
+ name: '5.0.0-06-add-document-id-indexes',
52
+ async up (knex, db) {
53
+ for (const meta of db.metadata.values()){
54
+ const hasTable = await knex.schema.hasTable(meta.tableName);
55
+ if (!hasTable) {
56
+ continue;
57
+ }
58
+ await addIndexesForTable(knex, meta.tableName);
59
+ }
60
+ },
61
+ async down () {
62
+ throw new Error('not implemented');
63
+ }
64
+ };
65
+
66
+ export { addDocumentIdIndexes };
67
+ //# sourceMappingURL=5.0.0-06-add-document-id-indexes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"5.0.0-06-add-document-id-indexes.mjs","sources":["../../../src/migrations/internal-migrations/5.0.0-06-add-document-id-indexes.ts"],"sourcesContent":["import type { Knex } from 'knex';\n\nimport type { Migration } from '../common';\n\n// Add an index if it does not already exist\nconst createIndex = async (knex: Knex, tableName: string, columns: string[], indexName: string) => {\n try {\n // If the database can check for indexes, avoid duplicates\n const hasIndex = (\n knex.schema as unknown as {\n hasIndex?: (tableName: string, indexName: string) => Promise<boolean>;\n }\n ).hasIndex;\n if (hasIndex) {\n const exists = await hasIndex.call(knex.schema, tableName, indexName);\n if (exists) {\n return;\n }\n }\n\n await knex.schema.alterTable(tableName, (table) => {\n table.index(columns, indexName);\n });\n } catch (error) {\n // If the index exists (or cannot be created), move on\n }\n};\n\nconst addIndexesForTable = async (knex: Knex, tableName: string) => {\n // Only add indexes when the column is present\n const hasDocumentId = await knex.schema.hasColumn(tableName, 'document_id');\n if (!hasDocumentId) {\n return;\n }\n\n const hasLocale = await knex.schema.hasColumn(tableName, 'locale');\n const hasPublishedAt = await knex.schema.hasColumn(tableName, 'published_at');\n\n // Single column index for basic lookups\n await createIndex(knex, tableName, ['document_id'], `${tableName}_document_id_idx`);\n\n if (hasLocale && hasPublishedAt) {\n // Composite index for common filters\n await createIndex(\n knex,\n tableName,\n ['document_id', 'locale', 'published_at'],\n `${tableName}_document_id_locale_published_at_idx`\n );\n } else if (hasLocale) {\n await createIndex(\n knex,\n tableName,\n ['document_id', 'locale'],\n `${tableName}_document_id_locale_idx`\n );\n } else if (hasPublishedAt) {\n await createIndex(\n knex,\n tableName,\n ['document_id', 'published_at'],\n `${tableName}_document_id_published_at_idx`\n );\n }\n};\n\nexport const addDocumentIdIndexes: Migration = {\n name: '5.0.0-06-add-document-id-indexes',\n async up(knex, db) {\n for (const meta of db.metadata.values()) {\n const hasTable = await knex.schema.hasTable(meta.tableName);\n if (!hasTable) {\n continue;\n }\n\n await addIndexesForTable(knex, meta.tableName);\n }\n },\n async down() {\n throw new Error('not implemented');\n },\n};\n"],"names":["createIndex","knex","tableName","columns","indexName","hasIndex","schema","exists","call","alterTable","table","index","error","addIndexesForTable","hasDocumentId","hasColumn","hasLocale","hasPublishedAt","addDocumentIdIndexes","name","up","db","meta","metadata","values","hasTable","down","Error"],"mappings":"AAIA;AACA,MAAMA,WAAc,GAAA,OAAOC,IAAYC,EAAAA,SAAAA,EAAmBC,OAAmBC,EAAAA,SAAAA,GAAAA;IAC3E,IAAI;;AAEF,QAAA,MAAMC,QAAW,GACfJ,IAAKK,CAAAA,MAAM,CAGXD,QAAQ;AACV,QAAA,IAAIA,QAAU,EAAA;YACZ,MAAME,MAAAA,GAAS,MAAMF,QAASG,CAAAA,IAAI,CAACP,IAAKK,CAAAA,MAAM,EAAEJ,SAAWE,EAAAA,SAAAA,CAAAA;AAC3D,YAAA,IAAIG,MAAQ,EAAA;AACV,gBAAA;AACF;AACF;AAEA,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AAA,EAAGA,SAAU,CAAA,6BAA6B,CAAC,CAAA;AAE/C;AACF,CAAA;MAEagB,oBAAkC,GAAA;IAC7CC,IAAM,EAAA,kCAAA;IACN,MAAMC,EAAAA,CAAAA,CAAGnB,IAAI,EAAEoB,EAAE,EAAA;AACf,QAAA,KAAK,MAAMC,IAAQD,IAAAA,EAAAA,CAAGE,QAAQ,CAACC,MAAM,EAAI,CAAA;YACvC,MAAMC,QAAAA,GAAW,MAAMxB,IAAKK,CAAAA,MAAM,CAACmB,QAAQ,CAACH,KAAKpB,SAAS,CAAA;AAC1D,YAAA,IAAI,CAACuB,QAAU,EAAA;AACb,gBAAA;AACF;YAEA,MAAMZ,kBAAAA,CAAmBZ,IAAMqB,EAAAA,IAAAA,CAAKpB,SAAS,CAAA;AAC/C;AACF,KAAA;IACA,MAAMwB,IAAAA,CAAAA,GAAAA;AACJ,QAAA,MAAM,IAAIC,KAAM,CAAA,iBAAA,CAAA;AAClB;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/internal-migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAO3C;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,EAMzC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/internal-migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAQ3C;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,EAOzC,CAAC"}
@@ -5,6 +5,7 @@ var _5_0_001ConvertIdentifiersLongThanMaxLength = require('./5.0.0-01-convert-id
5
5
  var _5_0_003Locale = require('./5.0.0-03-locale.js');
6
6
  var _5_0_004PublishedAt = require('./5.0.0-04-published-at.js');
7
7
  var _5_0_005DropSlugUniqueIndex = require('./5.0.0-05-drop-slug-unique-index.js');
8
+ var _5_0_006AddDocumentIdIndexes = require('./5.0.0-06-add-document-id-indexes.js');
8
9
 
9
10
  /**
10
11
  * List of all the internal migrations. The array order will be the order in which they are executed.
@@ -19,7 +20,8 @@ var _5_0_005DropSlugUniqueIndex = require('./5.0.0-05-drop-slug-unique-index.js'
19
20
  _5_0_002DocumentId.createdDocumentId,
20
21
  _5_0_003Locale.createdLocale,
21
22
  _5_0_004PublishedAt.createdPublishedAt,
22
- _5_0_005DropSlugUniqueIndex.dropSlugFieldsIndex
23
+ _5_0_005DropSlugUniqueIndex.dropSlugFieldsIndex,
24
+ _5_0_006AddDocumentIdIndexes.addDocumentIdIndexes
23
25
  ];
24
26
 
25
27
  exports.internalMigrations = internalMigrations;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/migrations/internal-migrations/index.ts"],"sourcesContent":["import type { Migration } from '../common';\nimport { createdDocumentId } from './5.0.0-02-document-id';\nimport { renameIdentifiersLongerThanMaxLength } from './5.0.0-01-convert-identifiers-long-than-max-length';\nimport { createdLocale } from './5.0.0-03-locale';\nimport { createdPublishedAt } from './5.0.0-04-published-at';\nimport { dropSlugFieldsIndex } from './5.0.0-05-drop-slug-unique-index';\n\n/**\n * List of all the internal migrations. The array order will be the order in which they are executed.\n *\n * {\n * name: 'some-name',\n * async up(knex: Knex, db: Database) {},\n * async down(knex: Knex, db: Database) {},\n * },\n */\nexport const internalMigrations: Migration[] = [\n renameIdentifiersLongerThanMaxLength,\n createdDocumentId,\n createdLocale,\n createdPublishedAt,\n dropSlugFieldsIndex,\n];\n"],"names":["internalMigrations","renameIdentifiersLongerThanMaxLength","createdDocumentId","createdLocale","createdPublishedAt","dropSlugFieldsIndex"],"mappings":";;;;;;;;AAOA;;;;;;;;UASaA,kBAAkC,GAAA;AAC7CC,IAAAA,gFAAAA;AACAC,IAAAA,oCAAAA;AACAC,IAAAA,4BAAAA;AACAC,IAAAA,sCAAAA;AACAC,IAAAA;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/migrations/internal-migrations/index.ts"],"sourcesContent":["import type { Migration } from '../common';\nimport { createdDocumentId } from './5.0.0-02-document-id';\nimport { renameIdentifiersLongerThanMaxLength } from './5.0.0-01-convert-identifiers-long-than-max-length';\nimport { createdLocale } from './5.0.0-03-locale';\nimport { createdPublishedAt } from './5.0.0-04-published-at';\nimport { dropSlugFieldsIndex } from './5.0.0-05-drop-slug-unique-index';\nimport { addDocumentIdIndexes } from './5.0.0-06-add-document-id-indexes';\n\n/**\n * List of all the internal migrations. The array order will be the order in which they are executed.\n *\n * {\n * name: 'some-name',\n * async up(knex: Knex, db: Database) {},\n * async down(knex: Knex, db: Database) {},\n * },\n */\nexport const internalMigrations: Migration[] = [\n renameIdentifiersLongerThanMaxLength,\n createdDocumentId,\n createdLocale,\n createdPublishedAt,\n dropSlugFieldsIndex,\n addDocumentIdIndexes,\n];\n"],"names":["internalMigrations","renameIdentifiersLongerThanMaxLength","createdDocumentId","createdLocale","createdPublishedAt","dropSlugFieldsIndex","addDocumentIdIndexes"],"mappings":";;;;;;;;;AAQA;;;;;;;;UASaA,kBAAkC,GAAA;AAC7CC,IAAAA,gFAAAA;AACAC,IAAAA,oCAAAA;AACAC,IAAAA,4BAAAA;AACAC,IAAAA,sCAAAA;AACAC,IAAAA,+CAAAA;AACAC,IAAAA;;;;;"}
@@ -3,6 +3,7 @@ import { renameIdentifiersLongerThanMaxLength } from './5.0.0-01-convert-identif
3
3
  import { createdLocale } from './5.0.0-03-locale.mjs';
4
4
  import { createdPublishedAt } from './5.0.0-04-published-at.mjs';
5
5
  import { dropSlugFieldsIndex } from './5.0.0-05-drop-slug-unique-index.mjs';
6
+ import { addDocumentIdIndexes } from './5.0.0-06-add-document-id-indexes.mjs';
6
7
 
7
8
  /**
8
9
  * List of all the internal migrations. The array order will be the order in which they are executed.
@@ -17,7 +18,8 @@ import { dropSlugFieldsIndex } from './5.0.0-05-drop-slug-unique-index.mjs';
17
18
  createdDocumentId,
18
19
  createdLocale,
19
20
  createdPublishedAt,
20
- dropSlugFieldsIndex
21
+ dropSlugFieldsIndex,
22
+ addDocumentIdIndexes
21
23
  ];
22
24
 
23
25
  export { internalMigrations };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/migrations/internal-migrations/index.ts"],"sourcesContent":["import type { Migration } from '../common';\nimport { createdDocumentId } from './5.0.0-02-document-id';\nimport { renameIdentifiersLongerThanMaxLength } from './5.0.0-01-convert-identifiers-long-than-max-length';\nimport { createdLocale } from './5.0.0-03-locale';\nimport { createdPublishedAt } from './5.0.0-04-published-at';\nimport { dropSlugFieldsIndex } from './5.0.0-05-drop-slug-unique-index';\n\n/**\n * List of all the internal migrations. The array order will be the order in which they are executed.\n *\n * {\n * name: 'some-name',\n * async up(knex: Knex, db: Database) {},\n * async down(knex: Knex, db: Database) {},\n * },\n */\nexport const internalMigrations: Migration[] = [\n renameIdentifiersLongerThanMaxLength,\n createdDocumentId,\n createdLocale,\n createdPublishedAt,\n dropSlugFieldsIndex,\n];\n"],"names":["internalMigrations","renameIdentifiersLongerThanMaxLength","createdDocumentId","createdLocale","createdPublishedAt","dropSlugFieldsIndex"],"mappings":";;;;;;AAOA;;;;;;;;UASaA,kBAAkC,GAAA;AAC7CC,IAAAA,oCAAAA;AACAC,IAAAA,iBAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,kBAAAA;AACAC,IAAAA;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/migrations/internal-migrations/index.ts"],"sourcesContent":["import type { Migration } from '../common';\nimport { createdDocumentId } from './5.0.0-02-document-id';\nimport { renameIdentifiersLongerThanMaxLength } from './5.0.0-01-convert-identifiers-long-than-max-length';\nimport { createdLocale } from './5.0.0-03-locale';\nimport { createdPublishedAt } from './5.0.0-04-published-at';\nimport { dropSlugFieldsIndex } from './5.0.0-05-drop-slug-unique-index';\nimport { addDocumentIdIndexes } from './5.0.0-06-add-document-id-indexes';\n\n/**\n * List of all the internal migrations. The array order will be the order in which they are executed.\n *\n * {\n * name: 'some-name',\n * async up(knex: Knex, db: Database) {},\n * async down(knex: Knex, db: Database) {},\n * },\n */\nexport const internalMigrations: Migration[] = [\n renameIdentifiersLongerThanMaxLength,\n createdDocumentId,\n createdLocale,\n createdPublishedAt,\n dropSlugFieldsIndex,\n addDocumentIdIndexes,\n];\n"],"names":["internalMigrations","renameIdentifiersLongerThanMaxLength","createdDocumentId","createdLocale","createdPublishedAt","dropSlugFieldsIndex","addDocumentIdIndexes"],"mappings":";;;;;;;AAQA;;;;;;;;UASaA,kBAAkC,GAAA;AAC7CC,IAAAA,oCAAAA;AACAC,IAAAA,iBAAAA;AACAC,IAAAA,aAAAA;AACAC,IAAAA,kBAAAA;AACAC,IAAAA,mBAAAA;AACAC,IAAAA;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/database",
3
- "version": "5.33.3",
3
+ "version": "5.34.0",
4
4
  "description": "Strapi's database layer",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@paralleldrive/cuid2": "2.2.2",
45
- "@strapi/utils": "5.33.3",
45
+ "@strapi/utils": "5.34.0",
46
46
  "ajv": "8.16.0",
47
47
  "date-fns": "2.30.0",
48
48
  "debug": "4.3.4",
@@ -54,8 +54,8 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/fs-extra": "11.0.4",
57
- "eslint-config-custom": "5.33.3",
58
- "tsconfig": "5.33.3"
57
+ "eslint-config-custom": "5.34.0",
58
+ "tsconfig": "5.34.0"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=20.0.0 <=24.x.x",