304
edits
| Line 78: | Line 78: | ||
* Structure of tables. | * Structure of tables. | ||
When you create a new table, it is | 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 for id | ||
- tms timestamp that will | - 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. | ||
Eventualy | Eventualy | ||
| Line 95: | Line 95: | ||
* Type of fields: | * Type of fields: | ||
Well, to be compatible with any | Well, to be compatible with any accuracy required by any country on amounts, and with any database syntax, we will use the following type into database: | ||
- integer for an any of foreign key | - integer for an any of foreign key | ||
- double(24,8) for any amount | - double(24,8) for any amount | ||
| Line 102: | Line 102: | ||
- varchar for a string (also if length is 1, the type char is more and more deprecated) | - varchar for a string (also if length is 1, the type char is more and more deprecated) | ||
- timestamp for a field date+time that is automatically updated | - timestamp for a field date+time that is automatically updated | ||
- datetime for a field date+ | - datetime for a field date+time | ||
- date for a field date | - date for a field date | ||
edits