Merge pull request #1445 from KreizIT/dluo_step1
Batch number management step 1 : database modification
This commit is contained in:
commit
82018bf752
26
htdocs/install/mysql/migration/3.5.0-3.6.0.sql
Executable file → Normal file
26
htdocs/install/mysql/migration/3.5.0-3.6.0.sql
Executable file → Normal file
@ -1010,3 +1010,29 @@ create table llx_product_customer_price_log
|
||||
fk_user integer,
|
||||
import_key varchar(14) -- Import key
|
||||
)ENGINE=innodb;
|
||||
|
||||
--Batch number managment
|
||||
ALTER TABLE llx_product ADD COLUMN tobatch tinyint DEFAULT 0 NOT NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `llx_product_batch` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`fk_product_stock` int(11) NOT NULL,
|
||||
`eatby` datetime DEFAULT NULL,
|
||||
`sellby` datetime DEFAULT NULL,
|
||||
`batch` varchar(30) DEFAULT NULL,
|
||||
`qty` double NOT NULL DEFAULT '0',
|
||||
`import_key` varchar(14) DEFAULT NULL,
|
||||
KEY `ix_fk_product_stock` (`fk_product_stock`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `llx_expeditiondet_batch` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`fk_expeditiondet` int(11) NOT NULL,
|
||||
`eatby` date DEFAULT NULL,
|
||||
`sellby` date DEFAULT NULL,
|
||||
`batch` varchar(30) DEFAULT NULL,
|
||||
`qty` double NOT NULL DEFAULT '0',
|
||||
`fk_origin_stock` int(11) NOT NULL,
|
||||
KEY `ix_fk_expeditiondet` (`fk_expeditiondet`)
|
||||
) ENGINE=InnoDB;
|
||||
19
htdocs/install/mysql/tables/llx_expeditiondet_batch.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_expeditiondet_batch.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
--
|
||||
-- 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 <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ============================================================================
|
||||
ALTER TABLE llx_expeditiondet_batch ADD INDEX ix_fk_expeditiondet (fk_expeditiondet);
|
||||
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet (rowid) ON DELETE CASCADE;
|
||||
27
htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
Normal file
27
htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
Normal file
@ -0,0 +1,27 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
--
|
||||
-- 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 <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ============================================================================
|
||||
CREATE TABLE llx_expeditiondet_batch (
|
||||
`rowid` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`fk_expeditiondet` int NOT NULL,
|
||||
`eatby` date DEFAULT NULL,
|
||||
`sellby` date DEFAULT NULL,
|
||||
`batch` varchar(30) DEFAULT NULL,
|
||||
`qty` double NOT NULL DEFAULT '0',
|
||||
`fk_origin_stock` int NOT NULL
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_product_batch.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_product_batch.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
--
|
||||
-- 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 <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ============================================================================
|
||||
ALTER TABLE llx_product_batch ADD INDEX ix_fk_product_stock (fk_product_stock);
|
||||
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid) ON DELETE CASCADE;
|
||||
28
htdocs/install/mysql/tables/llx_product_batch.sql
Normal file
28
htdocs/install/mysql/tables/llx_product_batch.sql
Normal file
@ -0,0 +1,28 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
--
|
||||
-- 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 <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ============================================================================
|
||||
CREATE TABLE `llx_product_batch` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`fk_product_stock` int(11) NOT NULL,
|
||||
`eatby` datetime DEFAULT NULL,
|
||||
`sellby` datetime DEFAULT NULL,
|
||||
`batch` varchar(30) DEFAULT NULL,
|
||||
`qty` double NOT NULL DEFAULT 0,
|
||||
`import_key` varchar(14) DEFAULT NULL
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user