--liquibase formatted sql
--changeset platform:table-ddm_rls_metadata
CREATE TABLE public.ddm_rls_metadata (
    rls_id INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL,
    name TEXT NOT NULL,
    type TEXT NOT NULL,
    jwt_attribute TEXT NOT NULL,
    check_column TEXT NOT NULL,
    check_table TEXT NOT NULL,
    CONSTRAINT pk_ddm_rls_metadata PRIMARY KEY (rls_id)
);

ALTER TABLE public.ddm_rls_metadata ADD CONSTRAINT iu_ddm_rls_metadata_n UNIQUE (name, type);
ALTER TABLE public.ddm_rls_metadata ADD CONSTRAINT iu_ddm_rls_metadata_t UNIQUE (check_table, type);


