440c346108f1993fa19f8484cd03aa45355ef2e0
[kivitendo-erp.git] / sql / Pg-upgrade2 / csv_import_report_cache.sql
1 -- @tag: csv_import_report_cache
2 -- @description: Csv Import Cache
3 -- @depends: csv_import_profiles_2
4 -- @encoding: utf-8
5
6 CREATE TABLE csv_import_reports (
7   id                   SERIAL PRIMARY KEY,
8   session_id           TEXT NOT NULL,
9   profile_id           INTEGER NOT NULL REFERENCES csv_import_profiles(id),
10   type                 TEXT NOT NULL,
11   file                 TEXT NOT NULL
12 );
13
14 CREATE TABLE csv_import_report_rows (
15   id                   SERIAL PRIMARY KEY,
16   csv_import_report_id INTEGER NOT NULL REFERENCES csv_import_reports(id),
17   col                  INTEGER NOT NULL,
18   row                  INTEGER NOT NULL,
19   value                TEXT
20 );
21
22 CREATE TABLE csv_import_report_row_status (
23   id                   SERIAL PRIMARY KEY,
24   csv_import_report_row_id INTEGER NOT NULL REFERENCES csv_import_report_rows(id),
25   type                 TEXT NOT NULL,
26   value                TEXT
27 );
28
29 ALTER TABLE csv_import_profiles DROP constraint "csv_import_profiles_name_key";