fix: Link migration descriptor case changes and hash computation (#9560)

**What**
The module service name case has changed and the hash generation was performed on the non lower cased version of it while after the hash generation everything is based on the lower case version of the generated table name form the service names leading to different hash computation. This pr update the link migration table to adjust the to/from module value with its new value as well as generating the hash from the lower case version of the computed table name

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
Adrien de Peretti
2024-10-14 16:32:50 +02:00
committed by GitHub
parent 170b3a08b7
commit cea4cdc8d7
6 changed files with 84 additions and 62 deletions

View File

@@ -3,10 +3,10 @@ import {
ModuleJoinerConfig,
} from "@medusajs/framework/types"
import {
SoftDeletableFilterKey,
composeTableName,
mikroOrmSoftDeletableFilterOptions,
simpleHash,
SoftDeletableFilterKey,
} from "@medusajs/framework/utils"
import { EntitySchema } from "@mikro-orm/core"
@@ -36,7 +36,7 @@ export function generateEntity(
primary.foreignKey,
foreign.serviceName,
foreign.foreignKey
)
).toLowerCase()
const fields = fieldNames.reduce((acc, curr) => {
acc[curr] = {