use t.reference instead t.intger

also should we add indexes?