Datenbanktabelle und -modelle für CSV-Stammdatenimportprofile
[kivitendo-erp.git] / sql / Pg-upgrade2 / csv_import_profiles.sql
1 -- @tag: csv_import_profiles
2 -- @description: CSV-Import-Profile für Stammdaten
3 -- @depends: release_2_6_1
4 -- @charset: utf-8
5 CREATE TABLE csv_import_profiles (
6        id SERIAL        NOT NULL,
7        name text        NOT NULL,
8        type varchar(20) NOT NULL,
9        is_default boolean DEFAULT FALSE,
10
11        PRIMARY KEY (id),
12        UNIQUE (name)
13 );
14
15 CREATE TABLE csv_import_profile_settings (
16        id SERIAL                     NOT NULL,
17        csv_import_profile_id integer NOT NULL,
18        key text                      NOT NULL,
19        value text,
20
21        PRIMARY KEY (id),
22        FOREIGN KEY (csv_import_profile_id) REFERENCES csv_import_profiles (id),
23        UNIQUE (csv_import_profile_id, key)
24 );