Tables for emailing and asset modules are loaded on module activation
This commit is contained in:
parent
3bc064ac55
commit
52bacbd914
@ -215,6 +215,11 @@ class modAsset extends DolibarrModules
|
||||
*/
|
||||
public function init($options = '')
|
||||
{
|
||||
$result = $this->_load_tables('/install/mysql/tables/', 'asset');
|
||||
if ($result < 0) {
|
||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||
}
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
|
||||
@ -159,6 +159,11 @@ class modMailing extends DolibarrModules
|
||||
*/
|
||||
public function init($options = '')
|
||||
{
|
||||
$result = $this->_load_tables('/install/mysql/tables/', 'mailing');
|
||||
if ($result < 0) {
|
||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||
}
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
|
||||
@ -231,3 +231,10 @@ ALTER TABLE llx_product_attribute_value MODIFY COLUMN ref VARCHAR(180) NOT NULL;
|
||||
ALTER TABLE llx_product_attribute_value MODIFY COLUMN value VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE llx_product_attribute_value ADD COLUMN position INTEGER NOT NULL DEFAULT 0;
|
||||
ALTER TABLE llx_product_attribute CHANGE rang position INTEGER DEFAULT 0 NOT NULL;
|
||||
|
||||
|
||||
ALTER TABLE llx_advtargetemailing RENAME TO llx_mailing_advtarget;
|
||||
|
||||
ALTER TABLE llx_mailing ADD UNIQUE uk_mailing(titre, entity);
|
||||
|
||||
|
||||
|
||||
20
htdocs/install/mysql/tables/llx_mailing-mailing.key.sql
Normal file
20
htdocs/install/mysql/tables/llx_mailing-mailing.key.sql
Normal file
@ -0,0 +1,20 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_mailing ADD UNIQUE uk_mailing(titre, entity);
|
||||
@ -14,4 +14,4 @@
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
ALTER TABLE llx_advtargetemailing ADD UNIQUE INDEX uk_advtargetemailing_name (name);
|
||||
ALTER TABLE llx_mailing_advtarget ADD UNIQUE INDEX uk_advtargetemailing_name (name);
|
||||
@ -17,7 +17,7 @@
|
||||
-- Table to setup advanced targeting for emailing
|
||||
-- ============================================================================
|
||||
|
||||
CREATE TABLE llx_advtargetemailing
|
||||
CREATE TABLE llx_mailing_advtarget
|
||||
(
|
||||
rowid integer NOT NULL auto_increment PRIMARY KEY,
|
||||
name varchar(180) NOT NULL,
|
||||
Loading…
Reference in New Issue
Block a user