I am not that familiar with DBML, so I’ll start from where I enter the picture - the SQL import for PostgreSQL:
CREATE TABLE public.routines (
id uuid DEFAULT gen_random_uuid() NOT NULL
);
CREATE TABLE public.routine_task_templates (
routine_id uuid NOT NULL
);
ALTER TABLE ONLY public.routine_task_templates
ADD CONSTRAINT routine_task_templates_routine_id_fkey FOREIGN KEY (routine_id) REFERENCES public.routines(id) ON DELETE CASCADE;
Importing the given schema above generates this definition:
Table "routine_task_templates" {
"routine_id" uuid [pk, not null]
}
Table "routines" {
"id" uuid [pk, not null, default: `gen_random_uuid()`]
}
Ref "routine_task_templates_routine_id_fkey":"routines"."id" < "routine_task_templates"."routine_id" [delete: cascade]
I would expect the system to report the relation as 1:1 relation, but instead I see the system reporting it as a 1:n relation: