use strict;

return sub
{
	my $dbh = shift;
	

	my $sth = $dbh->prepare("select id, cfgtext from jin_ext_script where plugin='ExtScriptWordPress'");
	$sth->execute;

	my $sthi = $dbh->prepare("update jin_ext_script set cfgtext=? where id=?");

	while (my $row = $sth->fetchrow_hashref)
	{
		my $cfgtext = $row->{cfgtext};

		next
			if index($cfgtext, 'useWishListMember') >= 0;

		$cfgtext =~ s/[\r\n]//g;
		$cfgtext .= ($cfgtext ? ':' : '') . 'useWishListMember:1';

		$sthi->execute($cfgtext, $row->{id});
	}
	
	return;
};
