diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php
index c17a73dfe12..fd30540c019 100644
--- a/dev/tools/dolibarr-postgres2mysql.php
+++ b/dev/tools/dolibarr-postgres2mysql.php
@@ -357,8 +357,8 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$line = str_replace(" time with time zone", " time", $line);
$line = str_replace(" time without time zone", " time", $line);
- $line = str_replace(" timestamp DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line);
- $line = str_replace(" timestamp without time zone DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line);
+ $line = str_replace(" timestamp DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", $line);
+ $line = str_replace(" timestamp without time zone DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", $line);
if (strstr($line, "auto_increment") || preg_match('/ rowid int/', $line) || preg_match('/ id int/', $line)) {
$field = getfieldname($line);
diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
index b66d205ef40..9bb097d10b2 100644
--- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
+++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
@@ -119,7 +119,7 @@ ALTER TABLE llx_categorie_warehouse ADD CONSTRAINT fk_categorie_warehouse_fk_war
create table llx_holiday_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -135,7 +135,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
create table llx_entrepot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -165,7 +165,7 @@ ALTER TABLE llx_events ADD COLUMN prefix_session varchar(255) NULL;
create table llx_payment_salary_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- salary payment id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -183,8 +183,8 @@ ALTER TABLE llx_oauth_token ADD COLUMN fk_soc integer DEFAULT NULL after token;
ALTER TABLE llx_adherent_type ADD COLUMN duration varchar(6) DEFAULT NULL after morphy;
-ALTER TABLE llx_mailing ADD COLUMN tms timestamp;
-ALTER TABLE llx_mailing_cibles ADD COLUMN tms timestamp;
+ALTER TABLE llx_mailing ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+ALTER TABLE llx_mailing_cibles ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_projet ADD COLUMN usage_opportunity integer DEFAULT 0;
ALTER TABLE llx_projet ADD COLUMN usage_task integer DEFAULT 1;
@@ -458,7 +458,7 @@ create table llx_c_shipment_package_type
CREATE TABLE llx_product_fournisseur_price_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -478,7 +478,7 @@ CREATE TABLE llx_mrp_mo(
note_private text,
date_creation datetime NOT NULL,
date_valid datetime NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
fk_user_valid integer,
@@ -514,7 +514,7 @@ ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_project (fk_project);
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -551,7 +551,7 @@ CREATE TABLE llx_mrp_production(
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
fk_stock_movement integer, -- id of stock movement when movements are validated
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14)
@@ -576,7 +576,7 @@ ALTER TABLE llx_facture_rec MODIFY COLUMN fk_cond_reglement integer NOT NULL DEF
create table llx_commande_fournisseur_dispatch_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -587,7 +587,7 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande
create table llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
index 994e5d89495..488548ae8b1 100644
--- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
+++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
@@ -36,7 +36,7 @@ UPDATE llx_c_units set scale = 86400 where code = 'D' and unit_type = 'time';
create table llx_commande_fournisseur_dispatch_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -57,7 +57,7 @@ create table llx_c_shipment_package_type
create table llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -69,7 +69,7 @@ ALTER TABLE llx_facture_rec MODIFY COLUMN titre varchar(200) NOT NULL;
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -303,7 +303,7 @@ ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_website_page_
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);
ALTER TABLE llx_categorie ADD COLUMN date_creation datetime;
-ALTER TABLE llx_categorie ADD COLUMN tms timestamp;
+ALTER TABLE llx_categorie ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_categorie ADD COLUMN fk_user_creat integer;
ALTER TABLE llx_categorie ADD COLUMN fk_user_modif integer;
diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
index 735ef515dcd..6a34b69d1a2 100644
--- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
+++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
@@ -47,7 +47,7 @@ ALTER TABLE llx_bom_bom_extrafields ADD INDEX idx_bom_bom_extrafields_fk_object
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -124,7 +124,7 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
last_main_doc varchar(255),
@@ -150,7 +150,7 @@ ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN remuneration_sugge
create table llx_recruitment_recruitmentjobposition_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -169,7 +169,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@@ -200,7 +200,7 @@ ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_rec
create table llx_recruitment_recruitmentcandidature_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -290,8 +290,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52);
-ALTER TABLE llx_ecm_directories CHANGE COLUMN date_m tms timestamp;
-ALTER TABLE llx_ecm_files CHANGE COLUMN date_m tms timestamp;
+ALTER TABLE llx_ecm_directories CHANGE COLUMN date_m tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+ALTER TABLE llx_ecm_files CHANGE COLUMN date_m tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,
\n\n__(YourCandidatureAnswer)__
\n
\n__(Sincerely)__
__USER_SIGNATURE__',null, 0);
@@ -337,7 +337,7 @@ ALTER TABLE llx_menu MODIFY COLUMN enabled text;
CREATE TABLE llx_ecm_files_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -347,7 +347,7 @@ ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_ob
CREATE TABLE llx_ecm_directories_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql
index a4ab666299d..4104d74da51 100644
--- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql
+++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql
@@ -419,19 +419,19 @@ update llx_actioncomm set elementtype='order' where elementtype='commande';
update llx_actioncomm set elementtype='contract' where elementtype='contrat';
-alter table llx_propal add column tms timestamp after fk_projet;
+alter table llx_propal add column tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP after fk_projet;
create table llx_product_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL
) ENGINE=innodb;
create table llx_societe_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL
) ENGINE=innodb;
@@ -487,7 +487,7 @@ ALTER TABLE llx_don ADD phone varchar(24) after email;
ALTER TABLE llx_element_element MODIFY sourcetype varchar(32) NOT NULL;
ALTER TABLE llx_element_element MODIFY targettype varchar(32) NOT NULL;
-ALTER TABLE llx_societe_prices MODIFY tms timestamp NULL;
+ALTER TABLE llx_societe_prices MODIFY tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- ALTER TABLE llx_societe_prices ALTER COLUMN tms DROP NOT NULL;
-- Fix: It seems this is missing for some users
diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql
index 044b1652029..c7356cc18ff 100644
--- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql
+++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql
@@ -62,7 +62,7 @@ ALTER TABLE llx_societe MODIFY code_compta varchar(24);
ALTER TABLE llx_societe MODIFY code_compta_fournisseur varchar(24);
-ALTER TABLE llx_chargesociales ADD COLUMN tms timestamp;
+ALTER TABLE llx_chargesociales ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_chargesociales ADD COLUMN date_creation datetime;
ALTER TABLE llx_chargesociales ADD COLUMN date_valid datetime;
@@ -118,7 +118,7 @@ CREATE TABLE llx_localtax
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer NOT NULL DEFAULT '1',
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep date DEFAULT NULL,
datev date DEFAULT NULL,
amount double NOT NULL DEFAULT '0',
diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
index c0efe6d68b3..07b390f32c4 100644
--- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
+++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
@@ -39,7 +39,7 @@ ALTER TABLE llx_societe DROP COLUMN description;
ALTER TABLE llx_societe DROP COLUMN services;
ALTER TABLE llx_societe MODIFY COLUMN ref_ext varchar(128);
-ALTER TABLE llx_bank ADD COLUMN tms timestamp after datec;
+ALTER TABLE llx_bank ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP after datec;
-- Monaco VAT Rates
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27,'19.6','0','VAT standard rate (France hors DOM-TOM)',1);
@@ -267,7 +267,7 @@ ALTER TABLE llx_extrafields ADD COLUMN fieldrequired INTEGER DEFAULT 0;
create table llx_socpeople_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -276,7 +276,7 @@ ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_ob
create table llx_actioncomm_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -835,7 +835,7 @@ CREATE TABLE llx_product_price_by_qty
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_product_price integer NOT NULL,
- date_price timestamp,
+ date_price timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
price double (24,8) DEFAULT 0,
price_ttc double (24,8) DEFAULT 0,
qty_min real DEFAULT 0
@@ -910,7 +910,7 @@ ALTER TABLE llx_bank_account MODIFY COLUMN code_banque varchar(8);
create table llx_user_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- member id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
index 88d9ae1b685..edc2c931ee1 100644
--- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
+++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
@@ -23,7 +23,7 @@ ALTER TABLE llx_menu MODIFY COLUMN leftmenu varchar(100);
create table llx_adherent_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -115,7 +115,7 @@ ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(255) NOT NULL DEFAUL
-- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- VPGSQL8.2 DROP table llx_c_shipment_mode;
--- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(255) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL);
+-- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(255) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL);
-- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (1,'CATCH','Catch','Catch by client','',1);
-- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (2,'TRANS','Transporter','Generic transporter','',1);
-- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi','',0);
@@ -136,7 +136,7 @@ ALTER TABLE llx_stock_mouvement MODIFY COLUMN value real;
create table llx_propal_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -145,7 +145,7 @@ ALTER TABLE llx_propal_extrafields ADD INDEX idx_propal_extrafields (fk_object);
create table llx_facture_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -205,7 +205,7 @@ ALTER TABLE llx_facturedet DROP COLUMN fk_export_compta;
CREATE TABLE llx_cronjob
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
jobtype varchar(10) NOT NULL,
label text NOT NULL,
@@ -249,7 +249,7 @@ DROP TABLE llx_printer_ipp;
CREATE TABLE llx_printer_ipp
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
printer_name text NOT NULL,
printer_location text NOT NULL,
@@ -265,7 +265,7 @@ ALTER TABLE llx_adherent MODIFY COLUMN ref_ext varchar(128);
create table llx_commande_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@@ -299,7 +299,7 @@ ALTER TABLE llx_socpeople CHANGE COLUMN note note_private text;
create table llx_projet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -308,7 +308,7 @@ ALTER TABLE llx_projet_extrafields ADD INDEX idx_projet_extrafields (fk_object);
create table llx_projet_task_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -319,7 +319,7 @@ CREATE TABLE llx_opensurvey_comments (
id_comment INTEGER unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
id_sondage CHAR(16) NOT NULL,
comment text NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
usercomment text
) ENGINE=InnoDB;
@@ -336,7 +336,7 @@ CREATE TABLE llx_opensurvey_sondage (
survey_link_visible integer DEFAULT 1,
canedit integer DEFAULT 0,
origin varchar(64),
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
sujet TEXT
) ENGINE=InnoDB;
CREATE TABLE llx_opensurvey_user_studs (
@@ -344,7 +344,7 @@ CREATE TABLE llx_opensurvey_user_studs (
nom VARCHAR(64) NOT NULL,
id_sondage VARCHAR(16) NOT NULL,
reponses VARCHAR(100) NOT NULL,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN id_sondage_admin CHAR(24);
@@ -367,7 +367,7 @@ UPDATE llx_extrafields SET elementtype='societe' WHERE elementtype='company';
create table llx_commande_fournisseur_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@@ -376,7 +376,7 @@ ALTER TABLE llx_commande_fournisseur_extrafields ADD INDEX idx_commande_fourniss
create table llx_facture_fourn_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
index c6dc0ff9bd7..af3ea13fa5c 100644
--- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
+++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
@@ -43,7 +43,7 @@ ALTER TABLE llx_socpeople ADD COLUMN statut tinyint DEFAULT 1 NOT NULL AFTER imp
create table llx_fichinter_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -55,7 +55,7 @@ ALTER TABLE llx_product ADD COLUMN desiredstock integer DEFAULT 0;
create table llx_commandedet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
)ENGINE=innodb;
@@ -69,7 +69,7 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN info_bits integer DEFAULT 0 after tota
create table llx_facturedet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -79,7 +79,7 @@ ALTER TABLE llx_facturedet_extrafields ADD INDEX idx_facturedet_extrafields (fk_
create table llx_propaldet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -314,7 +314,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
-- Add ref_ext on bordereau_cheque
ALTER TABLE llx_bordereau_cheque ADD ref_ext VARCHAR(255);
-ALTER TABLE llx_bordereau_cheque ADD tms timestamp;
+ALTER TABLE llx_bordereau_cheque ADD tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- Task 1011
@@ -337,7 +337,7 @@ ALTER TABLE llx_contratdet ADD column product_type integer DEFAULT 1 after total
create table llx_contrat_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql
index 5727b946bcb..32ed4c32538 100644
--- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql
+++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql
@@ -74,7 +74,7 @@ ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
--- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
+-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
@@ -108,7 +108,7 @@ create table llx_product_customer_price
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_soc integer NOT NULL,
price double(24,8) DEFAULT 0,
@@ -164,7 +164,7 @@ ALTER TABLE llx_product ADD COLUMN tobatch tinyint DEFAULT 0 NOT NULL;
CREATE TABLE llx_product_batch (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product_stock integer NOT NULL,
eatby datetime DEFAULT NULL,
sellby datetime DEFAULT NULL,
@@ -187,7 +187,7 @@ CREATE TABLE llx_expeditiondet_batch (
--DROP TABLE llx_payment_salary
CREATE TABLE llx_payment_salary (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user integer NOT NULL,
datep date,
datev date,
@@ -229,7 +229,7 @@ ALTER TABLE llx_projet_task_time ADD thm double(24,8) AFTER fk_user;
create table llx_categories_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -283,7 +283,7 @@ CREATE TABLE llx_resource
fk_code_type_resource varchar(32),
note_public text,
note_private text,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_resource ADD INDEX fk_code_type_resource_idx (fk_code_type_resource);
@@ -298,7 +298,7 @@ CREATE TABLE llx_element_resources
busy integer,
mandatory integer,
fk_user_create integer,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_element_resources ADD UNIQUE INDEX idx_element_resources_idx1 (resource_id, resource_type, element_id, element_type);
diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
index 6dc2521ca5d..640f22e4bee 100644
--- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
@@ -137,7 +137,7 @@ DROP TABLE llx_compta_compte_generaux;
-- Align size for accounting account
ALTER TABLE llx_accountingaccount MODIFY COLUMN account_number varchar(32);
ALTER TABLE llx_accountingaccount MODIFY COLUMN account_parent varchar(32);
-ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec;
+ALTER TABLE llx_accountingaccount add column tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER datec;
ALTER TABLE llx_accountingdebcred MODIFY COLUMN account_number varchar(32);
ALTER TABLE llx_bank_account MODIFY COLUMN account_number varchar(32);
ALTER TABLE llx_c_chargesociales MODIFY COLUMN accountancy_code varchar(32);
@@ -233,7 +233,7 @@ create table llx_accounting_fiscalyear
statut tinyint DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer NULL,
fk_user_modif integer NULL
)ENGINE=innodb;
@@ -1050,7 +1050,7 @@ create table llx_c_email_templates
private smallint DEFAULT 0 NOT NULL, -- Template public or private
fk_user integer, -- Id utilisateur si modele prive, sinon null
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(255), -- Label of predefined email
position smallint, -- Position
active tinyint DEFAULT 1 NOT NULL,
@@ -1112,7 +1112,7 @@ ALTER TABLE llx_projet_task MODIFY COLUMN planned_workload real DEFAULT 0 NULL;
CREATE TABLE llx_fichinterdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -1121,7 +1121,7 @@ ALTER TABLE llx_fichinterdet_extrafields ADD INDEX idx_ficheinterdet_extrafields
CREATE TABLE llx_usergroup_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
index ca677fc5224..00bf30f6672 100644
--- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
+++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql
@@ -49,7 +49,7 @@ create table llx_loan
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(80) NOT NULL,
fk_bank integer,
capital real DEFAULT 0 NOT NULL,
@@ -75,7 +75,7 @@ create table llx_payment_loan
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_loan integer,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime,
amount_capital real DEFAULT 0,
amount_insurance real DEFAULT 0,
@@ -145,7 +145,7 @@ ALTER TABLE llx_product ADD COLUMN lifo double(24,8) AFTER fifo;
CREATE TABLE llx_printing
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
printer_name text NOT NULL,
printer_location text NOT NULL,
@@ -177,7 +177,7 @@ DELETE from llx_const where name = 'MAIN_USE_JQUERY_MULTISELECT' and value = '1'
create table llx_bank_account_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -198,7 +198,7 @@ ALTER TABLE llx_bank_account_extrafields ADD INDEX idx_bank_account_extrafields
create table llx_contratdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -210,7 +210,7 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN delivery_time_days integer;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN comment varchar(255);
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN status integer;
-ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN tms timestamp;
+ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN batch varchar(30) DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN eatby date DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN sellby date DEFAULT NULL;
@@ -240,7 +240,7 @@ CREATE TABLE llx_expensereport (
date_approve datetime,
date_refuse datetime,
date_cancel datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer NOT NULL,
fk_user_modif integer DEFAULT NULL,
fk_user_valid integer DEFAULT NULL,
@@ -297,7 +297,7 @@ create table llx_payment_expensereport
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_expensereport integer,
datec datetime, -- date de creation
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount real DEFAULT 0,
fk_typepayment integer NOT NULL,
@@ -316,7 +316,7 @@ ALTER TABLE llx_societe ADD COLUMN name_alias varchar(128) NULL;
create table llx_commande_fournisseurdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@@ -327,7 +327,7 @@ ALTER TABLE llx_commande_fournisseurdet_extrafields ADD INDEX idx_commande_fourn
create table llx_facture_fourn_det_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -357,7 +357,7 @@ CREATE TABLE llx_askpricesupplier (
ref_int varchar(255) DEFAULT NULL,
fk_soc integer DEFAULT NULL,
fk_projet integer DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime DEFAULT NULL,
date_valid datetime DEFAULT NULL,
date_cloture datetime DEFAULT NULL,
@@ -422,14 +422,14 @@ CREATE TABLE llx_askpricesupplierdet (
CREATE TABLE llx_askpricesupplier_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) DEFAULT NULL
) ENGINE=innodb;
CREATE TABLE llx_askpricesupplierdet_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) DEFAULT NULL
) ENGINE=innodb;
@@ -491,7 +491,7 @@ ALTER TABLE llx_don CHANGE COLUMN fk_project fk_projet integer NULL;
create table llx_don_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -503,7 +503,7 @@ create table llx_payment_donation
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_donation integer,
datec datetime, -- date de creation
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount real DEFAULT 0,
fk_typepayment integer NOT NULL,
@@ -585,7 +585,7 @@ CREATE TABLE IF NOT EXISTS llx_propal_merge_pdf_product (
fk_user_author integer DEFAULT NULL,
fk_user_mod integer NOT NULL,
datec datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14) DEFAULT NULL
) ENGINE=InnoDB;
diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
index f749e57b432..363288708d4 100644
--- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
+++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
@@ -146,7 +146,7 @@ CREATE TABLE llx_ecm_files
cover text, -- is this file a file to use for a cover
extraparams varchar(255), -- for stock other parameters with json format
date_c datetime,
- date_m timestamp,
+ date_m timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_c integer,
fk_user_m integer,
acl text -- for future permission 'per file'
@@ -227,7 +227,7 @@ CREATE TABLE IF NOT EXISTS llx_establishment (
fk_user_author integer NOT NULL,
fk_user_mod integer NOT NULL,
datec datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
status smallint DEFAULT 1
) ENGINE=InnoDB;
@@ -236,7 +236,7 @@ CREATE TABLE IF NOT EXISTS llx_user_rib (
fk_user integer NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(30),
bank varchar(255), -- bank name
code_banque varchar(128), -- bank code
@@ -263,7 +263,7 @@ create table llx_stock_lotserial
eatby date DEFAULT NULL, -- Eatby date
sellby date DEFAULT NULL, -- Sellby date
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@@ -282,7 +282,7 @@ create table llx_budget
date_start date,
date_end date,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@@ -296,7 +296,7 @@ create table llx_budget_lines
fk_project_ids varchar(255) NOT NULL, -- List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'.
amount double(24,8) NOT NULL,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@@ -369,7 +369,7 @@ create table llx_categorie_project
create table llx_expedition_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -379,7 +379,7 @@ ALTER TABLE llx_expedition_extrafields ADD INDEX idx_expedition_extrafields (fk_
create table llx_expeditiondet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -392,7 +392,7 @@ ALTER TABLE llx_expeditiondet_extrafields ADD INDEX idx_expeditiondet_extrafield
create table llx_livraison_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -402,7 +402,7 @@ ALTER TABLE llx_livraison_extrafields ADD INDEX idx_livraison_extrafields (fk_ob
create table llx_livraisondet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@@ -595,7 +595,7 @@ insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN doc_ref varchar(300) NOT NULL;
-ALTER TABLE llx_holiday ADD COLUMN tms timestamp;
+ALTER TABLE llx_holiday ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_holiday ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_holiday ADD INDEX idx_holiday_entity (entity);
diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
index 6ec4fc35f92..6bf230df12a 100644
--- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
+++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
@@ -54,7 +54,7 @@ CREATE TABLE llx_product_lot (
eatby date DEFAULT NULL, -- Eatby date
sellby date DEFAULT NULL, -- Sellby date
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@@ -140,7 +140,7 @@ CREATE TABLE llx_website
fk_default_home integer,
date_creation datetime,
date_modification datetime,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_website ADD COLUMN fk_default_home integer;
ALTER TABLE llx_website CHANGE COLUMN shortname ref varchar(24) NOT NULL;
@@ -158,7 +158,7 @@ CREATE TABLE llx_website_page
status integer,
date_creation datetime,
date_modification datetime,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pageurl);
@@ -475,7 +475,7 @@ CREATE TABLE llx_advtargetemailing
fk_user_author integer NOT NULL,
datec datetime NOT NULL,
fk_user_mod integer NOT NULL,
- tms timestamp NOT NULL
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=InnoDB;
ALTER TABLE llx_advtargetemailing ADD UNIQUE INDEX uk_advtargetemailing_name (name);
diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
index 175e03ec179..7578c633be4 100644
--- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
+++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
@@ -114,7 +114,7 @@ ALTER TABLE llx_societe_remise ADD COLUMN entity integer DEFAULT 1 NOT NULL afte
create table llx_expensereport_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -133,7 +133,7 @@ UPDATE llx_adherent_type SET subscription = '1' WHERE subscription = 'yes';
CREATE TABLE llx_product_lot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -145,7 +145,7 @@ ALTER TABLE llx_website_page MODIFY COLUMN content MEDIUMTEXT;
CREATE TABLE llx_product_warehouse_properties
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_entrepot integer NOT NULL,
seuil_stock_alerte integer DEFAULT 0,
@@ -156,7 +156,7 @@ CREATE TABLE llx_product_warehouse_properties
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_creation datetime;
-ALTER TABLE llx_accounting_bookkeeping ADD COLUMN tms timestamp;
+ALTER TABLE llx_accounting_bookkeeping ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- VMYSQL4.3 ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN numero_compte varchar(32) NOT NULL;
-- VMYSQL4.3 ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN code_journal varchar(32) NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_accounting_bookkeeping ALTER COLUMN numero_compte SET NOT NULL;
@@ -186,7 +186,7 @@ ALTER TABLE llx_entrepot ADD COLUMN fk_parent integer DEFAULT 0;
create table llx_resource_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -222,7 +222,7 @@ create table llx_user_employment
ref_ext varchar(50), -- reference into an external system (not used by dolibarr)
fk_user integer,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
job varchar(128), -- job position. may be a dictionary
diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
index b53b25f93b1..87eda0668b1 100644
--- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
+++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
@@ -61,7 +61,7 @@ ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_suppli
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
--- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
+-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN fk_user_creat integer NOT NULL DEFAULT 0;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin;
@@ -160,7 +160,7 @@ ALTER TABLE llx_projet ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_projet_task ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_projet_task_time ADD COLUMN datec date;
-ALTER TABLE llx_projet_task_time ADD COLUMN tms timestamp;
+ALTER TABLE llx_projet_task_time ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_product_price ADD COLUMN fk_multicurrency integer;
ALTER TABLE llx_product_price ADD COLUMN multicurrency_code varchar(255);
@@ -171,12 +171,12 @@ ALTER TABLE llx_product_price ADD COLUMN multicurrency_price_ttc double(24,8) DE
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_creat integer;
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_product_price_by_qty DROP COLUMN date_price;
-ALTER TABLE llx_product_price_by_qty ADD COLUMN tms timestamp;
+ALTER TABLE llx_product_price_by_qty ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_product_price_by_qty ADD COLUMN import_key varchar(14);
ALTER TABLE llx_user ADD COLUMN import_key varchar(14);
-ALTER TABLE llx_facture_rec ADD COLUMN tms timestamp;
+ALTER TABLE llx_facture_rec ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
UPDATE llx_facture_rec SET tms = datec where tms < '2000-01-01';
CREATE TABLE llx_product_attribute
@@ -295,7 +295,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
- tms timestamp, -- | date last modification
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | date last modification
import_key varchar(14),
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib
@@ -391,7 +391,7 @@ ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT '';
CREATE TABLE llx_payment_various
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
datep date,
datev date,
@@ -438,7 +438,7 @@ rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 0,
ref varchar(48),
datec datetime DEFAULT NULL,
-tms timestamp,
+tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer,
fk_user_modif integer,
fk_user_valid integer,
@@ -453,7 +453,7 @@ CREATE TABLE llx_inventorydet
(
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
-tms timestamp,
+tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_inventory integer DEFAULT 0,
fk_warehouse integer DEFAULT 0,
fk_product integer DEFAULT 0,
@@ -467,7 +467,7 @@ new_pmp double DEFAULT 0
)ENGINE=InnoDB;
ALTER TABLE llx_inventory ADD COLUMN datec datetime DEFAULT NULL;
-ALTER TABLE llx_inventory ADD COLUMN tms timestamp;
+ALTER TABLE llx_inventory ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms);
ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec);
@@ -502,7 +502,7 @@ CREATE TABLE llx_loan_schedule
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_loan integer,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime,
amount_capital real DEFAULT 0,
amount_insurance real DEFAULT 0,
@@ -547,7 +547,7 @@ CREATE TABLE llx_website_page
fk_user_create integer,
fk_user_modif integer,
date_creation datetime,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pageurl);
@@ -566,7 +566,7 @@ UPDATE llx_extrafields set elementtype='categorie' where elementtype='categories
CREATE TABLE llx_blockedlog
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
action varchar(50),
amounts real NOT NULL,
signature varchar(100) NOT NULL,
@@ -593,7 +593,7 @@ CREATE TABLE llx_blockedlog_authority
rowid integer AUTO_INCREMENT PRIMARY KEY,
blockchain longtext NOT NULL,
signature varchar(100) NOT NULL,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_blockedlog_authority ADD INDEX signature (signature);
@@ -613,7 +613,7 @@ ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255);
CREATE TABLE llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@@ -623,7 +623,7 @@ ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (f
CREATE TABLE llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
index ff6a1fe03fb..93a7a447c18 100644
--- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
+++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
@@ -265,7 +265,7 @@ ALTER TABLE llx_menu MODIFY fk_leftmenu varchar(100);
CREATE TABLE llx_website_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -285,7 +285,7 @@ CREATE TABLE llx_website_account(
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@@ -307,7 +307,7 @@ ALTER TABLE llx_website_account ADD CONSTRAINT llx_website_account_fk_website FO
CREATE TABLE llx_website_account_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -326,7 +326,7 @@ alter table llx_user add column pass_encoding varchar(24) NULL;
CREATE TABLE IF NOT EXISTS llx_expensereport_ik (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_c_exp_tax_cat integer DEFAULT 0 NOT NULL,
fk_range integer DEFAULT 0 NOT NULL,
coef double DEFAULT 0 NOT NULL,
@@ -441,7 +441,7 @@ INSERT INTO llx_c_exp_tax_range (rowid,fk_c_exp_tax_cat,range_ik, entity, active
CREATE TABLE llx_expensereport_rules (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
dates datetime NOT NULL,
datee datetime NOT NULL,
amount numeric(24,8) NOT NULL,
@@ -464,7 +464,7 @@ ALTER TABLE llx_extrafields ADD COLUMN fk_user_author integer;
ALTER TABLE llx_extrafields ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_extrafields ADD COLUMN datec datetime;
ALTER TABLE llx_extrafields ADD COLUMN enabled varchar(255) DEFAULT '1';
-ALTER TABLE llx_extrafields ADD COLUMN tms timestamp;
+ALTER TABLE llx_extrafields ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- We fix value of 'list' from 0 to 1 for all extrafields created before this migration
--VMYSQL4.1 UPDATE llx_extrafields SET list = 1 WHERE list = 0 AND fk_user_author IS NULL and fk_user_modif IS NULL and datec IS NULL;
@@ -528,7 +528,7 @@ DROP TABLE llx_projet_task_comment;
CREATE TABLE llx_comment (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
description text NOT NULL,
fk_user_author integer DEFAULT NULL,
fk_element integer DEFAULT NULL,
@@ -572,7 +572,7 @@ create table llx_c_email_senderprofile
entity integer DEFAULT 1 NOT NULL, -- multi company id
private smallint DEFAULT 0 NOT NULL, -- Template public or private
date_creation datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(255), -- Label of predefined email
email varchar(255), -- Email
signature text, -- Predefined signature
@@ -655,7 +655,7 @@ create table llx_onlinesignature
object_type varchar(32) NOT NULL,
object_id integer NOT NULL,
datec datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
name varchar(255) NOT NULL,
ip varchar(128),
pathoffile varchar(255)
@@ -709,7 +709,7 @@ ALTER TABLE llx_resource ADD CONSTRAINT fk_resource_fk_country FOREIGN KEY (fk_c
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
index 380c64c28fc..888f4fefdd0 100644
--- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
+++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
@@ -149,7 +149,7 @@ CREATE TABLE llx_societe_remise_supplier
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- creation date
fk_user_author integer, -- creation user
remise_supplier double(6,3) DEFAULT 0 NOT NULL, -- discount
@@ -246,7 +246,7 @@ CREATE TABLE llx_ticket
date_read datetime,
date_close datetime,
notify_tiers_at_create tinyint,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_ticket ADD COLUMN notify_tiers_at_create integer;
@@ -271,7 +271,7 @@ ALTER TABLE llx_ticket_msg ADD CONSTRAINT fk_ticket_msg_fk_track_id FOREIGN KEY
CREATE TABLE llx_ticket_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
)ENGINE=innodb;
@@ -279,7 +279,7 @@ CREATE TABLE llx_ticket_extrafields
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@@ -371,7 +371,7 @@ CREATE TABLE llx_societe_account(
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@@ -433,7 +433,7 @@ CREATE TABLE llx_asset(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@@ -449,7 +449,7 @@ ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_type (fk_asset_type);
create table llx_asset_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@@ -458,7 +458,7 @@ create table llx_asset_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(50) NOT NULL,
accountancy_code_asset varchar(32),
accountancy_code_depreciation_asset varchar(32),
@@ -473,7 +473,7 @@ ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_type FOREIGN KEY (fk_asset_t
create table llx_asset_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
index b7fe131c3f9..36a15d5b85d 100644
--- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
+++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
@@ -43,7 +43,7 @@ ALTER TABLE llx_facture ADD COLUMN pos_source varchar(32);
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@@ -182,7 +182,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@@ -202,7 +202,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter(
type varchar(128) NOT NULL,
rulevalue varchar(128) NULL,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@@ -217,7 +217,7 @@ CREATE TABLE llx_emailcollector_emailcollectoraction(
type varchar(128) NOT NULL,
actionparam varchar(255) NULL,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
position integer DEFAULT 0,
diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
index a56cb45e4fe..b9a406515ec 100644
--- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
+++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
@@ -87,7 +87,7 @@ create table llx_mailing_unsubscribe
unsubscribegroup varchar(128) DEFAULT '',
ip varchar(128),
date_creat datetime, -- creation date
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_mailing_unsubscribe ADD UNIQUE uk_mailing_unsubscribe(email, entity, unsubscribegroup);
@@ -223,7 +223,7 @@ CREATE TABLE llx_bom_bom(
qty double(24,8),
efficiency double(8,4),
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_valid datetime,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
@@ -240,7 +240,7 @@ ALTER TABLE llx_bom_bom ADD COLUMN date_valid datetime;
create table llx_bom_bom_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -266,7 +266,7 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL;
create table llx_bom_bomline_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@@ -335,7 +335,7 @@ UPDATE llx_c_shipment_mode SET label = 'https://www.laposte.fr/outils/suivre-vos
create table llx_reception
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ref varchar(30) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
@@ -383,7 +383,7 @@ ALTER TABLE llx_reception ADD INDEX idx_reception_fk_shipping_method (fk_shippin
create table llx_reception_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_accounting_account.sql b/htdocs/install/mysql/tables/llx_accounting_account.sql
index 7af83585c7f..893cb19d9ab 100644
--- a/htdocs/install/mysql/tables/llx_accounting_account.sql
+++ b/htdocs/install/mysql/tables/llx_accounting_account.sql
@@ -24,7 +24,7 @@ create table llx_accounting_account
rowid bigint AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_pcg_version varchar(32) NOT NULL, -- Chart system
pcg_type varchar(20) NOT NULL, -- First part of Key for predefined groups
account_number varchar(32) NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql
index 906efaae04d..23e7d489e09 100644
--- a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql
+++ b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql
@@ -45,7 +45,7 @@ CREATE TABLE llx_accounting_bookkeeping
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
- tms timestamp, -- | last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | last modification date
fk_user integer NULL, -- The id of user that validate the accounting source document
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib
diff --git a/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql b/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql
index 3357a000406..2b8277c70bd 100644
--- a/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql
+++ b/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql
@@ -44,7 +44,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
- tms timestamp, -- | last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | last modification date
fk_user integer NULL, -- The id of user that validate the accounting source document
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib
diff --git a/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql b/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql
index 90590fb427d..17e9d9dccfb 100644
--- a/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql
+++ b/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql
@@ -25,7 +25,7 @@ create table llx_accounting_fiscalyear
statut tinyint DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer DEFAULT NULL,
fk_user_modif integer DEFAULT NULL
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql
index 6307ba89770..82d97d3ec98 100644
--- a/htdocs/install/mysql/tables/llx_actioncomm.sql
+++ b/htdocs/install/mysql/tables/llx_actioncomm.sql
@@ -33,7 +33,7 @@ create table llx_actioncomm
code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...)
datec datetime, -- date creation
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
fk_user_author integer, -- user id of user that has created record
fk_user_mod integer, -- user id of user that has modified record
diff --git a/htdocs/install/mysql/tables/llx_actioncomm_extrafields.sql b/htdocs/install/mysql/tables/llx_actioncomm_extrafields.sql
index c820feac430..95a415116ab 100644
--- a/htdocs/install/mysql/tables/llx_actioncomm_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_actioncomm_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_actioncomm_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql
index 6713e5abc9d..6b5490b282d 100644
--- a/htdocs/install/mysql/tables/llx_adherent.sql
+++ b/htdocs/install/mysql/tables/llx_adherent.sql
@@ -72,7 +72,7 @@ create table llx_adherent
model_pdf varchar(255),
datevalid datetime, -- date de validation
datec datetime, -- date de creation
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
fk_user_author integer, -- can be null because member can be create by a guest
fk_user_mod integer,
fk_user_valid integer,
diff --git a/htdocs/install/mysql/tables/llx_adherent_extrafields.sql b/htdocs/install/mysql/tables/llx_adherent_extrafields.sql
index 50f47c7954b..6b67944a321 100644
--- a/htdocs/install/mysql/tables/llx_adherent_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_adherent_extrafields.sql
@@ -21,7 +21,7 @@
create table llx_adherent_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- member id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_adherent_type.sql b/htdocs/install/mysql/tables/llx_adherent_type.sql
index 7e9270b89dc..bdce18ef0bc 100644
--- a/htdocs/install/mysql/tables/llx_adherent_type.sql
+++ b/htdocs/install/mysql/tables/llx_adherent_type.sql
@@ -26,7 +26,7 @@ create table llx_adherent_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
statut smallint NOT NULL DEFAULT 0,
libelle varchar(50) NOT NULL,
morphy varchar(3) NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_adherent_type_extrafields.sql b/htdocs/install/mysql/tables/llx_adherent_type_extrafields.sql
index 2950147730b..d13056a2894 100644
--- a/htdocs/install/mysql/tables/llx_adherent_type_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_adherent_type_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_adherent_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_advtargetemailing.sql b/htdocs/install/mysql/tables/llx_advtargetemailing.sql
index 22d49768887..34bd7eb53bf 100644
--- a/htdocs/install/mysql/tables/llx_advtargetemailing.sql
+++ b/htdocs/install/mysql/tables/llx_advtargetemailing.sql
@@ -28,5 +28,5 @@ CREATE TABLE llx_advtargetemailing
fk_user_author integer NOT NULL,
datec datetime NOT NULL,
fk_user_mod integer NOT NULL,
- tms timestamp NOT NULL
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_asset.sql b/htdocs/install/mysql/tables/llx_asset.sql
index b5bb1d1bfe2..52eeda3ba58 100644
--- a/htdocs/install/mysql/tables/llx_asset.sql
+++ b/htdocs/install/mysql/tables/llx_asset.sql
@@ -26,7 +26,7 @@ CREATE TABLE llx_asset(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_asset_extrafields.sql b/htdocs/install/mysql/tables/llx_asset_extrafields.sql
index 364f0e3d08f..c93fac7b20a 100644
--- a/htdocs/install/mysql/tables/llx_asset_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_asset_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_asset_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_asset_type.sql b/htdocs/install/mysql/tables/llx_asset_type.sql
index bd1c300d087..1205acb959b 100644
--- a/htdocs/install/mysql/tables/llx_asset_type.sql
+++ b/htdocs/install/mysql/tables/llx_asset_type.sql
@@ -17,7 +17,7 @@ create table llx_asset_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(50) NOT NULL,
accountancy_code_asset varchar(32),
accountancy_code_depreciation_asset varchar(32),
diff --git a/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql b/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql
index 59ebe94c7d8..7ff09176216 100644
--- a/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_asset_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_bank.sql b/htdocs/install/mysql/tables/llx_bank.sql
index 8dfdba27baa..0e1dbc403da 100644
--- a/htdocs/install/mysql/tables/llx_bank.sql
+++ b/htdocs/install/mysql/tables/llx_bank.sql
@@ -21,7 +21,7 @@ create table llx_bank
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datev date, -- date de valeur
dateo date, -- date operation
amount double(24,8) NOT NULL default 0,
diff --git a/htdocs/install/mysql/tables/llx_bank_account.sql b/htdocs/install/mysql/tables/llx_bank_account.sql
index 28a1a0baf34..4ac90dd961d 100644
--- a/htdocs/install/mysql/tables/llx_bank_account.sql
+++ b/htdocs/install/mysql/tables/llx_bank_account.sql
@@ -26,7 +26,7 @@ create table llx_bank_account
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ref varchar(12) NOT NULL,
label varchar(30) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
diff --git a/htdocs/install/mysql/tables/llx_bank_account_extrafields.sql b/htdocs/install/mysql/tables/llx_bank_account_extrafields.sql
index 5d9d8847154..a30e81ab96c 100644
--- a/htdocs/install/mysql/tables/llx_bank_account_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_bank_account_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_bank_account_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_blockedlog.sql b/htdocs/install/mysql/tables/llx_blockedlog.sql
index 889b28d7a73..f8145718ea6 100644
--- a/htdocs/install/mysql/tables/llx_blockedlog.sql
+++ b/htdocs/install/mysql/tables/llx_blockedlog.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_blockedlog
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
date_creation datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
action varchar(50),
amounts double(24,8) NOT NULL,
element varchar(50),
diff --git a/htdocs/install/mysql/tables/llx_blockedlog_authority.sql b/htdocs/install/mysql/tables/llx_blockedlog_authority.sql
index 9e7dae8f23c..eb491f93af4 100644
--- a/htdocs/install/mysql/tables/llx_blockedlog_authority.sql
+++ b/htdocs/install/mysql/tables/llx_blockedlog_authority.sql
@@ -3,5 +3,5 @@ CREATE TABLE llx_blockedlog_authority
rowid integer AUTO_INCREMENT PRIMARY KEY,
blockchain longtext NOT NULL,
signature varchar(100) NOT NULL,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_bom_bom.sql b/htdocs/install/mysql/tables/llx_bom_bom.sql
index 45c5fce3485..01ec2e63a3e 100644
--- a/htdocs/install/mysql/tables/llx_bom_bom.sql
+++ b/htdocs/install/mysql/tables/llx_bom_bom.sql
@@ -31,7 +31,7 @@ CREATE TABLE llx_bom_bom(
duration double(24,8) DEFAULT NULL,
date_creation datetime NOT NULL,
date_valid datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
fk_user_valid integer,
diff --git a/htdocs/install/mysql/tables/llx_bom_bom_extrafields.sql b/htdocs/install/mysql/tables/llx_bom_bom_extrafields.sql
index 10c44459a8b..15210546fda 100644
--- a/htdocs/install/mysql/tables/llx_bom_bom_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_bom_bom_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_bom_bom_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_bom_bomline_extrafields.sql b/htdocs/install/mysql/tables/llx_bom_bomline_extrafields.sql
index 1b468da3a22..8ed3e96bd11 100644
--- a/htdocs/install/mysql/tables/llx_bom_bomline_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_bom_bomline_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_bom_bomline_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql
index 3050b831eec..9b1d6e24ad4 100644
--- a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql
+++ b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql
@@ -33,7 +33,7 @@ create table llx_bordereau_cheque
fk_bank_account integer,
fk_user_author integer,
statut smallint NOT NULL DEFAULT 0,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
note text,
entity integer DEFAULT 1 NOT NULL -- multi company id
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_boxes_def.sql b/htdocs/install/mysql/tables/llx_boxes_def.sql
index 285bbc22603..fbdf0e3ed36 100644
--- a/htdocs/install/mysql/tables/llx_boxes_def.sql
+++ b/htdocs/install/mysql/tables/llx_boxes_def.sql
@@ -23,6 +23,6 @@ create table llx_boxes_def
rowid integer AUTO_INCREMENT PRIMARY KEY,
file varchar(200) NOT NULL, -- Do not increase this as file+note must be small to allow index
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
note varchar(130) -- Do not increase this as file+note must be small to allow index
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_budget.sql b/htdocs/install/mysql/tables/llx_budget.sql
index d67e65e8f2b..ab9ed79a64a 100644
--- a/htdocs/install/mysql/tables/llx_budget.sql
+++ b/htdocs/install/mysql/tables/llx_budget.sql
@@ -26,7 +26,7 @@ create table llx_budget
date_start date,
date_end date,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
diff --git a/htdocs/install/mysql/tables/llx_budget_lines.sql b/htdocs/install/mysql/tables/llx_budget_lines.sql
index 1397b604316..ffdf33aa38f 100644
--- a/htdocs/install/mysql/tables/llx_budget_lines.sql
+++ b/htdocs/install/mysql/tables/llx_budget_lines.sql
@@ -23,7 +23,7 @@ create table llx_budget_lines
fk_project_ids varchar(180) NOT NULL, -- 'IDS:x,y' = List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'. 'FILTER:ref=*ABC' or 'FILTER:categid=123' = Can also be a dynamic rule to select projects.
amount double(24,8) NOT NULL,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
diff --git a/htdocs/install/mysql/tables/llx_c_email_senderprofile.sql b/htdocs/install/mysql/tables/llx_c_email_senderprofile.sql
index cd81eb4c42a..8b99059acdd 100644
--- a/htdocs/install/mysql/tables/llx_c_email_senderprofile.sql
+++ b/htdocs/install/mysql/tables/llx_c_email_senderprofile.sql
@@ -23,7 +23,7 @@ create table llx_c_email_senderprofile
entity integer DEFAULT 1 NOT NULL, -- multi company id
private smallint DEFAULT 0 NOT NULL, -- Template public (0) or private (id of user)
date_creation datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(255), -- Label of predefined email
email varchar(255) NOT NULL, -- Email
signature text, -- Predefined signature
diff --git a/htdocs/install/mysql/tables/llx_c_email_templates.sql b/htdocs/install/mysql/tables/llx_c_email_templates.sql
index 3fd97fb2804..04130a208fe 100644
--- a/htdocs/install/mysql/tables/llx_c_email_templates.sql
+++ b/htdocs/install/mysql/tables/llx_c_email_templates.sql
@@ -27,7 +27,7 @@ create table llx_c_email_templates
private smallint DEFAULT 0 NOT NULL, -- Template public or private
fk_user integer, -- Id user owner if template is private, or null
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(180), -- Label of predefined email
position smallint, -- Position
enabled varchar(255) DEFAULT '1', -- Condition to have this module visible
diff --git a/htdocs/install/mysql/tables/llx_c_field_list.sql b/htdocs/install/mysql/tables/llx_c_field_list.sql
index c99bfe91690..9177228b363 100644
--- a/htdocs/install/mysql/tables/llx_c_field_list.sql
+++ b/htdocs/install/mysql/tables/llx_c_field_list.sql
@@ -24,7 +24,7 @@
create table llx_c_field_list
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
element varchar(64) NOT NULL, -- name of element list
entity integer DEFAULT 1 NOT NULL, -- entity id
name varchar(32) NOT NULL, -- name of field with table alias (ex: p.ref)
diff --git a/htdocs/install/mysql/tables/llx_c_shipment_mode.sql b/htdocs/install/mysql/tables/llx_c_shipment_mode.sql
index 9adc6b3cb0c..6f49f682f24 100644
--- a/htdocs/install/mysql/tables/llx_c_shipment_mode.sql
+++ b/htdocs/install/mysql/tables/llx_c_shipment_mode.sql
@@ -20,7 +20,7 @@ create table llx_c_shipment_mode
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
code varchar(30) NOT NULL,
libelle varchar(50) NOT NULL,
description text,
diff --git a/htdocs/install/mysql/tables/llx_categorie.sql b/htdocs/install/mysql/tables/llx_categorie.sql
index 09a9ce847b4..29cb5a260e6 100644
--- a/htdocs/install/mysql/tables/llx_categorie.sql
+++ b/htdocs/install/mysql/tables/llx_categorie.sql
@@ -32,7 +32,7 @@ create table llx_categorie
fk_soc integer DEFAULT NULL, -- not used by default. Used when option CATEGORY_ASSIGNED_TO_A_CUSTOMER is set.
visible tinyint DEFAULT 1 NOT NULL, -- determine if the products are visible or not
date_creation datetime, -- date creation
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
fk_user_creat integer, -- user making creation
fk_user_modif integer, -- user making last change
import_key varchar(14) -- Import key
diff --git a/htdocs/install/mysql/tables/llx_categories_extrafields.sql b/htdocs/install/mysql/tables/llx_categories_extrafields.sql
index 8a2a82f7382..82c52f1b7ee 100644
--- a/htdocs/install/mysql/tables/llx_categories_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_categories_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_categories_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_chargesociales.sql b/htdocs/install/mysql/tables/llx_chargesociales.sql
index 57434c93d98..db9e82ac779 100644
--- a/htdocs/install/mysql/tables/llx_chargesociales.sql
+++ b/htdocs/install/mysql/tables/llx_chargesociales.sql
@@ -25,7 +25,7 @@ create table llx_chargesociales
date_ech datetime NOT NULL, -- date echeance
libelle varchar(80) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation
fk_user_author integer, -- user making creation
diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql
index aa237383452..add836ce5d5 100644
--- a/htdocs/install/mysql/tables/llx_commande.sql
+++ b/htdocs/install/mysql/tables/llx_commande.sql
@@ -32,7 +32,7 @@ create table llx_commande
fk_soc integer NOT NULL,
fk_projet integer DEFAULT NULL, -- projet auquel est rattache la commande
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation
date_cloture datetime, -- date de cloture
diff --git a/htdocs/install/mysql/tables/llx_commande_extrafields.sql b/htdocs/install/mysql/tables/llx_commande_extrafields.sql
index e6f3f768489..922bcd820a1 100644
--- a/htdocs/install/mysql/tables/llx_commande_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_commande_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_commande_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql
index bc5cadea228..a9f155a2abb 100644
--- a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql
@@ -32,7 +32,7 @@ create table llx_commande_fournisseur
fk_soc integer NOT NULL,
fk_projet integer DEFAULT 0, -- project id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation
date_approve datetime, -- date de approve
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql
index 22a0e241dd6..b5f85fea250 100644
--- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql
@@ -36,5 +36,5 @@ create table llx_commande_fournisseur_dispatch
sellby date DEFAULT NULL,
status integer,
datec datetime,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch_extrafields.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch_extrafields.sql
index c30cc1c75dd..2c85521ea84 100644
--- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_commande_fournisseur_dispatch_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql
index 6f72a447f10..40c5785dbad 100644
--- a/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_extrafields.sql
@@ -23,7 +23,7 @@
create table llx_commande_fournisseur_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_log.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_log.sql
index 4c576f16f51..c75e9718526 100644
--- a/htdocs/install/mysql/tables/llx_commande_fournisseur_log.sql
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_log.sql
@@ -20,7 +20,7 @@
create table llx_commande_fournisseur_log
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datelog datetime NOT NULL,
fk_commande integer NOT NULL,
fk_statut smallint NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.sql b/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.sql
index 189b4d7d593..cc22da09720 100644
--- a/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseurdet_extrafields.sql
@@ -24,7 +24,7 @@
create table llx_commande_fournisseurdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_commandedet_extrafields.sql b/htdocs/install/mysql/tables/llx_commandedet_extrafields.sql
index 37b7dd6a349..331a3fbe54a 100644
--- a/htdocs/install/mysql/tables/llx_commandedet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_commandedet_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_commandedet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_comment.sql b/htdocs/install/mysql/tables/llx_comment.sql
index 22b2c40b9f1..3e839d83b4c 100644
--- a/htdocs/install/mysql/tables/llx_comment.sql
+++ b/htdocs/install/mysql/tables/llx_comment.sql
@@ -19,7 +19,7 @@
CREATE TABLE llx_comment (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
description text NOT NULL,
fk_user_author integer DEFAULT NULL,
fk_user_modif integer DEFAULT NULL,
diff --git a/htdocs/install/mysql/tables/llx_const.sql b/htdocs/install/mysql/tables/llx_const.sql
index fcca5f57023..96594bb60b4 100644
--- a/htdocs/install/mysql/tables/llx_const.sql
+++ b/htdocs/install/mysql/tables/llx_const.sql
@@ -32,7 +32,7 @@ create table llx_const
type varchar(64) DEFAULT 'string', -- null or 'encrypted' if param has been encrypted
visible tinyint DEFAULT 1 NOT NULL,
note text,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
--
diff --git a/htdocs/install/mysql/tables/llx_contrat.sql b/htdocs/install/mysql/tables/llx_contrat.sql
index fbb36a5674b..dcdc1288d37 100644
--- a/htdocs/install/mysql/tables/llx_contrat.sql
+++ b/htdocs/install/mysql/tables/llx_contrat.sql
@@ -26,7 +26,7 @@ create table llx_contrat
ref_supplier varchar(255), -- supplier contract ref
ref_ext varchar(255), -- external contract ref
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- creation date
date_contrat datetime,
statut smallint DEFAULT 0, -- not used. deprecated
diff --git a/htdocs/install/mysql/tables/llx_contrat_extrafields.sql b/htdocs/install/mysql/tables/llx_contrat_extrafields.sql
index 7ab3dfbbdc9..f93ab94d4ca 100644
--- a/htdocs/install/mysql/tables/llx_contrat_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_contrat_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_contrat_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_contratdet.sql b/htdocs/install/mysql/tables/llx_contratdet.sql
index 4705bbab218..933fc50ec54 100644
--- a/htdocs/install/mysql/tables/llx_contratdet.sql
+++ b/htdocs/install/mysql/tables/llx_contratdet.sql
@@ -20,7 +20,7 @@
create table llx_contratdet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_contrat integer NOT NULL,
fk_product integer NULL, -- doit pouvoir etre nul pour ligne detail sans produits
diff --git a/htdocs/install/mysql/tables/llx_contratdet_extrafields.sql b/htdocs/install/mysql/tables/llx_contratdet_extrafields.sql
index 8933fa66e16..ccd0846e81e 100644
--- a/htdocs/install/mysql/tables/llx_contratdet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_contratdet_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_contratdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_contratdet_log.sql b/htdocs/install/mysql/tables/llx_contratdet_log.sql
index b13791f4832..f52ced561c7 100644
--- a/htdocs/install/mysql/tables/llx_contratdet_log.sql
+++ b/htdocs/install/mysql/tables/llx_contratdet_log.sql
@@ -19,7 +19,7 @@
create table llx_contratdet_log
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_contratdet integer NOT NULL,
date datetime NOT NULL,
statut smallint NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql
index 97057e6f41e..a9aa8960991 100644
--- a/htdocs/install/mysql/tables/llx_cronjob.sql
+++ b/htdocs/install/mysql/tables/llx_cronjob.sql
@@ -21,7 +21,7 @@
CREATE TABLE llx_cronjob
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
jobtype varchar(10) NOT NULL,
label text NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_deplacement.sql b/htdocs/install/mysql/tables/llx_deplacement.sql
index 8b9fa2a04ae..50bfe8d7cfd 100644
--- a/htdocs/install/mysql/tables/llx_deplacement.sql
+++ b/htdocs/install/mysql/tables/llx_deplacement.sql
@@ -24,7 +24,7 @@ create table llx_deplacement
ref varchar(30) DEFAULT NULL, -- Ref donation (TODO change to NOT NULL)
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
dated datetime,
fk_user integer NOT NULL,
fk_user_author integer,
diff --git a/htdocs/install/mysql/tables/llx_don.sql b/htdocs/install/mysql/tables/llx_don.sql
index f03e82d6143..95181a3b30e 100644
--- a/htdocs/install/mysql/tables/llx_don.sql
+++ b/htdocs/install/mysql/tables/llx_don.sql
@@ -25,7 +25,7 @@ create table llx_don
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) DEFAULT NULL, -- Ref donation (TODO change to NOT NULL)
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_statut smallint NOT NULL DEFAULT 0, -- Status of donation promise or validate
datedon datetime, -- Date of the donation/promise
amount double(24,8) DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_don_extrafields.sql b/htdocs/install/mysql/tables/llx_don_extrafields.sql
index bf2b780fcee..a4a560d0f8a 100644
--- a/htdocs/install/mysql/tables/llx_don_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_don_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_don_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.sql b/htdocs/install/mysql/tables/llx_ecm_directories.sql
index 1fa1467e296..a02a72118b2 100644
--- a/htdocs/install/mysql/tables/llx_ecm_directories.sql
+++ b/htdocs/install/mysql/tables/llx_ecm_directories.sql
@@ -30,7 +30,7 @@ CREATE TABLE llx_ecm_directories
fullpath varchar(750),
extraparams varchar(255), -- for stock other parameters with json format
date_c datetime,
- date_m timestamp,
+ date_m timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_c integer,
fk_user_m integer,
acl text
diff --git a/htdocs/install/mysql/tables/llx_ecm_directories_extrafileds.sql b/htdocs/install/mysql/tables/llx_ecm_directories_extrafileds.sql
index e2e496267ba..8bb7d98c592 100644
--- a/htdocs/install/mysql/tables/llx_ecm_directories_extrafileds.sql
+++ b/htdocs/install/mysql/tables/llx_ecm_directories_extrafileds.sql
@@ -19,7 +19,7 @@
CREATE TABLE llx_ecm_directories_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_ecm_files.sql b/htdocs/install/mysql/tables/llx_ecm_files.sql
index c459e2ca219..52521e2af3e 100644
--- a/htdocs/install/mysql/tables/llx_ecm_files.sql
+++ b/htdocs/install/mysql/tables/llx_ecm_files.sql
@@ -35,7 +35,7 @@ CREATE TABLE llx_ecm_files
gen_or_uploaded varchar(12), -- 'generated' or 'uploaded'
extraparams varchar(255), -- for stocking other parameters with json format
date_c datetime,
- date_m timestamp,
+ date_m timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_c integer,
fk_user_m integer,
acl text -- for future permission 'per file'
diff --git a/htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql b/htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql
index 0cf0de6d375..485db3a0f72 100644
--- a/htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql
@@ -19,7 +19,7 @@
CREATE TABLE llx_ecm_files_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_element_resources.sql b/htdocs/install/mysql/tables/llx_element_resources.sql
index 95ee9b5a751..693a2f990f0 100644
--- a/htdocs/install/mysql/tables/llx_element_resources.sql
+++ b/htdocs/install/mysql/tables/llx_element_resources.sql
@@ -28,5 +28,5 @@ CREATE TABLE llx_element_resources
mandatory integer,
duree real, -- total duration of using ressource
fk_user_create integer,
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
index 87581f418e8..389093241ce 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
@@ -35,7 +35,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
index 226f74ce884..c45a3dcd1c4 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectoraction(
type varchar(128) NOT NULL,
actionparam varchar(255) NULL,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
position integer DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
index 5f49227f655..4e708116e21 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter(
type varchar(128) NOT NULL,
rulevalue varchar(128) NULL,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_entrepot.sql b/htdocs/install/mysql/tables/llx_entrepot.sql
index 2cabb457016..2a390f008e2 100644
--- a/htdocs/install/mysql/tables/llx_entrepot.sql
+++ b/htdocs/install/mysql/tables/llx_entrepot.sql
@@ -23,7 +23,7 @@ create table llx_entrepot
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(255) NOT NULL,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
entity integer DEFAULT 1 NOT NULL, -- multi company id
description text,
lieu varchar(64), -- resume lieu situation
diff --git a/htdocs/install/mysql/tables/llx_entrepot_extrafields.sql b/htdocs/install/mysql/tables/llx_entrepot_extrafields.sql
index 9fa75455f19..95a78b4ce6c 100644
--- a/htdocs/install/mysql/tables/llx_entrepot_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_entrepot_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_entrepot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql
index 0d487e94e5f..7159a53059c 100644
--- a/htdocs/install/mysql/tables/llx_establishment.sql
+++ b/htdocs/install/mysql/tables/llx_establishment.sql
@@ -36,7 +36,7 @@ CREATE TABLE llx_establishment (
fk_user_author integer NOT NULL,
fk_user_mod integer,
datec datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL,
status tinyint DEFAULT 1
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_events.sql b/htdocs/install/mysql/tables/llx_events.sql
index e646d32643b..ffa4f1029e7 100644
--- a/htdocs/install/mysql/tables/llx_events.sql
+++ b/htdocs/install/mysql/tables/llx_events.sql
@@ -24,7 +24,7 @@
create table llx_events
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
type varchar(32) NOT NULL, -- action type
entity integer DEFAULT 1 NOT NULL, -- multi company id
prefix_session varchar(255) NULL, -- prefix of session, obtained with dol_getprefix
diff --git a/htdocs/install/mysql/tables/llx_expedition.sql b/htdocs/install/mysql/tables/llx_expedition.sql
index e4c216f3da4..4214fef7f44 100644
--- a/htdocs/install/mysql/tables/llx_expedition.sql
+++ b/htdocs/install/mysql/tables/llx_expedition.sql
@@ -22,7 +22,7 @@
create table llx_expedition
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ref varchar(30) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_expedition_extrafields.sql b/htdocs/install/mysql/tables/llx_expedition_extrafields.sql
index af4228efb41..6b9721a2826 100644
--- a/htdocs/install/mysql/tables/llx_expedition_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_expedition_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_expedition_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_expeditiondet_extrafields.sql b/htdocs/install/mysql/tables/llx_expeditiondet_extrafields.sql
index 112e41e9578..a71b45946a1 100644
--- a/htdocs/install/mysql/tables/llx_expeditiondet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_expeditiondet_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_expeditiondet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_expensereport.sql b/htdocs/install/mysql/tables/llx_expensereport.sql
index a212bc55273..1f13a5a90b5 100644
--- a/htdocs/install/mysql/tables/llx_expensereport.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport.sql
@@ -34,7 +34,7 @@ CREATE TABLE llx_expensereport (
date_approve datetime,
date_refuse datetime,
date_cancel datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer NOT NULL, -- not the user author but the user the expense report is for
fk_user_modif integer DEFAULT NULL,
fk_user_valid integer DEFAULT NULL,
diff --git a/htdocs/install/mysql/tables/llx_expensereport_extrafields.sql b/htdocs/install/mysql/tables/llx_expensereport_extrafields.sql
index 8b6ad4e998f..1e78afb8513 100644
--- a/htdocs/install/mysql/tables/llx_expensereport_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_expensereport_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_expensereport_ik.sql b/htdocs/install/mysql/tables/llx_expensereport_ik.sql
index ddc7fa4d3c7..839fbac8e9a 100644
--- a/htdocs/install/mysql/tables/llx_expensereport_ik.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport_ik.sql
@@ -21,7 +21,7 @@
CREATE TABLE IF NOT EXISTS llx_expensereport_ik (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_c_exp_tax_cat integer DEFAULT 0 NOT NULL,
fk_range integer DEFAULT 0 NOT NULL,
coef double DEFAULT 0 NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_expensereport_rules.sql b/htdocs/install/mysql/tables/llx_expensereport_rules.sql
index 2a10cc24a7d..ae8f9b09496 100644
--- a/htdocs/install/mysql/tables/llx_expensereport_rules.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport_rules.sql
@@ -20,7 +20,7 @@
CREATE TABLE llx_expensereport_rules (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
dates datetime NOT NULL,
datee datetime NOT NULL,
amount double(24,8) NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql
index f10f2600930..1ade8502bf5 100644
--- a/htdocs/install/mysql/tables/llx_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_extrafields.sql
@@ -43,5 +43,5 @@ create table llx_extrafields
fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change
datec datetime, -- date de creation
- tms timestamp -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -- last modification date
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql
index 2c8e1013634..82319a4beef 100644
--- a/htdocs/install/mysql/tables/llx_facture.sql
+++ b/htdocs/install/mysql/tables/llx_facture.sql
@@ -39,7 +39,7 @@ create table llx_facture
datef date, -- date invoice
date_pointoftax date DEFAULT NULL, -- date point of tax (for GB)
date_valid date, -- date validation
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
date_closing datetime, -- date de cloture
paye smallint DEFAULT 0 NOT NULL,
--amount double(24,8) DEFAULT 0 NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_facture_extrafields.sql b/htdocs/install/mysql/tables/llx_facture_extrafields.sql
index 4f7b902c97f..bc826d72ce4 100644
--- a/htdocs/install/mysql/tables/llx_facture_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_facture_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_facture_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_facture_fourn.sql b/htdocs/install/mysql/tables/llx_facture_fourn.sql
index eabf8b1eb27..1d5fdcf13bf 100644
--- a/htdocs/install/mysql/tables/llx_facture_fourn.sql
+++ b/htdocs/install/mysql/tables/llx_facture_fourn.sql
@@ -35,7 +35,7 @@ create table llx_facture_fourn
datef date, -- date de la facture
date_pointoftax date DEFAULT NULL, -- date point of tax (for GB)
date_valid date, -- date validation
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
libelle varchar(255),
paye smallint DEFAULT 0 NOT NULL,
amount double(24,8) DEFAULT 0 NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.sql
index 7be8ff1c552..7fca2588bdf 100644
--- a/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_facture_fourn_det_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_facture_fourn_det_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql b/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql
index 8fb018cbfcc..48556ec6d33 100644
--- a/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_facture_fourn_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql
index d6bda7c4196..0db78d62252 100644
--- a/htdocs/install/mysql/tables/llx_facture_rec.sql
+++ b/htdocs/install/mysql/tables/llx_facture_rec.sql
@@ -26,7 +26,7 @@ create table llx_facture_rec
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
datec datetime, -- date de creation
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
suspended integer DEFAULT 0, -- 1=suspended
diff --git a/htdocs/install/mysql/tables/llx_facture_rec_extrafields.sql b/htdocs/install/mysql/tables/llx_facture_rec_extrafields.sql
index 6895a7e2291..8a51efb2914 100644
--- a/htdocs/install/mysql/tables/llx_facture_rec_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_facture_rec_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_facturedet_extrafields.sql b/htdocs/install/mysql/tables/llx_facturedet_extrafields.sql
index 693abf00001..99f0b87a943 100644
--- a/htdocs/install/mysql/tables/llx_facturedet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_facturedet_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_facturedet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_facturedet_rec_extrafields.sql b/htdocs/install/mysql/tables/llx_facturedet_rec_extrafields.sql
index da2314ecffb..c220a7e0f0f 100644
--- a/htdocs/install/mysql/tables/llx_facturedet_rec_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_facturedet_rec_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_fichinter.sql b/htdocs/install/mysql/tables/llx_fichinter.sql
index e2508c372ca..7c1ef4cf184 100644
--- a/htdocs/install/mysql/tables/llx_fichinter.sql
+++ b/htdocs/install/mysql/tables/llx_fichinter.sql
@@ -26,7 +26,7 @@ create table llx_fichinter
ref varchar(30) NOT NULL, -- number
ref_ext varchar(255),
entity integer DEFAULT 1 NOT NULL, -- multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- date de creation
date_valid datetime, -- date de validation
datei date, -- date de livraison du bon d'intervention
diff --git a/htdocs/install/mysql/tables/llx_fichinter_extrafields.sql b/htdocs/install/mysql/tables/llx_fichinter_extrafields.sql
index 13c7dd15dab..c866669d667 100644
--- a/htdocs/install/mysql/tables/llx_fichinter_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_fichinter_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_fichinter_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_fichinterdet_extrafields.sql b/htdocs/install/mysql/tables/llx_fichinterdet_extrafields.sql
index 65584c02201..f2ced33ec0d 100644
--- a/htdocs/install/mysql/tables/llx_fichinterdet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_fichinterdet_extrafields.sql
@@ -19,7 +19,7 @@
CREATE TABLE llx_fichinterdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_holiday.sql b/htdocs/install/mysql/tables/llx_holiday.sql
index e8116c477a8..3cd5727d867 100644
--- a/htdocs/install/mysql/tables/llx_holiday.sql
+++ b/htdocs/install/mysql/tables/llx_holiday.sql
@@ -42,7 +42,7 @@ fk_user_cancel integer DEFAULT NULL,
detail_refuse varchar( 250 ) DEFAULT NULL,
note_private text,
note_public text,
-tms timestamp,
+tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
)
diff --git a/htdocs/install/mysql/tables/llx_holiday_extrafields.sql b/htdocs/install/mysql/tables/llx_holiday_extrafields.sql
index 29881bbb0cb..8b6e3ef8dc9 100644
--- a/htdocs/install/mysql/tables/llx_holiday_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_holiday_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_holiday_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_inventory.sql b/htdocs/install/mysql/tables/llx_inventory.sql
index 4ccb234e26e..aa35ebb0c42 100644
--- a/htdocs/install/mysql/tables/llx_inventory.sql
+++ b/htdocs/install/mysql/tables/llx_inventory.sql
@@ -23,7 +23,7 @@ CREATE TABLE llx_inventory
entity integer DEFAULT 0,
ref varchar(48),
date_creation datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer, -- user making creation
fk_user_modif integer, -- user making last change
fk_user_valid integer, -- valideur de la fiche
diff --git a/htdocs/install/mysql/tables/llx_inventorydet.sql b/htdocs/install/mysql/tables/llx_inventorydet.sql
index 8c770895194..ce23fe0f749 100644
--- a/htdocs/install/mysql/tables/llx_inventorydet.sql
+++ b/htdocs/install/mysql/tables/llx_inventorydet.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_inventorydet
(
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_inventory integer DEFAULT 0,
fk_warehouse integer DEFAULT 0,
fk_product integer DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_livraison.sql b/htdocs/install/mysql/tables/llx_livraison.sql
index 31af38edfb6..e58e8c3c0bd 100644
--- a/htdocs/install/mysql/tables/llx_livraison.sql
+++ b/htdocs/install/mysql/tables/llx_livraison.sql
@@ -20,7 +20,7 @@
create table llx_livraison
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ref varchar(30) NOT NULL, -- delivery number
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_livraison_extrafields.sql b/htdocs/install/mysql/tables/llx_livraison_extrafields.sql
index 70248d0ceca..d1fc611bfdd 100644
--- a/htdocs/install/mysql/tables/llx_livraison_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_livraison_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_livraison_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_livraisondet_extrafields.sql b/htdocs/install/mysql/tables/llx_livraisondet_extrafields.sql
index cb6300a8ca1..667f66ae0a8 100644
--- a/htdocs/install/mysql/tables/llx_livraisondet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_livraisondet_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_livraisondet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_loan.sql b/htdocs/install/mysql/tables/llx_loan.sql
index a1a187b5ba4..f82597c71c5 100644
--- a/htdocs/install/mysql/tables/llx_loan.sql
+++ b/htdocs/install/mysql/tables/llx_loan.sql
@@ -22,7 +22,7 @@ create table llx_loan
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(80) NOT NULL,
fk_bank integer,
diff --git a/htdocs/install/mysql/tables/llx_loan_schedule.sql b/htdocs/install/mysql/tables/llx_loan_schedule.sql
index e23bc678e71..dd68a426e61 100644
--- a/htdocs/install/mysql/tables/llx_loan_schedule.sql
+++ b/htdocs/install/mysql/tables/llx_loan_schedule.sql
@@ -22,7 +22,7 @@ create table llx_loan_schedule
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_loan integer,
datec datetime, -- creation date
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount_capital double(24,8) DEFAULT 0,
amount_insurance double(24,8) DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_localtax.sql b/htdocs/install/mysql/tables/llx_localtax.sql
index b7aa682567f..b883c710f7b 100644
--- a/htdocs/install/mysql/tables/llx_localtax.sql
+++ b/htdocs/install/mysql/tables/llx_localtax.sql
@@ -22,7 +22,7 @@ create table llx_localtax
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
localtaxtype tinyint,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep date, -- date of payment
datev date, -- date of value
amount double,
diff --git a/htdocs/install/mysql/tables/llx_mailing.sql b/htdocs/install/mysql/tables/llx_mailing.sql
index 8706159ad46..d9fc0832045 100644
--- a/htdocs/install/mysql/tables/llx_mailing.sql
+++ b/htdocs/install/mysql/tables/llx_mailing.sql
@@ -43,7 +43,7 @@ create table llx_mailing
date_valid datetime, --
date_appro datetime, --
date_envoi datetime, -- date d'envoi
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer, -- user creator
fk_user_valid integer, -- user validator
fk_user_appro integer, -- not used
diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.sql
index b523c1d11eb..096142b10ad 100644
--- a/htdocs/install/mysql/tables/llx_mailing_cibles.sql
+++ b/htdocs/install/mysql/tables/llx_mailing_cibles.sql
@@ -34,6 +34,6 @@ create table llx_mailing_cibles
source_id integer,
source_type varchar(16),
date_envoi datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
error_text varchar(255) -- text with error if statut is -1
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_mailing_unsubscribe.sql b/htdocs/install/mysql/tables/llx_mailing_unsubscribe.sql
index 00424256957..543015f5829 100644
--- a/htdocs/install/mysql/tables/llx_mailing_unsubscribe.sql
+++ b/htdocs/install/mysql/tables/llx_mailing_unsubscribe.sql
@@ -26,5 +26,5 @@ create table llx_mailing_unsubscribe
unsubscribegroup varchar(128) DEFAULT '',
ip varchar(128),
date_creat datetime, -- creation date
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql
index 6f908cd5bcf..9cff110981a 100644
--- a/htdocs/install/mysql/tables/llx_menu.sql
+++ b/htdocs/install/mysql/tables/llx_menu.sql
@@ -41,6 +41,6 @@ CREATE TABLE llx_menu
perms text, -- Condition to show enabled or disabled
enabled text NULL, -- Condition to show or hide
usertype integer NOT NULL DEFAULT 0, -- 0 if menu for all users, 1 for external only, 2 for internal only
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_mrp_mo.sql b/htdocs/install/mysql/tables/llx_mrp_mo.sql
index d3aa294104b..de1933ccfed 100644
--- a/htdocs/install/mysql/tables/llx_mrp_mo.sql
+++ b/htdocs/install/mysql/tables/llx_mrp_mo.sql
@@ -27,7 +27,7 @@ CREATE TABLE llx_mrp_mo(
note_private text,
date_creation datetime NOT NULL,
date_valid datetime NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
fk_user_valid integer,
diff --git a/htdocs/install/mysql/tables/llx_mrp_mo_extrafields.sql b/htdocs/install/mysql/tables/llx_mrp_mo_extrafields.sql
index 97eab584cc7..517c269cf0f 100644
--- a/htdocs/install/mysql/tables/llx_mrp_mo_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_mrp_mo_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_mrp_production.sql b/htdocs/install/mysql/tables/llx_mrp_production.sql
index 509d78a5c0e..bd0cd722f1a 100644
--- a/htdocs/install/mysql/tables/llx_mrp_production.sql
+++ b/htdocs/install/mysql/tables/llx_mrp_production.sql
@@ -28,7 +28,7 @@ CREATE TABLE llx_mrp_production(
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
fk_stock_movement integer, -- id of stock movement when movements are validated
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14)
diff --git a/htdocs/install/mysql/tables/llx_notify.sql b/htdocs/install/mysql/tables/llx_notify.sql
index 3ec7d05268e..d2e3bf93076 100644
--- a/htdocs/install/mysql/tables/llx_notify.sql
+++ b/htdocs/install/mysql/tables/llx_notify.sql
@@ -22,7 +22,7 @@
create table llx_notify
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
daten datetime, -- date de la notification
fk_action integer NOT NULL,
fk_soc integer NULL,
diff --git a/htdocs/install/mysql/tables/llx_notify_def.sql b/htdocs/install/mysql/tables/llx_notify_def.sql
index bb516444b04..aed10027347 100644
--- a/htdocs/install/mysql/tables/llx_notify_def.sql
+++ b/htdocs/install/mysql/tables/llx_notify_def.sql
@@ -21,7 +21,7 @@
create table llx_notify_def
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec date, -- date de creation
fk_action integer NOT NULL,
fk_soc integer,
diff --git a/htdocs/install/mysql/tables/llx_online_signatures.sql b/htdocs/install/mysql/tables/llx_online_signatures.sql
index 312cde50671..fbba814dd4d 100644
--- a/htdocs/install/mysql/tables/llx_online_signatures.sql
+++ b/htdocs/install/mysql/tables/llx_online_signatures.sql
@@ -22,7 +22,7 @@ create table llx_onlinesignature
object_type varchar(32) NOT NULL,
object_id integer NOT NULL,
datec datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
name varchar(255) NOT NULL,
ip varchar(128),
pathoffile varchar(255)
diff --git a/htdocs/install/mysql/tables/llx_opensurvey_comments.sql b/htdocs/install/mysql/tables/llx_opensurvey_comments.sql
index 3fcc5a0abf9..52d938b7c47 100644
--- a/htdocs/install/mysql/tables/llx_opensurvey_comments.sql
+++ b/htdocs/install/mysql/tables/llx_opensurvey_comments.sql
@@ -19,7 +19,7 @@ CREATE TABLE llx_opensurvey_comments (
id_comment INTEGER unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
id_sondage CHAR(16) NOT NULL,
comment text NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
usercomment text
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql b/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
index a2ddafa1b54..03ad9b35ec5 100644
--- a/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
+++ b/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
@@ -20,5 +20,5 @@ CREATE TABLE llx_opensurvey_user_studs (
nom VARCHAR(64) NOT NULL,
id_sondage VARCHAR(16) NOT NULL,
reponses VARCHAR(100) NOT NULL, -- Not used for 'F' surveys
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql
index dabe261798b..bbf7d52e6c7 100644
--- a/htdocs/install/mysql/tables/llx_paiement.sql
+++ b/htdocs/install/mysql/tables/llx_paiement.sql
@@ -25,7 +25,7 @@ create table llx_paiement
ref_ext varchar(255) NULL, -- payment external reference
entity integer DEFAULT 1 NOT NULL, -- Multi company id
datec datetime, -- date de creation
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount double(24,8) DEFAULT 0, -- amount paid in Dolibarr currency
multicurrency_amount double(24,8) DEFAULT 0, -- amount paid in invoice currency
diff --git a/htdocs/install/mysql/tables/llx_paiementcharge.sql b/htdocs/install/mysql/tables/llx_paiementcharge.sql
index b489588777a..640f5f0af54 100644
--- a/htdocs/install/mysql/tables/llx_paiementcharge.sql
+++ b/htdocs/install/mysql/tables/llx_paiementcharge.sql
@@ -21,7 +21,7 @@ create table llx_paiementcharge
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_charge integer,
datec datetime, -- date de creation
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount double(24,8) DEFAULT 0,
fk_typepaiement integer NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_paiementfourn.sql b/htdocs/install/mysql/tables/llx_paiementfourn.sql
index 519526f764a..04066435f20 100644
--- a/htdocs/install/mysql/tables/llx_paiementfourn.sql
+++ b/htdocs/install/mysql/tables/llx_paiementfourn.sql
@@ -22,7 +22,7 @@ create table llx_paiementfourn
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30),
entity integer DEFAULT 1,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- date de creation de l'enregistrement
datep datetime, -- date de paiement
amount double(24,8) DEFAULT 0, -- montant
diff --git a/htdocs/install/mysql/tables/llx_payment_donation.sql b/htdocs/install/mysql/tables/llx_payment_donation.sql
index 6573bcb7119..088138bf96f 100644
--- a/htdocs/install/mysql/tables/llx_payment_donation.sql
+++ b/htdocs/install/mysql/tables/llx_payment_donation.sql
@@ -21,7 +21,7 @@ create table llx_payment_donation
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_donation integer,
datec datetime, -- date de creation
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount double(24,8) DEFAULT 0,
fk_typepayment integer NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_payment_expensereport.sql b/htdocs/install/mysql/tables/llx_payment_expensereport.sql
index 8a75bfcdbfd..a83c0c926a4 100644
--- a/htdocs/install/mysql/tables/llx_payment_expensereport.sql
+++ b/htdocs/install/mysql/tables/llx_payment_expensereport.sql
@@ -21,7 +21,7 @@ create table llx_payment_expensereport
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_expensereport integer,
datec datetime, -- date de creation
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount double(24,8) DEFAULT 0,
fk_typepayment integer NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_payment_loan.sql b/htdocs/install/mysql/tables/llx_payment_loan.sql
index a646ba1917b..0e080a1bdb7 100644
--- a/htdocs/install/mysql/tables/llx_payment_loan.sql
+++ b/htdocs/install/mysql/tables/llx_payment_loan.sql
@@ -22,7 +22,7 @@ create table llx_payment_loan
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_loan integer,
datec datetime, -- creation date
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount_capital double(24,8) DEFAULT 0,
amount_insurance double(24,8) DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql
index cc4aaf94ccb..d6ad2ffcfed 100644
--- a/htdocs/install/mysql/tables/llx_payment_salary.sql
+++ b/htdocs/install/mysql/tables/llx_payment_salary.sql
@@ -20,7 +20,7 @@ create table llx_payment_salary
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- Create date
fk_user integer NOT NULL,
datep date, -- payment date
diff --git a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql b/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql
index 3bfed602cff..5f15918ef18 100644
--- a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_payment_salary_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- salary payment id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_payment_various.sql b/htdocs/install/mysql/tables/llx_payment_various.sql
index 4b48c649578..17bbf7c7a16 100644
--- a/htdocs/install/mysql/tables/llx_payment_various.sql
+++ b/htdocs/install/mysql/tables/llx_payment_various.sql
@@ -22,7 +22,7 @@ create table llx_payment_various
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
num_payment varchar(50), -- num cheque or other
label varchar(255),
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- Create date
datep date, -- date de paiement
datev date, -- date de valeur (this field should not be here, only into bank tables)
diff --git a/htdocs/install/mysql/tables/llx_printing.sql b/htdocs/install/mysql/tables/llx_printing.sql
index 0f0c7c71d1b..ecfe050240b 100644
--- a/htdocs/install/mysql/tables/llx_printing.sql
+++ b/htdocs/install/mysql/tables/llx_printing.sql
@@ -20,7 +20,7 @@
CREATE TABLE llx_printing
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
printer_name text NOT NULL,
printer_location text NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql
index 714a342a652..bc583a76ce2 100644
--- a/htdocs/install/mysql/tables/llx_product.sql
+++ b/htdocs/install/mysql/tables/llx_product.sql
@@ -30,7 +30,7 @@ create table llx_product
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_parent integer DEFAULT 0, -- Not used. Used by external modules. Virtual product id
label varchar(255) NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_product_batch.sql b/htdocs/install/mysql/tables/llx_product_batch.sql
index 9b736278e3a..7300c49874f 100644
--- a/htdocs/install/mysql/tables/llx_product_batch.sql
+++ b/htdocs/install/mysql/tables/llx_product_batch.sql
@@ -20,7 +20,7 @@
CREATE TABLE llx_product_batch (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product_stock integer NOT NULL,
eatby datetime DEFAULT NULL, -- deprecated. should not be used here but should be stored into a table llx_product_lot
sellby datetime DEFAULT NULL, -- deprecated. should not be used here but should be stored into a table llx_product_lot
diff --git a/htdocs/install/mysql/tables/llx_product_customer_price.sql b/htdocs/install/mysql/tables/llx_product_customer_price.sql
index c7b6f1eb1a2..7cd481c3c75 100644
--- a/htdocs/install/mysql/tables/llx_product_customer_price.sql
+++ b/htdocs/install/mysql/tables/llx_product_customer_price.sql
@@ -25,7 +25,7 @@ create table llx_product_customer_price
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_soc integer NOT NULL,
price double(24,8) DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_product_extrafields.sql b/htdocs/install/mysql/tables/llx_product_extrafields.sql
index b265340d11c..24e53d9bda6 100644
--- a/htdocs/install/mysql/tables/llx_product_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_product_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_product_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql b/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql
index 7e61a2df6b1..20d4db7492b 100644
--- a/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql
+++ b/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql
@@ -24,7 +24,7 @@ create table llx_product_fournisseur_price
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer,
fk_soc integer,
ref_fourn varchar(30),
diff --git a/htdocs/install/mysql/tables/llx_product_fournisseur_price_extrafields.sql b/htdocs/install/mysql/tables/llx_product_fournisseur_price_extrafields.sql
index 51d5499e825..728915521a7 100644
--- a/htdocs/install/mysql/tables/llx_product_fournisseur_price_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_product_fournisseur_price_extrafields.sql
@@ -18,7 +18,7 @@
Create Table llx_product_fournisseur_price_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/install/mysql/tables/llx_product_lot.sql b/htdocs/install/mysql/tables/llx_product_lot.sql
index 4d59a46c153..86cca7d0f04 100644
--- a/htdocs/install/mysql/tables/llx_product_lot.sql
+++ b/htdocs/install/mysql/tables/llx_product_lot.sql
@@ -25,7 +25,7 @@ CREATE TABLE llx_product_lot (
eatby date DEFAULT NULL, -- Eatby date
sellby date DEFAULT NULL, -- Sellby date
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
diff --git a/htdocs/install/mysql/tables/llx_product_lot_extrafields.sql b/htdocs/install/mysql/tables/llx_product_lot_extrafields.sql
index b3843ed9ba6..8fbbbde1bc5 100644
--- a/htdocs/install/mysql/tables/llx_product_lot_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_product_lot_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_product_lot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_product_price.sql b/htdocs/install/mysql/tables/llx_product_price.sql
index 75a5355afe7..ff862e427e0 100644
--- a/htdocs/install/mysql/tables/llx_product_price.sql
+++ b/htdocs/install/mysql/tables/llx_product_price.sql
@@ -25,7 +25,7 @@ create table llx_product_price
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- Multi company id
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
date_price datetime NOT NULL,
price_level smallint NULL DEFAULT 1,
diff --git a/htdocs/install/mysql/tables/llx_product_price_by_qty.sql b/htdocs/install/mysql/tables/llx_product_price_by_qty.sql
index 7cb8b327b4d..dc3a21bfedb 100644
--- a/htdocs/install/mysql/tables/llx_product_price_by_qty.sql
+++ b/htdocs/install/mysql/tables/llx_product_price_by_qty.sql
@@ -40,6 +40,6 @@ create table llx_product_price_by_qty
multicurrency_price double(24,8) DEFAULT NULL,
multicurrency_price_ttc double(24,8) DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14)
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_product_stock.sql b/htdocs/install/mysql/tables/llx_product_stock.sql
index 586c5b410c7..c5a2f4ad005 100644
--- a/htdocs/install/mysql/tables/llx_product_stock.sql
+++ b/htdocs/install/mysql/tables/llx_product_stock.sql
@@ -21,7 +21,7 @@
create table llx_product_stock
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_entrepot integer NOT NULL,
reel real, -- physical stock
diff --git a/htdocs/install/mysql/tables/llx_product_stock_entrepot.sql b/htdocs/install/mysql/tables/llx_product_stock_entrepot.sql
index 903bd59b524..d6d5e57e549 100644
--- a/htdocs/install/mysql/tables/llx_product_stock_entrepot.sql
+++ b/htdocs/install/mysql/tables/llx_product_stock_entrepot.sql
@@ -21,7 +21,7 @@
create table llx_product_warehouse_properties
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_entrepot integer NOT NULL,
seuil_stock_alerte float DEFAULT '0',
diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql
index f783597653f..a36adb3a672 100644
--- a/htdocs/install/mysql/tables/llx_projet.sql
+++ b/htdocs/install/mysql/tables/llx_projet.sql
@@ -22,7 +22,7 @@ create table llx_projet
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer,
datec datetime, -- date creation project
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
dateo date, -- date start project
datee date, -- date end project
ref varchar(50),
diff --git a/htdocs/install/mysql/tables/llx_projet_extrafields.sql b/htdocs/install/mysql/tables/llx_projet_extrafields.sql
index 8a96a715b05..0001d4e8876 100644
--- a/htdocs/install/mysql/tables/llx_projet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_projet_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_projet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_projet_task.sql b/htdocs/install/mysql/tables/llx_projet_task.sql
index b5cc02e4929..01edb857738 100644
--- a/htdocs/install/mysql/tables/llx_projet_task.sql
+++ b/htdocs/install/mysql/tables/llx_projet_task.sql
@@ -25,7 +25,7 @@ create table llx_projet_task
fk_projet integer NOT NULL,
fk_task_parent integer DEFAULT 0 NOT NULL,
datec datetime, -- date creation
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
dateo datetime, -- date start task
datee datetime, -- date end task
datev datetime, -- date validation
diff --git a/htdocs/install/mysql/tables/llx_projet_task_extrafields.sql b/htdocs/install/mysql/tables/llx_projet_task_extrafields.sql
index 256c9025dc0..bf3d25e6922 100644
--- a/htdocs/install/mysql/tables/llx_projet_task_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_projet_task_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_projet_task_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql
index 8f0f5e663b9..786d8907588 100644
--- a/htdocs/install/mysql/tables/llx_projet_task_time.sql
+++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql
@@ -30,6 +30,6 @@ create table llx_projet_task_time
invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here
import_key varchar(14), -- Import key
datec datetime, -- date creation time
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
note text -- A comment
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql
index d21d9ef2d7e..662db791094 100644
--- a/htdocs/install/mysql/tables/llx_propal.sql
+++ b/htdocs/install/mysql/tables/llx_propal.sql
@@ -32,7 +32,7 @@ create table llx_propal
fk_soc integer,
fk_projet integer DEFAULT NULL, -- projet auquel est rattache la propale
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- date de creation
datep date, -- date de la propal
fin_validite datetime, -- date de fin de validite
diff --git a/htdocs/install/mysql/tables/llx_propal_extrafields.sql b/htdocs/install/mysql/tables/llx_propal_extrafields.sql
index f6ccb68b39b..31201e37b55 100644
--- a/htdocs/install/mysql/tables/llx_propal_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_propal_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_propal_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql
index ff0f44d0280..b599702d560 100644
--- a/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql
+++ b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql
@@ -22,7 +22,7 @@ CREATE TABLE llx_propal_merge_pdf_product (
fk_user_author integer DEFAULT NULL,
fk_user_mod integer NOT NULL,
datec datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14) DEFAULT NULL
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_propaldet_extrafields.sql b/htdocs/install/mysql/tables/llx_propaldet_extrafields.sql
index 74986b1c641..7235d65eccd 100644
--- a/htdocs/install/mysql/tables/llx_propaldet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_propaldet_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_propaldet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_reception.sql b/htdocs/install/mysql/tables/llx_reception.sql
index 05ed6ca4604..71cc000ffc1 100644
--- a/htdocs/install/mysql/tables/llx_reception.sql
+++ b/htdocs/install/mysql/tables/llx_reception.sql
@@ -22,7 +22,7 @@
create table llx_reception
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ref varchar(30) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_reception_extrafields.sql b/htdocs/install/mysql/tables/llx_reception_extrafields.sql
index e2f83794a0b..13d3be5fe77 100644
--- a/htdocs/install/mysql/tables/llx_reception_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_reception_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_reception_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql
index f135c1af72f..ded61d49e8b 100644
--- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql
+++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql
@@ -24,7 +24,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature_extrafields.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature_extrafields.sql
index d0fb92fead9..77cf71b9b00 100644
--- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_recruitment_recruitmentcandidature_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition.sql
index b342156ccd1..4ad1198d808 100644
--- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition.sql
+++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition.sql
@@ -33,7 +33,7 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
last_main_doc varchar(255),
diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition_extrafields.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition_extrafields.sql
index 07ae2ef5153..21b1ec081bf 100644
--- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentjobposition_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_recruitment_recruitmentjobposition_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_resource.sql b/htdocs/install/mysql/tables/llx_resource.sql
index 7dc709ad83a..30bd2bcbbf3 100644
--- a/htdocs/install/mysql/tables/llx_resource.sql
+++ b/htdocs/install/mysql/tables/llx_resource.sql
@@ -34,5 +34,5 @@ CREATE TABLE llx_resource
import_key varchar(14),
extraparams varchar(255), -- for stock other parameters with json format
fk_country integer DEFAULT NULL, -- Optional id of original country
- tms timestamp
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_resource_extrafields.sql b/htdocs/install/mysql/tables/llx_resource_extrafields.sql
index 6e828258339..88bcc7606c8 100644
--- a/htdocs/install/mysql/tables/llx_resource_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_resource_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_resource_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql
index a98be7912f7..88a0fcbda46 100644
--- a/htdocs/install/mysql/tables/llx_societe.sql
+++ b/htdocs/install/mysql/tables/llx_societe.sql
@@ -114,7 +114,7 @@ create table llx_societe
webservices_url varchar(255), -- supplier webservice url
webservices_key varchar(128), -- supplier webservice key
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
datec datetime, -- creation date
fk_user_creat integer NULL, -- utilisateur qui a cree l'info
fk_user_modif integer, -- utilisateur qui a modifie l'info
diff --git a/htdocs/install/mysql/tables/llx_societe_account.sql b/htdocs/install/mysql/tables/llx_societe_account.sql
index 6a78a9a7839..b200d4f3854 100644
--- a/htdocs/install/mysql/tables/llx_societe_account.sql
+++ b/htdocs/install/mysql/tables/llx_societe_account.sql
@@ -33,7 +33,7 @@ CREATE TABLE llx_societe_account(
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_societe_address.sql b/htdocs/install/mysql/tables/llx_societe_address.sql
index e18409fbf51..2b5f2d57146 100644
--- a/htdocs/install/mysql/tables/llx_societe_address.sql
+++ b/htdocs/install/mysql/tables/llx_societe_address.sql
@@ -21,7 +21,7 @@ create table llx_societe_address
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime, -- creation date
- tms timestamp, -- last modification date
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
label varchar(30), --
fk_soc integer DEFAULT 0, --
name varchar(60), -- company name
diff --git a/htdocs/install/mysql/tables/llx_societe_extrafields.sql b/htdocs/install/mysql/tables/llx_societe_extrafields.sql
index e277db15821..a4b5b269358 100644
--- a/htdocs/install/mysql/tables/llx_societe_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_societe_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_societe_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_societe_prices.sql b/htdocs/install/mysql/tables/llx_societe_prices.sql
index 2b88340e611..2e9178774f5 100644
--- a/htdocs/install/mysql/tables/llx_societe_prices.sql
+++ b/htdocs/install/mysql/tables/llx_societe_prices.sql
@@ -20,7 +20,7 @@ create table llx_societe_prices
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer DEFAULT 0,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
fk_user_author integer,
price_level tinyint DEFAULT 1
diff --git a/htdocs/install/mysql/tables/llx_societe_remise.sql b/htdocs/install/mysql/tables/llx_societe_remise.sql
index a3a265cce5f..2d4e3a9c258 100644
--- a/htdocs/install/mysql/tables/llx_societe_remise.sql
+++ b/htdocs/install/mysql/tables/llx_societe_remise.sql
@@ -24,7 +24,7 @@ create table llx_societe_remise
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- creation date
fk_user_author integer, -- creation user
remise_client double(6,3) DEFAULT 0 NOT NULL, -- discount
diff --git a/htdocs/install/mysql/tables/llx_societe_remise_supplier.sql b/htdocs/install/mysql/tables/llx_societe_remise_supplier.sql
index 3786b16b76a..d6dfdc20d9d 100644
--- a/htdocs/install/mysql/tables/llx_societe_remise_supplier.sql
+++ b/htdocs/install/mysql/tables/llx_societe_remise_supplier.sql
@@ -24,7 +24,7 @@ create table llx_societe_remise_supplier
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- creation date
fk_user_author integer, -- creation user
remise_supplier double(6,3) DEFAULT 0 NOT NULL, -- discount
diff --git a/htdocs/install/mysql/tables/llx_societe_rib.sql b/htdocs/install/mysql/tables/llx_societe_rib.sql
index 7d00d9fb1dd..ece4b2edffe 100644
--- a/htdocs/install/mysql/tables/llx_societe_rib.sql
+++ b/htdocs/install/mysql/tables/llx_societe_rib.sql
@@ -27,7 +27,7 @@ create table llx_societe_rib
label varchar(200),
fk_soc integer NOT NULL,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- For BAN
bank varchar(255), -- bank name
diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql
index 2a1b551beb9..decc229e3e7 100644
--- a/htdocs/install/mysql/tables/llx_socpeople.sql
+++ b/htdocs/install/mysql/tables/llx_socpeople.sql
@@ -23,7 +23,7 @@ create table llx_socpeople
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_soc integer, -- lien vers la societe
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
diff --git a/htdocs/install/mysql/tables/llx_socpeople_extrafields.sql b/htdocs/install/mysql/tables/llx_socpeople_extrafields.sql
index 66220ce7e98..f2f594e12f3 100644
--- a/htdocs/install/mysql/tables/llx_socpeople_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_socpeople_extrafields.sql
@@ -19,7 +19,7 @@
create table llx_socpeople_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_stock_mouvement.sql b/htdocs/install/mysql/tables/llx_stock_mouvement.sql
index 94501a516dd..2cd094c1b05 100644
--- a/htdocs/install/mysql/tables/llx_stock_mouvement.sql
+++ b/htdocs/install/mysql/tables/llx_stock_mouvement.sql
@@ -20,7 +20,7 @@
create table llx_stock_mouvement
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datem datetime, -- Date and hour of movement
fk_product integer NOT NULL, -- Id of product
batch varchar(128) DEFAULT NULL, -- Lot or serial number
diff --git a/htdocs/install/mysql/tables/llx_subscription.sql b/htdocs/install/mysql/tables/llx_subscription.sql
index 03d24c68f6e..8e86e216d3f 100644
--- a/htdocs/install/mysql/tables/llx_subscription.sql
+++ b/htdocs/install/mysql/tables/llx_subscription.sql
@@ -19,7 +19,7 @@
create table llx_subscription
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
fk_adherent integer,
fk_type integer,
diff --git a/htdocs/install/mysql/tables/llx_supplier_proposal.sql b/htdocs/install/mysql/tables/llx_supplier_proposal.sql
index 5e7393112d8..e63c4ff64c7 100644
--- a/htdocs/install/mysql/tables/llx_supplier_proposal.sql
+++ b/htdocs/install/mysql/tables/llx_supplier_proposal.sql
@@ -23,7 +23,7 @@ CREATE TABLE llx_supplier_proposal (
ref_int varchar(255) DEFAULT NULL,
fk_soc integer DEFAULT NULL,
fk_projet integer DEFAULT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime DEFAULT NULL,
date_valid datetime DEFAULT NULL,
date_cloture datetime DEFAULT NULL,
diff --git a/htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.sql b/htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.sql
index a13c74d0d04..8dfed18bbbc 100644
--- a/htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.sql
@@ -17,7 +17,7 @@
CREATE TABLE llx_supplier_proposal_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) DEFAULT NULL
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.sql b/htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.sql
index 0501aecc68b..df6b5216c21 100644
--- a/htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.sql
@@ -17,7 +17,7 @@
CREATE TABLE llx_supplier_proposaldet_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) DEFAULT NULL
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_ticket.sql b/htdocs/install/mysql/tables/llx_ticket.sql
index 4440bce5cec..c053e787dfa 100644
--- a/htdocs/install/mysql/tables/llx_ticket.sql
+++ b/htdocs/install/mysql/tables/llx_ticket.sql
@@ -39,6 +39,6 @@ CREATE TABLE llx_ticket
date_close datetime,
notify_tiers_at_create tinyint,
email_msgid varchar(255), -- if ticket is created by email collector, we store here MSG ID
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14)
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_ticket_extrafields.sql b/htdocs/install/mysql/tables/llx_ticket_extrafields.sql
index 538da09692e..31f82064461 100644
--- a/htdocs/install/mysql/tables/llx_ticket_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_ticket_extrafields.sql
@@ -18,7 +18,7 @@
create table llx_ticket_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- ticket id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_tva.sql b/htdocs/install/mysql/tables/llx_tva.sql
index 2804d410e7d..6cf97e6b4c6 100644
--- a/htdocs/install/mysql/tables/llx_tva.sql
+++ b/htdocs/install/mysql/tables/llx_tva.sql
@@ -20,7 +20,7 @@
create table llx_tva
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- Create date
datep date, -- date de paiement
datev date, -- date de valeur
diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql
index b49feba85d6..c734192ad64 100644
--- a/htdocs/install/mysql/tables/llx_user.sql
+++ b/htdocs/install/mysql/tables/llx_user.sql
@@ -29,7 +29,7 @@ create table llx_user
fk_establishment integer DEFAULT 0,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
login varchar(50) NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_user_employment.sql b/htdocs/install/mysql/tables/llx_user_employment.sql
index ff2a87028d4..c06df0189d2 100644
--- a/htdocs/install/mysql/tables/llx_user_employment.sql
+++ b/htdocs/install/mysql/tables/llx_user_employment.sql
@@ -25,7 +25,7 @@ create table llx_user_employment
ref_ext varchar(50), -- reference into an external system (not used by dolibarr)
fk_user integer,
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
job varchar(128), -- job position. may be a dictionary
diff --git a/htdocs/install/mysql/tables/llx_user_extrafields.sql b/htdocs/install/mysql/tables/llx_user_extrafields.sql
index b7ba9116630..c38e9435a63 100644
--- a/htdocs/install/mysql/tables/llx_user_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_user_extrafields.sql
@@ -21,7 +21,7 @@
create table llx_user_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- member id
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_user_rib.sql b/htdocs/install/mysql/tables/llx_user_rib.sql
index 1349e77a77b..4463a1f6f2b 100644
--- a/htdocs/install/mysql/tables/llx_user_rib.sql
+++ b/htdocs/install/mysql/tables/llx_user_rib.sql
@@ -22,7 +22,7 @@ create table llx_user_rib
fk_user integer NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(30),
bank varchar(255), -- bank name
code_banque varchar(128), -- bank code
diff --git a/htdocs/install/mysql/tables/llx_usergroup.sql b/htdocs/install/mysql/tables/llx_usergroup.sql
index 43bbba9dbb1..959dfbca3d9 100644
--- a/htdocs/install/mysql/tables/llx_usergroup.sql
+++ b/htdocs/install/mysql/tables/llx_usergroup.sql
@@ -24,7 +24,7 @@ create table llx_usergroup
nom varchar(180) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
note text,
model_pdf varchar(255) DEFAULT NULL
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql b/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql
index e2e96f142d9..ea358509eff 100644
--- a/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql
@@ -18,7 +18,7 @@
CREATE TABLE llx_usergroup_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_website.sql b/htdocs/install/mysql/tables/llx_website.sql
index 717052f795c..b2103177972 100644
--- a/htdocs/install/mysql/tables/llx_website.sql
+++ b/htdocs/install/mysql/tables/llx_website.sql
@@ -36,6 +36,6 @@ CREATE TABLE llx_website
fk_user_modif integer,
date_creation datetime,
position integer DEFAULT 0,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_website_extrafields.sql b/htdocs/install/mysql/tables/llx_website_extrafields.sql
index ff39e2c51c4..b3fd6786a09 100644
--- a/htdocs/install/mysql/tables/llx_website_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_website_extrafields.sql
@@ -16,7 +16,7 @@
CREATE TABLE llx_website_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql
index e2bec4a8a24..4b1b3045d6b 100644
--- a/htdocs/install/mysql/tables/llx_website_page.sql
+++ b/htdocs/install/mysql/tables/llx_website_page.sql
@@ -38,7 +38,7 @@ CREATE TABLE llx_website_page
fk_user_modif integer,
author_alias varchar(64),
date_creation datetime,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14), -- import key
object_type varchar(255),
fk_object varchar(255)
diff --git a/htdocs/install/mysql/tables/llx_zapier_hook.sql b/htdocs/install/mysql/tables/llx_zapier_hook.sql
index b5bcc15123a..b54fbc0d348 100644
--- a/htdocs/install/mysql/tables/llx_zapier_hook.sql
+++ b/htdocs/install/mysql/tables/llx_zapier_hook.sql
@@ -24,6 +24,6 @@ CREATE TABLE llx_zapier_hook(
status integer,
date_creation datetime NOT NULL,
fk_user integer NOT NULL,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14)
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_zapier_hook_extrafields.sql b/htdocs/install/mysql/tables/llx_zapier_hook_extrafields.sql
index 09fef4cc399..0b4f6e97238 100644
--- a/htdocs/install/mysql/tables/llx_zapier_hook_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_zapier_hook_extrafields.sql
@@ -16,7 +16,7 @@
create table llx_zapier_hook_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- tms timestamp,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;