1-- ============================================================================
2-- Copyright (C) 2005		Brice Davoleau		<e1davole@iu-vannes.fr>
3-- Copyright (C) 2005		Matthieu Valleton	<mv@seeschloss.org>
4-- Copyright (C) 2005-2012	Regis Houssin		<regis.houssin@inodbox.com>
5-- Copyright (C) 2017       Laurent Destailleur  <eldy@users.sourceforge.net>
6--
7-- This program is free software; you can redistribute it and/or modify
8-- it under the terms of the GNU General Public License as published by
9-- the Free Software Foundation; either version 3 of the License, or
10-- (at your option) any later version.
11--
12-- This program is distributed in the hope that it will be useful,
13-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15-- GNU General Public License for more details.
16--
17-- You should have received a copy of the GNU General Public License
18-- along with this program. If not, see <https://www.gnu.org/licenses/>.
19--
20-- ============================================================================
21
22create table llx_categorie
23(
24	rowid 		    integer AUTO_INCREMENT PRIMARY KEY,
25	entity          integer DEFAULT 1 NOT NULL,			-- multi company id
26	fk_parent		integer DEFAULT 0 NOT NULL,
27	label 		    varchar(180) NOT NULL,				-- category ref/name
28	ref_ext			varchar(255),						-- reference into an external system (not used by dolibarr)
29	type	        integer DEFAULT 1 NOT NULL,			-- category type (product, supplier, customer, member)
30	description 	text,								-- description of the category
31    color           varchar(8),                         -- color
32	fk_soc          integer DEFAULT NULL,				-- not used by default. Used when option CATEGORY_ASSIGNED_TO_A_CUSTOMER is set.
33	visible         tinyint DEFAULT 1 NOT NULL,			-- determine if the products are visible or not
34    date_creation	datetime,							-- date creation
35    tms     		timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,							-- last modification date
36    fk_user_creat	integer,							-- user making creation
37    fk_user_modif	integer,							-- user making last change
38    import_key      varchar(14)							-- Import key
39)ENGINE=innodb;
40
41--
42-- List of codes for the field type
43--
44-- 0 : product
45-- 1 : supplier
46-- 2 : customer
47--
48