Answer the question
In order to leave comments, you need to log in
How to organize a table in a database, with abstract models?
Hello.
There is an abstract model "Posts" from which, say, two other models are inherited: Article, Newsdata
Article has fields other than Newsdata.
For example, Article has "Author" and Newsdata does not.
Article has "Last Modify" and Newsdata does not.
How to write Article and Newsdata to database? They have the same attributes. Create your own table on the Article model, and your own table on Newsdata? Or make a table that will store the Posts abstract model data and add an additional_data column where to store the information of the successors in json format?
I mean, the structure of the Posts table is like this:id | title | description | type | additional_info
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question