Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
541 views
in Q2A Core by
The plugin news letters needs to use this table but it doesn't exist.

How can I create it ?

2 Answers

+1 vote
by
selected by
 
Best answer

I just took a quick glance at the code. Indeed, the table ^usermetas must have been created at the time you installed Q2A. However, the table qa_usermetas might not necessarily exist.

If you have modified the table prefix in qa-config.php  (QA_MYSQL_TABLE_PREFIX) into something different than qa_ then the table will be called something else.

This can easily be overcome by developers by just using ^ in the table name. So any table prefix will be replaced. However, it seems Noah has missed that in this line:

https://github.com/NoahY/q2a-newsletter/blob/4ed795c9233ef941cb92486605eb2f7786ee6eb9/qa-plugin.php#L192

So, instead of creating the table, which unless you have seriously messed with Q2A, it should already exist, it would be much better to edit that line of the plugin and instead of using qa_usermetas use ^usermetas.

by
Indeed, i have changes the prefix and Noah missed that.
I will modify that line .
+1 vote
by
It should be created by Q2A. Which version are you using?

Anyway you can run this query

CREATE TABLE `qa_usermetas` (
  `userid` int(10) unsigned NOT NULL,
  `title` varchar(40) NOT NULL,
  `content` varchar(8000) NOT NULL,
  PRIMARY KEY (`userid`,`title`),
  CONSTRAINT `qa_usermetas_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `qa_users` (`userid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
by
1.7.4
Thanks for the schema ! I'll try to create it right away.
...