@strapi/database 5.0.0-rc.11 → 5.0.0-rc.12
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.
package/dist/index.mjs
CHANGED
|
@@ -6144,15 +6144,15 @@ const getNextIdsToCreateDocumentId = async (db, knex2, {
|
|
|
6144
6144
|
};
|
|
6145
6145
|
const migrateDocumentIdsWithLocalizations = async (db, knex2, meta) => {
|
|
6146
6146
|
const singularName = meta.singularName.toLowerCase();
|
|
6147
|
-
const joinColumn =
|
|
6148
|
-
const inverseJoinColumn =
|
|
6147
|
+
const joinColumn = snakeCase(`${singularName}_id`);
|
|
6148
|
+
const inverseJoinColumn = snakeCase(`inv_${singularName}_id`);
|
|
6149
6149
|
let ids;
|
|
6150
6150
|
do {
|
|
6151
6151
|
ids = await getNextIdsToCreateDocumentId(db, knex2, {
|
|
6152
6152
|
joinColumn,
|
|
6153
6153
|
inverseJoinColumn,
|
|
6154
6154
|
tableName: meta.tableName,
|
|
6155
|
-
joinTableName:
|
|
6155
|
+
joinTableName: snakeCase(`${meta.tableName}_localizations_links`)
|
|
6156
6156
|
});
|
|
6157
6157
|
if (ids.length > 0) {
|
|
6158
6158
|
await knex2(meta.tableName).update({ document_id: createId() }).whereIn("id", ids);
|
|
@@ -6174,7 +6174,7 @@ const createDocumentIdColumn = async (knex2, tableName) => {
|
|
|
6174
6174
|
});
|
|
6175
6175
|
};
|
|
6176
6176
|
const hasLocalizationsJoinTable = async (knex2, tableName) => {
|
|
6177
|
-
const joinTableName =
|
|
6177
|
+
const joinTableName = snakeCase(`${tableName}_localizations_links`);
|
|
6178
6178
|
return knex2.schema.hasTable(joinTableName);
|
|
6179
6179
|
};
|
|
6180
6180
|
const createdDocumentId = {
|