llx_product_lot.sql 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. -- ============================================================================
  2. -- Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
  3. --
  4. -- This program is free software; you can redistribute it and/or modify
  5. -- it under the terms of the GNU General Public License as published by
  6. -- the Free Software Foundation; either version 3 of the License, or
  7. -- (at your option) any later version.
  8. --
  9. -- This program is distributed in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. -- GNU General Public License for more details.
  13. --
  14. -- You should have received a copy of the GNU General Public License
  15. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. --
  17. -- This table is dedicated to store lots with detail of each lot. Key is fk_product-batch is unique.
  18. -- ============================================================================
  19. CREATE TABLE llx_product_lot (
  20. rowid integer AUTO_INCREMENT PRIMARY KEY,
  21. entity integer DEFAULT 1,
  22. fk_product integer NOT NULL, -- Id of product
  23. batch varchar(128) DEFAULT NULL, -- Lot or serial number
  24. note_public text DEFAULT NULL,
  25. note_private text DEFAULT NULL,
  26. eatby date DEFAULT NULL, -- Eatby date
  27. sellby date DEFAULT NULL, -- Sellby date
  28. eol_date datetime NULL,
  29. manufacturing_date datetime NULL, -- date when first manufacturing of this lot has started
  30. scrapping_date datetime NULL, -- date when we decided to scrap all products of this lot
  31. barcode varchar(180) DEFAULT NULL, -- barcode
  32. fk_barcode_type integer DEFAULT NULL, -- barcode type
  33. datec datetime,
  34. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  35. fk_user_creat integer,
  36. fk_user_modif integer,
  37. import_key integer
  38. ) ENGINE=innodb;