11.0.0-12.0.0.sql 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. --
  2. -- Be carefull to requests order.
  3. -- This file must be loaded by calling /install/index.php page
  4. -- when current version is 12.0.0 or higher.
  5. --
  6. -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
  7. -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
  8. -- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
  9. -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
  10. -- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
  11. -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
  12. -- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
  13. -- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
  14. -- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field);
  15. -- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table
  16. -- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex
  17. -- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
  18. -- To make pk to be auto increment (postgres):
  19. -- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid;
  20. -- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid);
  21. -- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq');
  22. -- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table;
  23. -- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL;
  24. -- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
  25. -- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL;
  26. -- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
  27. -- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
  28. -- Note: fields with type BLOB/TEXT can't have default value.
  29. -- Missing in v11
  30. UPDATE llx_c_units set scale = 3600 where code = 'H' and unit_type = 'time';
  31. UPDATE llx_c_units set scale = 86400 where code = 'D' and unit_type = 'time';
  32. create table llx_commande_fournisseur_dispatch_extrafields
  33. (
  34. rowid integer AUTO_INCREMENT PRIMARY KEY,
  35. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  36. fk_object integer NOT NULL, -- object id
  37. import_key varchar(14) -- import key
  38. )ENGINE=innodb;
  39. ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
  40. ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1;
  41. UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
  42. create table llx_c_shipment_package_type
  43. (
  44. rowid integer AUTO_INCREMENT PRIMARY KEY,
  45. label varchar(50) NOT NULL, -- Short name
  46. description varchar(255), -- Description
  47. active integer DEFAULT 1 NOT NULL, -- Active or not
  48. entity integer DEFAULT 1 NOT NULL -- Multi company id
  49. )ENGINE=innodb;
  50. create table llx_facturedet_rec_extrafields
  51. (
  52. rowid integer AUTO_INCREMENT PRIMARY KEY,
  53. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  54. fk_object integer NOT NULL, -- object id
  55. import_key varchar(14) -- import key
  56. )ENGINE=innodb;
  57. ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object);
  58. ALTER TABLE llx_facture_rec MODIFY COLUMN titre varchar(200) NOT NULL;
  59. create table llx_mrp_mo_extrafields
  60. (
  61. rowid integer AUTO_INCREMENT PRIMARY KEY,
  62. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  63. fk_object integer NOT NULL,
  64. import_key varchar(14) -- import key
  65. ) ENGINE=innodb;
  66. ALTER TABLE llx_mrp_mo_extrafields DROP INDEX idx_fk_object;
  67. ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_mrp_mo_fk_object(fk_object);
  68. -- This var is per entity now, so we remove const if global if exists
  69. delete from llx_const where name in ('PROJECT_HIDE_TASKS', 'MAIN_BUGTRACK_ENABLELINK', 'MAIN_HELP_DISABLELINK') and entity = 0;
  70. -- For v12
  71. ALTER TABLE llx_bom_bom MODIFY COLUMN duration double(24,8);
  72. ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-order';
  73. ALTER TABLE llx_ecm_files MODIFY COLUMN src_object_type varchar(64);
  74. ALTER TABLE llx_document_model MODIFY COLUMN type varchar(64);
  75. -- Delete an old index that is duplicated
  76. -- VMYSQL4.1 DROP INDEX ix_fk_product_stock on llx_product_batch;
  77. -- VPGSQL8.2 DROP INDEX ix_fk_product_stock;
  78. ALTER TABLE llx_actioncomm DROP COLUMN punctual;
  79. DELETE FROM llx_menu where module='supplier_proposal';
  80. UPDATE llx_website SET lang = 'en' WHERE lang like 'en_%';
  81. UPDATE llx_website SET lang = 'fr' WHERE lang like 'fr_%';
  82. UPDATE llx_website SET lang = 'es' WHERE lang like 'es_%';
  83. UPDATE llx_website SET lang = 'de' WHERE lang like 'de_%';
  84. UPDATE llx_website SET lang = 'it' WHERE lang like 'it_%';
  85. UPDATE llx_website SET lang = 'pt' WHERE lang like 'pt_%';
  86. UPDATE llx_website_page SET lang = 'en' WHERE lang like 'en_%';
  87. UPDATE llx_website_page SET lang = 'fr' WHERE lang like 'fr_%';
  88. UPDATE llx_website_page SET lang = 'es' WHERE lang like 'es_%';
  89. UPDATE llx_website_page SET lang = 'de' WHERE lang like 'de_%';
  90. UPDATE llx_website_page SET lang = 'it' WHERE lang like 'it_%';
  91. UPDATE llx_website_page SET lang = 'pt' WHERE lang like 'pt_%';
  92. ALTER TABLE llx_website ADD COLUMN lang varchar(8);
  93. ALTER TABLE llx_website ADD COLUMN otherlang varchar(255);
  94. ALTER TABLE llx_website_page ADD COLUMN author_alias varchar(64);
  95. UPDATE llx_rights_def SET perms = 'order_advance', subperms = 'close' WHERE module = 'commande' AND perms = 'cloturer';
  96. UPDATE llx_rights_def SET perms = 'propal_advance', subperms = 'close' WHERE module = 'propale' AND perms = 'cloturer';
  97. ALTER TABLE llx_holiday_users DROP INDEX uk_holiday_users;
  98. ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type);
  99. ALTER TABLE llx_ticket ADD COLUMN import_key varchar(14);
  100. ALTER TABLE llx_ticket ADD UNIQUE uk_ticket_ref (ref, entity);
  101. ALTER TABLE llx_ticket ADD INDEX idx_ticket_entity (entity);
  102. ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_soc (fk_soc);
  103. ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_user_assign (fk_user_assign);
  104. ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_project (fk_project);
  105. ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_statut (fk_statut);
  106. --ALTER TABLE llx_facturerec DROP COLUMN vat_src_code;
  107. -- Migration to the new regions (France)
  108. UPDATE llx_c_regions set nom = 'Centre-Val de Loire' WHERE fk_pays = 1 AND code_region = 24;
  109. insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 27, '21231', 0, 'Bourgogne-Franche-Comté');
  110. insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 28, '76540', 0, 'Normandie');
  111. insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 32, '59350', 4, 'Hauts-de-France');
  112. insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 44, '67482', 2, 'Grand Est');
  113. insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 75, '33063', 0, 'Nouvelle-Aquitaine');
  114. insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 76, '31355', 1, 'Occitanie');
  115. insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 84, '69123', 1, 'Auvergne-Rhône-Alpes');
  116. UPDATE llx_c_departements set fk_region = 27 WHERE fk_region = 26 OR fk_region = 43;
  117. UPDATE llx_c_departements set fk_region = 28 WHERE fk_region = 25 OR fk_region = 23;
  118. UPDATE llx_c_departements set fk_region = 32 WHERE fk_region = 22 OR fk_region = 31;
  119. UPDATE llx_c_departements set fk_region = 44 WHERE fk_region = 21 OR fk_region = 41 OR fk_region = 42;
  120. UPDATE llx_c_departements set fk_region = 75 WHERE fk_region = 54 OR fk_region = 74 OR fk_region = 72;
  121. UPDATE llx_c_departements set fk_region = 76 WHERE fk_region = 73 OR fk_region = 91;
  122. UPDATE llx_c_departements set fk_region = 84 WHERE fk_region = 82 OR fk_region = 83;
  123. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 21;
  124. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 22;
  125. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 23;
  126. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 25;
  127. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 26;
  128. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 31;
  129. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 41;
  130. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 42;
  131. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 43;
  132. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 54;
  133. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 72;
  134. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 73;
  135. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 74;
  136. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 82;
  137. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 83;
  138. DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 91;
  139. ALTER TABLE llx_bookmark DROP INDEX uk_bookmark_url;
  140. ALTER TABLE llx_bookmark DROP INDEX uk_bookmark_title;
  141. ALTER TABLE llx_bookmark MODIFY COLUMN url TEXT;
  142. ALTER TABLE llx_bookmark ADD UNIQUE uk_bookmark_title (fk_user, entity, title);
  143. ALTER TABLE llx_societe_rib MODIFY COLUMN owner_address varchar(255);
  144. ALTER TABLE llx_societe_rib MODIFY COLUMN default_rib smallint NOT NULL DEFAULT 0;
  145. ALTER TABLE llx_societe_rib ADD COLUMN stripe_account varchar(128);
  146. create table llx_object_lang
  147. (
  148. rowid integer AUTO_INCREMENT PRIMARY KEY,
  149. fk_object integer DEFAULT 0 NOT NULL,
  150. type_object varchar(32) NOT NULL, -- value found into $object->element
  151. property varchar(32) NOT NULL,
  152. lang varchar(5) DEFAULT 0 NOT NULL,
  153. value text,
  154. import_key varchar(14) DEFAULT NULL
  155. )ENGINE=innodb;
  156. ALTER TABLE llx_object_lang ADD UNIQUE INDEX uk_object_lang (fk_object, type_object, property, lang);
  157. CREATE TABLE llx_categorie_actioncomm
  158. (
  159. fk_categorie integer NOT NULL,
  160. fk_actioncomm integer NOT NULL,
  161. import_key varchar(14)
  162. ) ENGINE=innodb;
  163. ALTER TABLE llx_categorie_actioncomm ADD PRIMARY KEY pk_categorie_actioncomm (fk_categorie, fk_actioncomm);
  164. ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_categorie (fk_categorie);
  165. ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_actioncomm (fk_actioncomm);
  166. ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
  167. ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm (id);
  168. ALTER TABLE llx_accounting_account ADD COLUMN labelshort varchar(255) DEFAULT NULL after label;
  169. ALTER TABLE llx_subscription ADD COLUMN fk_user_creat integer DEFAULT NULL;
  170. ALTER TABLE llx_subscription ADD COLUMN fk_user_valid integer DEFAULT NULL;
  171. UPDATE llx_c_forme_juridique set libelle = 'SRL - Société à responsabilité limitée' WHERE code = '201';
  172. ALTER TABLE llx_c_country ADD COLUMN eec integer;
  173. UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GB','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI','UK');
  174. INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG18-ASSOC', 'French foundation chart of accounts 2018', 1);
  175. INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCGAFR14-DEV', 'The developed farm accountancy french plan 2014', 1);
  176. INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 41, 'AT-BASE', 'Plan Austria', 1);
  177. create table llx_c_ticket_resolution
  178. (
  179. rowid integer AUTO_INCREMENT PRIMARY KEY,
  180. entity integer DEFAULT 1,
  181. code varchar(32) NOT NULL,
  182. pos varchar(32) NOT NULL,
  183. label varchar(128) NOT NULL,
  184. active integer DEFAULT 1,
  185. use_default integer DEFAULT 1,
  186. description varchar(255)
  187. )ENGINE=innodb;
  188. ALTER TABLE llx_c_ticket_resolution ADD UNIQUE INDEX uk_code (code, entity);
  189. INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('SOLVED', '10', 'Solved', 1, 0, NULL);
  190. INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('CANCELED', '50', 'Canceled', 1, 0, NULL);
  191. INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('OTHER', '90', 'Other', 1, 0, NULL);
  192. DELETE FROM llx_const WHERE name = __ENCRYPT('DONATION_ART885')__;
  193. -- VMYSQL4.1 ALTER TABLE llx_extrafields MODIFY COLUMN printable integer DEFAULT 0;
  194. -- VPGSQL8.2 ALTER TABLE llx_extrafields ALTER COLUMN printable DROP DEFAULT;
  195. -- VPGSQL8.2 ALTER TABLE llx_extrafields MODIFY COLUMN printable integer USING printable::integer;
  196. -- VPGSQL8.2 ALTER TABLE llx_extrafields ALTER COLUMN printable SET DEFAULT 0;
  197. ALTER TABLE llx_extrafields ADD COLUMN printable integer DEFAULT 0;
  198. UPDATE llx_const SET name = 'INVOICE_USE_RETAINED_WARRANTY' WHERE name = 'INVOICE_USE_SITUATION_RETAINED_WARRANTY';
  199. ALTER TABLE llx_accounting_account DROP COLUMN pcg_subtype;
  200. ALTER TABLE llx_product ADD COLUMN accountancy_code_buy_intra varchar(32) AFTER accountancy_code_buy;
  201. ALTER TABLE llx_product ADD COLUMN accountancy_code_buy_export varchar(32) AFTER accountancy_code_buy_intra;
  202. ALTER TABLE llx_entrepot ADD COLUMN fax varchar(20) DEFAULT NULL;
  203. ALTER TABLE llx_entrepot ADD COLUMN phone varchar(20) DEFAULT NULL;
  204. ALTER TABLE llx_accounting_account ADD COLUMN reconcilable tinyint DEFAULT 0 NOT NULL after active;
  205. ALTER TABLE llx_categorie MODIFY type integer NOT NULL DEFAULT 1;
  206. ALTER TABLE llx_societe_remise_except ADD COLUMN vat_src_code varchar(10) DEFAULT '';
  207. ALTER TABLE llx_blockedlog MODIFY COLUMN object_data mediumtext;
  208. ALTER TABLE llx_blockedlog ADD COLUMN object_version varchar(32) DEFAULT '';
  209. ALTER TABLE llx_product_lot MODIFY COLUMN batch varchar(128);
  210. ALTER TABLE llx_product_batch MODIFY COLUMN batch varchar(128);
  211. ALTER TABLE llx_expeditiondet_batch MODIFY COLUMN batch varchar(128);
  212. ALTER TABLE llx_commande_fournisseur_dispatch MODIFY COLUMN batch varchar(128);
  213. ALTER TABLE llx_stock_mouvement MODIFY COLUMN batch varchar(128);
  214. ALTER TABLE llx_mrp_production MODIFY COLUMN batch varchar(128);
  215. ALTER TABLE llx_mrp_production MODIFY qty real NOT NULL DEFAULT 1;
  216. ALTER TABLE llx_expeditiondet_batch MODIFY COLUMN batch varchar(128);
  217. create table llx_categorie_website_page
  218. (
  219. fk_categorie integer NOT NULL,
  220. fk_website_page integer NOT NULL,
  221. import_key varchar(14)
  222. )ENGINE=innodb;
  223. ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_website_page);
  224. ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_categorie (fk_categorie);
  225. ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_website_page);
  226. ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_website_page_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
  227. ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_website_page_website_page_rowid FOREIGN KEY (fk_website_page) REFERENCES llx_website_page (rowid);
  228. ALTER TABLE llx_categorie ADD COLUMN date_creation datetime;
  229. ALTER TABLE llx_categorie ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
  230. ALTER TABLE llx_categorie ADD COLUMN fk_user_creat integer;
  231. ALTER TABLE llx_categorie ADD COLUMN fk_user_modif integer;
  232. ALTER TABLE llx_commandedet ADD CONSTRAINT fk_commandedet_fk_commandefourndet FOREIGN KEY (fk_commandefourndet) REFERENCES llx_commande_fournisseurdet (rowid);
  233. -- VMYSQL4.3 ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN fk_facture INTEGER NULL;
  234. -- VPGSQL8.2 ALTER TABLE llx_prelevement_facture_demande ALTER COLUMN fk_facture DROP NOT NULL;
  235. ALTER TABLE llx_prelevement_facture_demande ADD COLUMN fk_facture_fourn INTEGER NULL;
  236. -- VMYSQL4.3 ALTER TABLE llx_prelevement_facture MODIFY COLUMN fk_facture INTEGER NULL;
  237. -- VPGSQL8.2 ALTER TABLE llx_prelevement_facture ALTER COLUMN fk_facture DROP NOT NULL;
  238. ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL;
  239. ALTER TABLE llx_menu MODIFY COLUMN module varchar(255);
  240. UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG';
  241. ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16) DEFAULT 'UTF-8';
  242. ALTER TABLE llx_adherent_type MODIFY subscription varchar(3) NOT NULL DEFAULT '1';
  243. ALTER TABLE llx_adherent_type MODIFY vote varchar(3) NOT NULL DEFAULT '1';
  244. UPDATE llx_prelevement_facture_demande SET entity = 1 WHERE entity IS NULL;
  245. ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture);
  246. ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn);
  247. insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT Rate 0',1);
  248. insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1);
  249. ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
  250. -- VMYSQL4.3 ALTER TABLE llx_mrp_mo MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
  251. ALTER TABLE llx_commande_fournisseurdet ADD INDEX idx_commande_fournisseurdet_fk_commande (fk_commande);
  252. ALTER TABLE llx_commande_fournisseurdet ADD INDEX idx_commande_fournisseurdet_fk_product (fk_product);
  253. -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode MODIFY COLUMN tracking varchar(255) NULL;
  254. -- VPGSQL8.2 ALTER TABLE llx_c_shipment_mode ALTER COLUMN tracking DROP NOT NULL;
  255. INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (9,'INPERSON', 'In person at your site', NULL, NULL, 0);
  256. INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (10,'FEDEX', 'Fedex', NULL, 'https://www.fedex.com/apps/fedextrack/index.html?tracknumbers={TRACKID}', 0);
  257. INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (11,'TNT', 'TNT', NULL, 'https://www.tnt.com/express/fr_fr/site/outils-expedition/suivi.html?searchType=con&cons=={TRACKID}', 0);
  258. INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (12,'DHL', 'DHL', NULL, 'https://www.dhl.com/fr-fr/home/tracking/tracking-global-forwarding.html?submit=1&tracking-id={TRACKID}', 0);
  259. INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (13,'DPD', 'DPD', NULL, 'https://www.dpd.fr/trace/{TRACKID}', 0);
  260. INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (14,'MAINFREIGHT', 'Mainfreight', NULL, 'https://www.mainfreight.com/track?{TRACKID}', 0);
  261. UPDATE llx_menu SET perms = '$user->rights->societe->creer' WHERE titre = 'MenuNewThirdParty' AND url = '/societe/card.php?mainmenu=companies&action=create';
  262. UPDATE llx_menu SET url = '/societe/list.php?mainmenu=companies&leftmenu=thirdparties' WHERE titre = 'List' AND url = '/societe/list.php?mainmenu=companies&action=create';