The ups and downs of gentrification have been chronicled thoroughly, but one of its consequences hasn’t been widely addressed: the effect on neighborhood schools when a critical mass of well-educated, well-off people move in. Gentrification usually brings some benefits with it to a neighborhood, such as more attention from the city—as Spike Lee noted, suddenly the trash gets picked up! But does an influx of children from wealthier families make a positive difference to local public schools?

Nikole Hannah-Jones, now an investigative reporter for The New York Times Magazine, says no. She makes the case in Grist that “gentrification, it turns out, usually stops at the schoolhouse door.” Because newcomers tend to send their kids outside of the local system, often to private or charter schools, gentrification tends to have a neutral or even negative effect on neighborhood schools, at least in the short term.

A recent article in U.S. News concurs with this assessment, claiming that “gentrification is leaving public schools behind.” Likewise, a report on underperforming San Francisco public schools from earlier this summer in The Atlantic notes that many if not most urban institutions are “left to flounder,” remaining segregated, low-quality “Apartheid schools,” even while gentrification changes other aspects of the neighborhoods around them.

The exceptions—the public schools in gentrifying neighborhoods that happen to be doing well according to official rankings—seem to be those that compete with charter and private schools by becoming magnet schools or starting gifted-and-talented programs. Brooklyn’s PS 8, for instance, was “failing” only 10 years ago, but after remaking itself as a magnet school has become one of the borough’s most sought-after elementary schools. Likewise, PS 9 recently added gifted-and-talented and foreign-language programs. It now has an above-average proportion of white students relative to its district, and there is a waitlist for its Pre-K program.

These beefed-up programs, Hannah-Jones points out, come at a cost: Any money put toward enticing middle-class parents is money that can’t be put toward students who might need those resources more. And most minority students continue to struggle: The New York Daily News reports that “more than 50 percent of the city’s white and Asian school kids in grades 3 through 8 passed this year’s state English tests. Fewer than 20 percent of the city’s black and Latino kids did.”

Economic and racial integration works: It is what has been shown to help higher-need students without hurting others. Middle-class commitment to urban schools is one way to improve public education for all, and middle-class gentrifiers have placed themselves right where they can do the most good—if they choose to. And yet, it might be unreasonable to expect high-achieving, usually college-educated newcomers, even progressive ones, to stop fretting about sending their children to the “best,” which is to say, highest-performing, schools. Test scores are a matter of overwhelming importance to these parents, no matter how much they may also protest “high-stakes testing.” How, then, can middle-class gentrifiers be wooed into participating in a system that might not appear to be in their immediate best interest?

Sarah Garland of The Hechinger Report suggests that the best way to have gentrification help local schools may be to invest in more and larger magnet schools and bring more diverse students into gifted-and-talented programs. One county in Florida has had success doing just that, finding remarkably talented kids in poor neighborhoods that school administrators had, up until now, neglected.

Even the few successfully integrated public elementary schools might not make a long-term difference, though. Middle schools present yet another challenge. As Garland told me, “Sometimes white and Asian middle-class parents will send their kids to a local elementary school in the early grades and then pull them out when they get older.” She added that “housing and transportation departments can help or hinder efforts to keep communities and schools integrated, and without more coherent policy efforts, gentrification may only make a fleeting difference.” In other words, the burden cannot rest on the shoulders of individual gentrifying parents, who may want to do “right” thing and, at the same time, feel compelled to provide their children with the highest-quality education possible. Local governments need to prioritize better-integrated schools for everyone.

Is that feasible? A recent episode of This American Life documented that it can be. The show focused on how Hartford, Connecticut, which remains mostly ungentrified, has focused successfully on exactly that kind of coherent policy effort, creating dozens of urban magnet schools that are so strong they manage to attract students who live outside the city. Nearly half of Hartford’s students now benefit from integrated K-12 education. Though not a panacea, it is a significant step forward.

How exactly did Hartford do it? The city persuaded patrons to buy in. It wooed children of diverse backgrounds. And instead of having students learn science through worksheets, the city gave students access to a planetarium, an outdoor garden, a butterfly vivarium, a trout pond, and a LEGO lab.

Once newcomers have what they consider to be viable local alternatives, such as high-quality gifted-and-talented programs and foreign language instruction in Prospect Heights and LEGO labs and butterfly gardens in Hartford, they seem to be more likely to choose public schools over charters. A planetarium is not a cheap solution, but if you build it, they will come—and they might well stay.