Fix published flag migration to be db-agnostic.

Sorta. in a weird way.