M
M
MrDickson2018-07-27 11:04:36
MySQL
MrDickson, 2018-07-27 11:04:36

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

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2018-07-27
@MrDickson

yes, two different tables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question