Skip to content

Instantly share code, notes, and snippets.

View mliesenberg's full-sized avatar

Martin Liesenberg mliesenberg

View GitHub Profile
  1. General Background and Overview

Using closure tables to manage hierarchical relations in MySQL

Create DB tables

Create a table to represent tree nodes.

CREATE TABLE `tree_node` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `data_body` text,

node_deleted datetime DEFAULT NULL,