Updated models

Changed the database models to utilize foreign keys