New issue
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
Single table inheritance returns the same discriminator value error for unrelated tables where their parents extend from the same entity #8522
Comments
marypaz-sama
pushed a commit
to marypaz-sama/typeorm
that referenced
this issue
Jan 12, 2022
…ror for unrelated tables where their parents extend from the same entity Add a new condition in entity metada validator to be sure that we are testing the same table Solve: typeorm#8522
marypaz-sama
changed the title
Single table inheritance returns the same discriminator value error for unrelated tables where their parents extend from the same table
Single table inheritance returns the same discriminator value error for unrelated tables where their parents extend from the same entity
Jan 12, 2022
marypaz-sama
pushed a commit
to marypaz-sama/typeorm
that referenced
this issue
Jan 12, 2022
Add missing entity to the last commit Solve: typeorm#8522
marypaz-sama
pushed a commit
to marypaz-sama/typeorm
that referenced
this issue
Jan 12, 2022
Add a new test to prove that related tables failed when they have the same discriminator Solve: typeorm#8522
pleerock
pushed a commit
that referenced
this issue
Jan 15, 2022
…ror for unrelated tables where their parents extend from the same entity (#8525) * fix: Single table inheritance returns the same discriminator value error for unrelated tables where their parents extend from the same entity Add a new condition in entity metada validator to be sure that we are testing the same table Solve: #8522 * fix: Add internal role entity Add missing entity to the last commit Solve: #8522 * fix: Related tables still failed when have the same discriminator Add a new test to prove that related tables failed when they have the same discriminator Solve: #8522
TheNoim
added a commit
to TheNoim/typeorm
that referenced
this issue
Jan 30, 2022
The test for issue typeorm#8522 didn't probably close all of its connections. This could result in test for issue typeorm#863 to fail. With this change the connections should all probably get closed. Closes typeorm#8567
7 tasks
TheNoim
added a commit
to TheNoim/typeorm
that referenced
this issue
Jan 30, 2022
The test for issue typeorm#8522 didn't probably close all of its connections. This could result in test for issue typeorm#863 to fail. With this change the connections should all probably get closed. Closes typeorm#8567
TheNoim
added a commit
to TheNoim/typeorm
that referenced
this issue
Jan 30, 2022
The test for issue typeorm#8522 didn't probably close all of its connections. This could result in test for issue typeorm#863 to fail. With this change the connections should all probably get closed. Closes typeorm#8567
TheNoim
added a commit
to TheNoim/typeorm
that referenced
this issue
Jan 30, 2022
The test for issue typeorm#8522 didn't probably close all of its connections. This could result in test for issue typeorm#863 to fail. With this change the connections should all probably get closed. Closes typeorm#8567
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
There are two unrelated child entities following the single table inheritance pattern with same discriminator value, if both entities inherit from a class that just adds some common columns it, it throws an error.
For example:
Both
InternalRole
andInternalRole
entities have the same discriminator valueinternal
.BaseEntity
just defines some common columns.Expected Behavior
There should be no error, as the entities
InternalUser
andInternalRole
are not related becauseBaseEntity
is just a generic entity to create createdAt, updatedAt and primary columns for all tables. And TableInheritance decorator is added inUser
andRole
entities notBaseEntity
Actual Behavior
It throws an error.
Steps to Reproduce
Minimal code reproduction:
My Environment
Additional Context
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: