Closed dominicbachmann closed 1 year ago
This merge will resolve my issue as well.
Hi, nice work here. @bashleigh is it possible to merge this and publish a new version?
Anything I can help with @bashleigh @dominicbachmann ? Would be awesome to finish the bump to typeorm ^0.3.0
@sashalikesplanes Yes please, could you fix your tests? Looks like they're not passing in github actions. Looks like config setup issues
@dominicbachmann You just need to rebase with the master branch and it will be fixed
@dominicbachmann You just need to rebase with the master branch and it will be fixed
Will do
Any further updates regarding this topic? 🚀
Hey nice work, im curious i forked your branch and was trying the inverse of the provided example.
@Entity()
export class StoreEntity {
@PrimaryGeneratedColumn()
id: number;
@PolymorphicChildren(() => [VisitorEntity, EmployeeEntity], {
entityTypeId: 'id'
})
visitors: (VisitorEntity | EmployeeEntity)[];
}
@Entity()
export class VisitorEntity{
@PrimaryGeneratedColumn()
id: number;
@PolymorphicParent(() => StoreEntity, {
eager: true,
})
store?: StoreEntity;
@Column()
entityType: string;
}
@Entity()
export class EmployeeEntity {
@PrimaryGeneratedColumn()
id: number;
@Column()
entityType: string;
@PolymorphicParent(() => StoreEntity, {
eager: true,
})
store: StoreEntity;
}
But i think the provided package doesnt work with this example? Do you have any hints how to make it work?
Best
Tobi
After looking more closely at this PR, I've decided to submit a different approach to this upgrade.
Please see https://github.com/bashleigh/typeorm-polymorphic/pull/38 which explains the motivation.
I had to change quite a lot since the way of defining custom repositories has heavily changed. All the tests are passing. I've added one change that is not related to the typeorm upgrade because I tought that it is probably a bug (the change is marked with: // TODO: Not sure about this change (key was just id before).
Please let me know if this is a valid approach and if I can do anything else.