-- Create ohs_fault_trees table
CREATE TABLE ohs_fault_trees (
    id SERIAL PRIMARY KEY,
    incident_id INTEGER NOT NULL,
    tree_data jsonb DEFAULT NULL,
    tenant_id INTEGER DEFAULT NULL,
    branch_id INTEGER DEFAULT NULL,
    isDeleted BOOLEAN NOT NULL DEFAULT FALSE,
    updatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX ohs_fault_trees_tenant_idx ON ohs_fault_trees (tenant_id);
CREATE INDEX ohs_fault_trees_branch_idx ON ohs_fault_trees (branch_id);
