Note that there are some explanatory texts on larger screens.

plurals
  1. POsHow to include different types of the same entity into db?
    primarykey
    data
    text
    <p>Hope the titles is okay.</p> <p>I'm building a little learn app. It bases on the principle of cards. You can learn vocables, graphs, formulas etc. So you have different types of content/cards. Basically, I divide them into 2 types:</p> <p>Vocable Cards => The front and back of the card can have several words (synonyms). Also having auto translate functionality. Common Cards => Can mix images, text and forumlas. Includes everythign else. From Biology to Physics. Special functionality is a formula generator and a paing/drawing tool.</p> <p>At the moment, I'm having 2 questions.</p> <p>What's the best Database Design for this and how to save such content? The content is css, html etc.</p> <p>The vocable cards are only words or common expressions (e.g. Ca va?). If the user types in bigger strings, I'll disable the translate functionality. Also, some cards might share some synonyms (not on purpose), should I take care of this? I could create a vocabel list and some m:n relationship table or just save all the synonyms as a json/csv in one column in the cards table. The later approach would also fit for the second type of cards, the common ones. (Didn't find a good name for them yet)</p> <p>The images will be stored localy.</p> <p>I somehow don't get a nice solution. I need to somehow set the type of the card. And also I need to know if I can use the same design for each content type.</p> <p>At the moment, I'd do this: But still, somehow I'm not convinced. Maybe it's better to put al lthe cards stuff together and just save the content in the frontContent and backContent cplumn and determine it's type by a type column. Also, can I make the frontContent and backContent on the vocableCard an auto increasing number and make such an m:n relationship?</p> <p>[IMG]http://i44.tinypic.com/2uiy6q9.jpg[/IMG]</p> <p>I'll use doctrine, an ORM, Symfony2 and thus PHP. The whole thing will be done in Psql or MySql, didn't decide yet. Any recommendations? It will also be developed for mobile platforms and thus run on liteSql. I'm also adding a synchronizing functionality.</p> <p>Another approach is this: <a href="http://tinypic.com/r/2nby5gh/5" rel="nofollow">http://tinypic.com/r/2nby5gh/5</a> I like this one better since it seems more general. I could also add another type table and always be able to easily add one whereas I I would needto create a new table for a new type with the first approach. On the first one I like the fact that I could create a table for my content which actualy fits my content in a better way. BUt maybe, you have a better idea?</p> <p>I really apprechiate any help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload