We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follower model:
... @ForeignKey(() => User) @AllowNull(false) @Column({ type: DataType.BIGINT, }) public followee_id: string; @ForeignKey(() => User) @AllowNull(false) @Column({ type: DataType.BIGINT, }) public follower_id: string; @BelongsTo(() => User, 'followee_id') public followee: User; @BelongsTo(() => User, 'follower_id') public follower: User; ...
User model:
... @HasMany(() => Relation, { as: 'followers', foreignKey: 'followee_id', hooks: true, onDelete: 'CASCADE', }) public followers: Relation[]; @HasMany(() => Relation, { as: 'followees', foreignKey: 'follower_id', hooks: true, onDelete: 'CASCADE', }) public followees: Relation[]; ...
Error:
Error: Alias cannot be inferred: "Relation" has multiple relations with "User"
The text was updated successfully, but these errors were encountered:
Turned out to be my mistake, forgot to add alias in the default scope.
Sorry, something went wrong.
No branches or pull requests
Issue
Follower model:
User model:
Error:
Versions
Issue type
The text was updated successfully, but these errors were encountered: