Sample Header Ad - 728x90

Location Hierarchy representing production rooms or first-class entity?

0 votes
0 answers
25 views
I'm struggling to figure out the best way to model Production Rooms in our manufacturing ERP app. Currently, we have a Locations model which is a hierarchical, materialized-path (Ancestry Gem) implementation and some of those locations represent the location of the production room for purposes of moving pallets/inventory around. CREATE TABLE public.locations ( id bigint NOT NULL, name character varying, code character varying, description character varying, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, ancestry character varying, depth_inches integer, height_inches integer, width_inches integer, site_id bigint, kind character varying, ancestry_depth integer DEFAULT 0 NOT NULL, is_active boolean DEFAULT true NOT NULL ); Should locations represent the production rooms by having a type column with a value of production_room or should I have a Production Room model/table that references the locations?
Asked by karns (103 rep)
Aug 25, 2025, 01:12 PM