-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Feature Description
Add an option to specify custom discriminator values for Single Table Inheritance (STI), on the EntitySchema class.
Currently, when using separate Entity definitions, the only possible values on the discriminator column is the name of the entity class.
The Solution
Add a discriminatorValue to EntitySchema props, which will be used as the discriminator value in place of the entity class name, when defined.
It can leverage the fact that this feature is already implemented using the @ChildEntity decorator by just adding a DiscriminatorValueMetadataArgs object to the MetadataArgsStorage when running EntitySchemaTransformer#transform.
Considered Alternatives
None, if one wishes to use the EntitySchema API while having custom discriminator values.
Currently, this is only possible via the @ChildEntity decorator API.
Additional Context
No response
Relevant Database Driver(s)
- aurora-mysql
- aurora-postgres
- better-sqlite3
- cockroachdb
- cordova
- expo
- mongodb
- mysql
- nativescript
- oracle
- postgres
- react-native
- sap
- spanner
- sqlite
- sqlite-abstract
- sqljs
- sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.