-- ===================================================================
-- Copyright (C) 2025 SuperAdmin
--
-- 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/>.
-- ===================================================================

CREATE TABLE llx_importbank_mapping(
    rowid integer AUTO_INCREMENT PRIMARY KEY,
    entity integer DEFAULT 1 NOT NULL,
    name varchar(255) NOT NULL,
    date_column integer NOT NULL,
    label_column integer NOT NULL,
    debit_column integer NOT NULL,
    credit_column integer NOT NULL,
    separator varchar(10) DEFAULT ';',
    decimal_separator varchar(10) DEFAULT ',',
    date_format varchar(20) DEFAULT 'd/m/Y',
    header_lines integer DEFAULT 0,
    active integer DEFAULT 1,
    fk_user integer NOT NULL,
    date_creation datetime NOT NULL,
    tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    UNIQUE INDEX uk_importbank_mapping_name_entity (name, entity)
) ENGINE=innodb;
