Answer the question
In order to leave comments, you need to log in
How to store and process similar entities (for example, planned and actual transactions)?
There are two entities: a planned and an actual transaction, they have all the main fields the same (date, amount, account, counterparty, tags), but a planned transaction may have additional parameters - regularity.
I see two implementation options:
1. General table of transactions + field indicating the type of transaction.
In this case, saving on models, controller, but from the minuses - you must always remember about the two entities with which you are working.
Planned transaction-specific fields - in a separate table with a one-to-one relationship.
2. Each entity has its own table + MVC
From the pros - you can customize each entity as you like
From the minuses - you will have to duplicate similar functionality.
I'm leaning towards the first option for now. Tell me, please, what is your experience?
Answer the question
In order to leave comments, you need to log in
Three tables and three models. One keeps all the communities. The two keep the differences. Never duplicate data in different tables in a database.
Or 1 table and 2 models.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question