DROP TABLE IF EXISTS branches;
DROP TABLE IF EXISTS trees;

CREATE TABLE branches (
    id TEXT PRIMARY KEY NOT NULL,
    parent TEXT NOT NULL,
    content TEXT NOT NULL,
    username TEXT,
    tree TEXT NOT NULL,
    FOREIGN KEY (tree) REFERENCES trees(slug)
);

CREATE TABLE trees (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL,
    slug TEXT NOT NULL UNIQUE
);
