Changed primary key to serial, added foreign key, updated stored proc