I have the permissions table in postgres table
CREATE TABLE public.permissions
(
permission_id integer NOT NULL,
crud_signature text COLLATE pg_catalog."default" NOT NULL,
object_id uuid NOT NULL,
object_type text COLLATE pg_catalog."default" NOT NULL,
include_subcategories boolean NOT NULL,
CONSTRAINT permissions_pkey PRIMARY KEY (permission_id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.permissions
OWNER to postgres;
and have ROLES table. Each role has multiple permission.
CREATE TABLE public.roles
(
role_id integer NOT NULL,
role_name text COLLATE pg_catalog."default" NOT NULL,
role_description text COLLATE pg_catalog."default",
permissions integer[],
CONSTRAINT roles_pkey PRIMARY KEY (role_id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.roles OWNER to postgres;
When I try to make a foreign keys column like permissions of type integer[] Posgres gives me an error that theese fields have incompartables types - integer and integer[]
What should I do?