From 87ff94fc64a7eacac61fbca7342c213bac3b6205 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Apr 2020 03:59:23 +0200 Subject: [PATCH] Add generic fields --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_categorie.sql | 4 ++++ htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) 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 27f246ad1ee..4fb4fb5c82b 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 @@ -226,3 +226,7 @@ ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_w ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_website_page_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); 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 fk_user_creat integer; +ALTER TABLE llx_categorie ADD COLUMN fk_user_modif integer; diff --git a/htdocs/install/mysql/tables/llx_categorie.sql b/htdocs/install/mysql/tables/llx_categorie.sql index c57c2adaa10..cf1df953ba5 100644 --- a/htdocs/install/mysql/tables/llx_categorie.sql +++ b/htdocs/install/mysql/tables/llx_categorie.sql @@ -31,6 +31,10 @@ create table llx_categorie color varchar(8), -- color 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, -- date modification + fk_user_creat integer, -- user making creation + fk_user_modif integer, -- user making last change import_key varchar(14) -- Import key )ENGINE=innodb; diff --git a/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql b/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql index 882a2b81565..cc9cca0c34a 100644 --- a/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql +++ b/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql @@ -20,9 +20,11 @@ CREATE TABLE llx_mymodule_myobject( entity INTEGER DEFAULT 1 NOT NULL, label VARCHAR(255), qty INTEGER, - status INTEGER, date_creation DATETIME NOT NULL, tms TIMESTAMP, + fk_user_create INTEGER, + fk_user_modif INTEGER, + status INTEGER, import_key VARCHAR(14) -- END MODULEBUILDER FIELDS ) ENGINE=innodb;