1+ BEGIN ;
2+ -- create resource filter audit table
3+ CREATE SEQUENCE IF NOT EXISTS resource_filter_audit_seq;
4+ CREATE TABLE IF NOT EXISTS " public" ." resource_filter_audit"
5+ (
6+ " id" integer not null default nextval(' resource_filter_audit_seq' :: regclass),
7+ " target_object" integer NOT NULL ,
8+ " conditions" text NOT NULL ,
9+ " filter_id" int NOT NULL ,
10+ " action" int NOT NULL ,
11+ " created_on" timestamptz ,
12+ " created_by" integer ,
13+ " updated_on" timestamptz ,
14+ " updated_by" integer ,
15+ CONSTRAINT " resource_filter_audit_filter_id_fkey" FOREIGN KEY (" filter_id" ) REFERENCES " public" ." resource_filter" (" id" ),
16+ PRIMARY KEY (" id" )
17+ );
18+
19+ -- create resource filter evaluation audit table
20+ CREATE SEQUENCE IF NOT EXISTS resource_filter_evaluation_audit_seq;
21+ CREATE TABLE IF NOT EXISTS " public" ." resource_filter_evaluation_audit"
22+ (
23+ " id" integer not null default nextval(' resource_filter_evaluation_audit_seq' :: regclass),
24+ " reference_type" integer NOT NULL ,
25+ " reference_id" integer NOT NULL ,
26+ " filter_history_objects" text NOT NULL ,
27+ " subject_type" int NOT NULL ,
28+ " subject_id" int NOT NULL ,
29+ " created_on" timestamptz ,
30+ " created_by" integer ,
31+ " updated_on" timestamptz ,
32+ " updated_by" integer ,
33+ PRIMARY KEY (" id" )
34+ );
35+ COMMIT ;
0 commit comments