metal-orm 1.0.97 → 1.0.99

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.
@@ -57,15 +57,15 @@ export interface BelongsToRelation<TTarget extends TableDef = TableDef> {
57
57
  /**
58
58
  * Many-to-many relationship definition with rich pivot metadata
59
59
  */
60
- export interface BelongsToManyRelation<
61
- TTarget extends TableDef = TableDef,
62
- TPivot extends TableDef = TableDef
63
- > {
64
- type: typeof RelationKinds.BelongsToMany;
65
- target: TTarget;
66
- pivotTable: TPivot;
67
- pivotForeignKeyToRoot: string;
68
- pivotForeignKeyToTarget: string;
60
+ export interface BelongsToManyRelation<
61
+ TTarget extends TableDef = TableDef,
62
+ TPivot extends TableDef = TableDef
63
+ > {
64
+ type: typeof RelationKinds.BelongsToMany;
65
+ target: TTarget;
66
+ pivotTable: TPivot;
67
+ pivotForeignKeyToRoot: string;
68
+ pivotForeignKeyToTarget: string;
69
69
  localKey?: string;
70
70
  targetKey?: string;
71
71
  pivotPrimaryKey?: string;
@@ -159,25 +159,25 @@ export const belongsTo = <TTarget extends TableDef>(
159
159
  * @param options - Pivot metadata configuration
160
160
  * @returns BelongsToManyRelation definition
161
161
  */
162
- export const belongsToMany = <
163
- TTarget extends TableDef,
164
- TPivot extends TableDef = TableDef
165
- >(
166
- target: TTarget,
167
- pivotTable: TPivot,
168
- options: {
169
- pivotForeignKeyToRoot: string;
170
- pivotForeignKeyToTarget: string;
162
+ export const belongsToMany = <
163
+ TTarget extends TableDef,
164
+ TPivot extends TableDef = TableDef
165
+ >(
166
+ target: TTarget,
167
+ pivotTable: TPivot,
168
+ options: {
169
+ pivotForeignKeyToRoot: string;
170
+ pivotForeignKeyToTarget: string;
171
171
  localKey?: string;
172
172
  targetKey?: string;
173
173
  pivotPrimaryKey?: string;
174
174
  defaultPivotColumns?: string[];
175
175
  cascade?: CascadeMode;
176
176
  }
177
- ): BelongsToManyRelation<TTarget, TPivot> => ({
178
- type: RelationKinds.BelongsToMany,
179
- target,
180
- pivotTable,
177
+ ): BelongsToManyRelation<TTarget, TPivot> => ({
178
+ type: RelationKinds.BelongsToMany,
179
+ target,
180
+ pivotTable,
181
181
  pivotForeignKeyToRoot: options.pivotForeignKeyToRoot,
182
182
  pivotForeignKeyToTarget: options.pivotForeignKeyToTarget,
183
183
  localKey: options.localKey,