Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by

For another plugin I only need to set  a flag for each question (0, 1 or 2).

For now, I am going the "clean" way to create another table that holds the questionid + the flag.

However, for several mysql requests it would be nice to get the flag directly from qa_posts, because then it is only a one liner.

Consequently my question is:

What happens if I add an extra field to qa_posts? Will there be any update problems (let's say I give it a name like q2apro_flags, should this be a problem)?

Thanks in advance for your advices,

Q2A version: 1.7

1 Answer

+2 votes
selected by
Best answer
Most likely, nothing bad will happen. However, you don't what will happen in future releases of Q2A.
Suppose in the installation process the amount of columns in the qa_posts table is checked and if it is not the expected amount the table is recreated as it is assumed q2a is not (properly) installed. If the core did that check after adding a column then the table would be recreated. This is clearly, a silly check. But you don't know what other seemingly silly checks might be done in the future that might break the core or, actully, a database upgrade.
So it isn't worth the risk to perform a "database core hack" while you can get away with creating a pluggable table that won't interfere with the core. And yes, if you asked me, I would sacrifice a bit of performance by doing the join in order to sleep well knowing I won't be responsible of anything bad that might happen to the users :)
thanks pupi1985, agreed =)