Language and development rules: Difference between revisions

Jump to navigation Jump to search
m
Line 131: Line 131:


== Foreign keys ==
== Foreign keys ==
A foreign key name must start with prefix <tt>fk_</tt> followed by the table name linked (this is required to avoid duplicate names in project that are not allowed even if on different tables by some DBMS like Postgresql) then the name of child field (this is to allow to have several foreign keys on same table).
Name of a foreign key must start with the prefix <tt>fk_</tt> followed by the table name linked (i.e. name of the referencing table) (this is required to avoid duplicate names in project that are not allowed even if in different tables by some DBMS like Postgresql) then the name of child field (i.e. name of the referencing field) (this is to allow to have several foreign keys on same table).


Example:
Example:
''fk_facture_fourn_fk_soc''  is a foreign key on table llx_facture_fourn for field fk_soc in this table (that link to the rowid field in another table)
''fk_facture_fourn_fk_soc''  is a foreign key in table llx_facture_fourn for the field fk_soc in this table (that references the rowid field on another table)


Note: If you develop your own external module, it must have no foreign keys that point to Dolibarr standard tables. This will break standard dolibarr upgrades, repair, backup and restore tools and may also break standard features.
Note: If you develop your own external module, it must have no foreign keys that point to Dolibarr standard tables. This will break standard dolibarr upgrades, repair, backup and restore tools and may also break standard features.
304

edits

Navigation menu