CREATE TABLE IF NOT EXISTS public.user_farm
(
    id SERIAL NOT NULL,
    user_id bigint,
    farm_id bigint NOT NULL,
    CONSTRAINT user_farm_pkey PRIMARY KEY (id),
    CONSTRAINT user_farm_user_id_foreign FOREIGN KEY (user_id)
        REFERENCES public.users (id) MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE,
    CONSTRAINT useruser_farm_farm_id_foreign FOREIGN KEY (farm_id)
        REFERENCES public.farms (id) MATCH SIMPLE
        ON UPDATE RESTRICT
        ON DELETE CASCADE
);


insert into groups(id,name, name_en, name_es) values(11,'Cliente Fazenda', 'Farm Client', 'Cliente Hacienda');
