sqlite>.schema
CREATE TABLE auditlog (
id INTEGER NOT NULL,
a_uid INTEGER NOT NULL,
a_action VARCHAR(255) NOT NULL,
a_when DATE NOT NULL,
a_previous_entry TEXT,
a_new_entry TEXT,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS "notes" (
id INTEGER NOT NULL,
n_title VARCHAR(128) NOT NULL,
n_note_data TEXT,
n_contact_id INTEGER NOT NULL,
n_event_date DATE NOT NULL,
n_follow_up DATE NOT NULL,
n_status VARCHAR(64) NOT NULL,
n_is_child BOOLEAN DEFAULT FALSE,
n_is_parent BOOLEAN DEFAULT TRUE,
n_parent_id INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(n_parent_id) REFERENCES "notes"(id)
);