Hello,

All sql file into DOL_DOCUMENT_ROOT.'/mymodule/sql/'; are play in order
    First llx_table.sql
    second llx_table.key.sql
    third update.sql
    last data.sql

    Is is coded into _init method on core/class/DolibarrModule.class.php

Cdt.

Florian Henry
+33 6 03 76 48 07
[email protected]
http://www.open-concept.pro
Twitter : @_Open_Concept_
Google+ : https://www.google.com/+Open-conceptPro

Le 20/07/2015 09:24, Irfan Majeed a écrit :
hi i am confused at this point on dolibarr documentation i am creating my own module for testing
"
Then in the "load_tables" function of your file descriptor module, modify the line (where is load_tables defined ?)
$dir  =  DOL_DOCUMENT_ROOT.'/mymodule/sql/';

by

$dir  =  DOL_DOCUMENT_ROOT.'/valuechooseformymodule/sql/';(what 
isvaluechooseformymodule?)

/Rules to follow:/

  * Add the files about creating tables commands on the principle of a
    file *llx_matable.sql* per table with a possibly file
    *llx_matable.key.sql* (see existing files in
    *install/mysql/tables* for examples).

  * To manage data, you must create a file called *data.sql* inside
    directory */mymodule/sql/* that contains SQL command to
    add/edit/delete data.

Example of content of a file data.sql

  DELETE  FROM  llx_constWHERE  name='MYMODULE_IT_WORKS'  AND  
entity='__ENTITY__';
  INSERT  INTO  llx_const(name,  value,  type,  note,  visible,  entity)  
VALUES  ('MYMODULE_IT_WORKS','1','chaine','A constant vor my 
module',1,'__ENTITY__'


data.sql will be populated automatically when some operation happens on 
database ?



Thanks












"


_______________________________________________
Dolibarr-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

_______________________________________________
Dolibarr-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à