DROP TABLE IF EXISTS branches; DROP TABLE IF EXISTS trees; CREATE TABLE branches ( id INTEGER PRIMARY KEY AUTOINCREMENT, branch TEXT NOT NULL, content TEXT NOT NULL, parent 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 );