ALTER TABLE
"users"
ALTER TABLE
"public"."users"
ADD
CONSTRAINT "example_fk_1" FOREIGN KEY ("department_id") REFERENCES "departments" ("id") ON
UPDATE
NO ACTION ON DELETE CASCADE
Beekeeper Studio is a free and open source database manager for Windows, Mac, and Linux.
This feature is baked right in, so there's no need to manually type SQL every time. Access foreign key editing by right-clicking on a table in the sidebar and clicking 'View Structure', then click 'Relations'.
Download Beekeeper Studio