-- Planning Workstation Groups — managed list of board section groups
-- Each workstation can belong to one group (via fk_pl_group in extrafields).
-- Groups have a sort_order that controls section order on the board.

SET NAMES utf8mb4;

CREATE TABLE IF NOT EXISTS llx_planning_ws_group (
    rowid       INT UNSIGNED NOT NULL AUTO_INCREMENT,
    name        VARCHAR(64)  NOT NULL,              -- display name: "Forming", "Trimming", …
    sort_order  INT          NOT NULL DEFAULT 0,   -- lower = displayed first on board
    entity      INT          NOT NULL DEFAULT 1,
    PRIMARY KEY (rowid),
    UNIQUE KEY uq_planning_ws_group_name (name, entity)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
