Adding the same columns to many models (entity first workflow) #2938
Unanswered
SKCrawford
asked this question in
Q&A
Replies: 2 comments
-
|
I see tracking database changes in the docs, but I don't see anything about soft deletion. I'd still need to put fields on every single model. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
One possible workaround is to write a custom attribute macro to add custom fields. Rust doesn’t have field inheritance, so we may need to implement something similar to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the new entity workflow to make a RESTful production server, but I'm completely stuck. I need to put the same columns onto a huge number of models. For example, I need to heavily track all changes, so I need columns like
deleted_on, deleted_by, created_on, created_by, updated_on, updated_by, is_deleted, deleted_on, deleted_byand a number of other columns. These all need to go on the models for a number of reasons. But if I change one, I have to change them on every single model.In comparison, python's sqlalchemy permits the use of mixins. The models extend these to generate the columns. I know rust isn't python, but hard-coding it all is a non-starter for me.
Is there any way to accomplish this? The docs mention nothing about it, and custom derive macros don't seem to work. I'm all out of ideas. This is a hard requirement for me.
Beta Was this translation helpful? Give feedback.
All reactions