Skip to end of metadata
Go to start of metadata

SQL Guidelines

Table names

  1. Table names must begin with the PrestaShop "_DB_PREFIX_" prefix.

  2. Table names must have the same name as the object they reflect: "ps_cart".
  3. Table names have to stay singular: "ps_order".
  4. Language data have to be stored in a table named exactly like the object's table, and with the "_lang" suffix: "ps_product_lang".

SQL query

  1. Keywords must be written in uppercase.

  2. Back quotes ("`") must be used around SQL field names and table names.

  3. Table aliases have to be named by taking the first letter of each word, and must be lowercase.

  4. When conflicts between table aliases occur, the second character has to be also used in the name.

  5. A new line has to be created for each clause.

  6. It is forbidden to make a JOIN in a WHERE clause.
  • No labels