diff --git a/scripts/sql/182_resource_filter_v2.down.sql b/scripts/sql/182_resource_filter_v2.down.sql new file mode 100644 index 0000000000..307fda47cc --- /dev/null +++ b/scripts/sql/182_resource_filter_v2.down.sql @@ -0,0 +1,8 @@ +BEGIN; +-- drop tables +DROP TABLE IF EXISTS resource_filter_audit; +DROP TABLE IF EXISTS resource_filter_evaluation_audit; +-- drop sequences +DROP SEQUENCE IF EXISTS public.resource_filter_audit_seq; +DROP SEQUENCE IF EXISTS public.resource_filter_evaluation_audit_seq; +COMMIT; diff --git a/scripts/sql/182_resource_filter_v2.up.sql b/scripts/sql/182_resource_filter_v2.up.sql new file mode 100644 index 0000000000..573808b75f --- /dev/null +++ b/scripts/sql/182_resource_filter_v2.up.sql @@ -0,0 +1,35 @@ +BEGIN; +-- create resource filter audit table +CREATE SEQUENCE IF NOT EXISTS resource_filter_audit_seq; +CREATE TABLE IF NOT EXISTS "public"."resource_filter_audit" +( + "id" integer not null default nextval('resource_filter_audit_seq' :: regclass), + "target_object" integer NOT NULL, + "conditions" text NOT NULL, + "filter_id" int NOT NULL, + "action" int NOT NULL, + "created_on" timestamptz, + "created_by" integer, + "updated_on" timestamptz, + "updated_by" integer, + CONSTRAINT "resource_filter_audit_filter_id_fkey" FOREIGN KEY ("filter_id") REFERENCES "public"."resource_filter" ("id"), + PRIMARY KEY ("id") + ); + +-- create resource filter evaluation audit table +CREATE SEQUENCE IF NOT EXISTS resource_filter_evaluation_audit_seq; +CREATE TABLE IF NOT EXISTS "public"."resource_filter_evaluation_audit" +( + "id" integer not null default nextval('resource_filter_evaluation_audit_seq' :: regclass), + "reference_type" integer NOT NULL, + "reference_id" integer NOT NULL, + "filter_history_objects" text NOT NULL, + "subject_type" int NOT NULL, + "subject_id" int NOT NULL, + "created_on" timestamptz, + "created_by" integer, + "updated_on" timestamptz, + "updated_by" integer, + PRIMARY KEY ("id") + ); +COMMIT; \ No newline at end of file diff --git a/scripts/sql/182_custom_image_tag.down.sql b/scripts/sql/183_custom_image_tag.down.sql similarity index 100% rename from scripts/sql/182_custom_image_tag.down.sql rename to scripts/sql/183_custom_image_tag.down.sql diff --git a/scripts/sql/182_custom_image_tag.up.sql b/scripts/sql/183_custom_image_tag.up.sql similarity index 100% rename from scripts/sql/182_custom_image_tag.up.sql rename to scripts/sql/183_custom_image_tag.up.sql