INSERT INTO article_settings (article_id, setting_name, setting_value, setting_type, locale) SELECT article_id, 'pub-id::publisher-id', public_article_id, 'string', '' FROM published_articles DROP INDEX published_articles_article_id DROP INDEX published_articles_issue_id