Changes

m
Line 131: Line 131:     
== Foreign keys ==
 
== Foreign keys ==
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 in same table).
+
Name of a foreign key must start with the prefix <tt>fk_</tt> followed by the table name (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 field name (i.e. name of the referencing field) (this is to allow to have several foreign keys in same table).
    
Example:
 
Example:
''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 in another table)
+
''fk_facture_fourn_fk_soc''  is a foreign key in the table llx_facture_fourn for the field fk_soc in this table (that references the rowid field in 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