You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is this a bug request not a feature request? Because TypeORM is awesome in general, yet not following/allowing for best practices in database design really lets it down. When we have multiple levels of Inheritance, things get even worse. The table columns order makes less sense, and when using a base class that has a blob type, now all of a sudden i can have a blob in the middle of my table, vs the end.
Actual Behavior
Inherited columns can show up at the end, beginning, or in the case of multiple levels, middle of the table.
Year 2023, Jul. Probably this problem stil didn't solved. persistable method is working but this isn't solve main side of the problem. We really need to set order number for each column. We must able to set id column as first column, deletedAt last (-1), updatedAt -2, createdAt -3 etc. Negative numbers must start from last, positive first. Why nobody solves this problem? Eloquent and doctrine didn't solve too. I didn't understand why.
Edit: For now I'm using that method: create two classes (ExampleEntity, InsertableExampleEntity), First class is extending other (ExampleEntity extends InsertableExampleEntity). Id and timestamps are living in ExampleEntity, business logic fields are living in InsertableExampleEntity. Now if you generate migration then id and timestamp fields will be live last in migration's SQL commands. I'm changing this SQL, moving id column at the top of the table and executing migrations.
Issue Description
When a base classs is used, e.g. audit fields, they some times come up first with the tables are generated, but sometimes they come up last:
These two tables extend from the same base entity.
Expected Behavior
Seems to be a reference here: #541
Why is this a bug request not a feature request? Because TypeORM is awesome in general, yet not following/allowing for best practices in database design really lets it down. When we have multiple levels of Inheritance, things get even worse. The table columns order makes less sense, and when using a base class that has a blob type, now all of a sudden i can have a blob in the middle of my table, vs the end.
Actual Behavior
Inherited columns can show up at the end, beginning, or in the case of multiple levels, middle of the table.
Steps to Reproduce
My Environment
Node v15.14.0
├── typeorm@0.2.32
└── typescript@4.2.4
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: