Migrate database on startup