train database setup