CREATE TABLE IF NOT EXISTS ps_mymod_comment (id_mymod_comment int(11) NOT NULL AUTO_INCREMENT, id_product` int(11) NOT NULL, grade tinyint(1) NOT NULL, comment text NOT NULL,date_add datetime NOT NULL,PRIMARY KEY (id_mymod_comment)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
As you can see, the table contains five fields: the line identifier (in auto-increment), the product identifier, the grade, the comment, and the date of the comment.
In PrestaShop, the naming conventions for the database field are:
Name your identifier field with the
id_prefix followed by the name of the table without the
Name your date with the
date_prefix, such as
Create your table with your SQL admin tool (mine is phpMyAdmin; yeah, I know, I'm a bit old school). Beware! If you chose a different prefix than