diff --git a/db/migrate/20230313105520_convert_settings_to_dsl.rb b/db/migrate/20230313105520_convert_settings_to_dsl.rb
index a66d9a11008331e56c24e90767fc0c9278b9fd42..08b69486b0843e2af945c50eb08bbe48af060759 100644
--- a/db/migrate/20230313105520_convert_settings_to_dsl.rb
+++ b/db/migrate/20230313105520_convert_settings_to_dsl.rb
@@ -2,6 +2,7 @@
 
 class ConvertSettingsToDsl < ActiveRecord::Migration[6.0]
   def up
-    Settings.where(category: 'Setting::NotificationSend').update_all(category: 'Setting')
+    Setting.where(category: 'Setting::NotificationSend').update_all(category: 'Setting') \
+      if column_exists?(:settings, :category)
   end
 end
diff --git a/lib/foreman_notification_send/version.rb b/lib/foreman_notification_send/version.rb
index 4a882d7d7d6989e1ece4401fc2d61d5f63aacfa9..95eb301e3b1ee93fa22f3ccf34acbee76dde7482 100644
--- a/lib/foreman_notification_send/version.rb
+++ b/lib/foreman_notification_send/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module ForemanNotificationSend
-  VERSION = '0.4.0'
+  VERSION = '0.4.1'
 end