|
| 1 | +CREATE schema IF NOT EXISTS audit_report AUTHORIZATION postgres; |
| 2 | + |
| 3 | +SET search_path TO audit_report; |
| 4 | + |
| 5 | +CREATE TABLE audit_report.ifxpg_generalreport( |
| 6 | + rg_id int4 NOT NULL, |
| 7 | + "schema" varchar(20) NOT NULL, |
| 8 | + report_datetime timestamp NOT NULL, |
| 9 | + table_count_diff int4 NULL, |
| 10 | + pg_table_count int4 NULL, |
| 11 | + ifx_table_count int4 NULL, |
| 12 | + table_name varchar(50) NOT NULL, |
| 13 | + CONSTRAINT ifxpg_genaralreport_pk PRIMARY KEY (rg_id, schema, table_name) |
| 14 | +); |
| 15 | + |
| 16 | +CREATE TABLE audit_report.ifxpg_tblmodreport( |
| 17 | + rg_id int4 NOT NULL, |
| 18 | + "schema" varchar(20) NOT NULL, |
| 19 | + table_name varchar(50) NOT NULL, |
| 20 | + table_count int4 NOT NULL, |
| 21 | + modification_from date NOT NULL, |
| 22 | + "database" varchar(20) NOT NULL, |
| 23 | + report_datetime timestamp NOT NULL, |
| 24 | + CONSTRAINT ifxpg_tblmodreport_pk PRIMARY KEY (rg_id, schema, table_name, database) |
| 25 | +); |
| 26 | + |
| 27 | +CREATE TABLE audit_report.ifxpg_exceptionreport( |
| 28 | + rg_id int4 NOT NULL, |
| 29 | + "schema" varchar(20) NOT NULL, |
| 30 | + exception_table_count int4 NOT NULL, |
| 31 | + report_datetime timestamp NOT NULL, |
| 32 | + CONSTRAINT ifxpg_exceptionreport_pk PRIMARY KEY (rg_id, schema) |
| 33 | +); |
| 34 | + |
| 35 | +CREATE TABLE audit_report.ifxpg_tblexceptionreport( |
| 36 | + rg_id int4 NOT NULL, |
| 37 | + "schema" varchar(20) NOT NULL, |
| 38 | + exception_table_name varchar(50) NOT NULL, |
| 39 | + report_datetime timestamp NOT NULL, |
| 40 | + CONSTRAINT ifxpg_tblexceptionreport_pk PRIMARY KEY (rg_id, schema, exception_table_name) |
| 41 | +); |
| 42 | + |
| 43 | +CREATE SEQUENCE audit_report.report_generation_sequence |
| 44 | + INCREMENT BY 1 |
| 45 | + MINVALUE 1 |
| 46 | + START 1 |
| 47 | + NO CYCLE; |
0 commit comments