breaking: rework how links database migrations are managed (#8162)

This commit is contained in:
Adrien de Peretti
2024-07-22 09:42:23 +02:00
committed by GitHub
parent f435c6c7f6
commit f74fdcb644
24 changed files with 1090 additions and 264 deletions

View File

@@ -34,7 +34,7 @@ type ExtraOptions = {
[key: string]: string
}
database?: {
table: string
table?: string
idPrefix?: string
extraColumns?: LinkModulesExtraFields
}

View File

@@ -41,7 +41,7 @@ export type ModelsConfigTemplate = { [key: string]: ModelDTOConfig }
export type ModelConfigurationsToConfigTemplate<T extends ModelEntries> = {
[Key in keyof T]: {
dto: T[Key] extends IDmlEntity<any, any>
dto: T[Key] extends DmlEntity<any, any>
? InferEntityType<T[Key]>
: T[Key] extends Constructor<any>
? InstanceType<T[Key]>
@@ -261,7 +261,8 @@ type InferModelFromConfig<T> = {
: never
}
export type MedusaServiceReturnType<ModelsConfig extends Record<any, any>> = {
new (...args: any[]): AbstractModuleService<ModelsConfig>
$modelObjects: InferModelFromConfig<ModelsConfig>
}
export type MedusaServiceReturnType<ModelsConfig extends Record<string, any>> =
{
new (...args: any[]): AbstractModuleService<ModelsConfig>
$modelObjects: InferModelFromConfig<ModelsConfig>
}