Added tests and adjusted code to migrate
Added enders to database migration