[DB] Fix data migration when making scope non-null