Language and development rules: Difference between revisions

Jump to navigation Jump to search
Line 98: Line 98:
* Structure of tables.
* Structure of tables.
When you create a new table, it is recommended to use the same conventions as other Dolibarr tables. This means the following fields:
When you create a new table, it is recommended to use the same conventions as other Dolibarr tables. This means the following fields:
  - rowid integer for id
  - rowid INTEGER AUTO_INCREMENT PRIMARY KEY    that is technical id of record
  - entity         integer default 1     that is id for the multicompany feature
  - entity INTEGER default 1                   that is id for the multicompany feature
  - date_creation  datetime   that is the creation date
  - date_creation  datetime                   that is the creation date
  - tms            timestamp   that will contain date of last modification (the database manages this field automatically, no need to manage it by the code, just create the field)
  - tms            timestamp                   that will contain date of last modification (the database manages this field automatically, no need to manage it by the code, just create the field)
  - import_key that will contains the import code YYYYMMDDHHMMSS if you make mass import.
  - import_key                                 that will contains the import code YYYYMMDDHHMMSS if you make mass import.
Eventually
Eventually
  - fk_user_author integer that is the id of user making creation
  - fk_user_author integer that is the id of user making creation

Navigation menu