summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-04-28 17:09:15 -0300
committerFelipe Artur <felipefac@gmail.com>2016-05-16 14:56:32 -0300
commitc5526a2d9a946d99d7b4a72fc488fe6e0a9ad60b (patch)
tree3c0487cb249010cff4d95d1041c46ab81b8c87f3 /db
parent71ca2de7aabf3191c4f486ca15a78a5b7f6abd94 (diff)
downloadgitlab-ce-c5526a2d9a946d99d7b4a72fc488fe6e0a9ad60b.tar.gz
Change skip_user_confirmation_email to send_user_confirmation_email
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160421141709_add_send_confirmation_email_to_application_settings.rb12
-rw-r--r--db/migrate/20160421141709_add_skip_confirmation_email_to_application_settings.rb8
2 files changed, 12 insertions, 8 deletions
diff --git a/db/migrate/20160421141709_add_send_confirmation_email_to_application_settings.rb b/db/migrate/20160421141709_add_send_confirmation_email_to_application_settings.rb
new file mode 100644
index 00000000000..0fef2a831e7
--- /dev/null
+++ b/db/migrate/20160421141709_add_send_confirmation_email_to_application_settings.rb
@@ -0,0 +1,12 @@
+class AddSendConfirmationEmailToApplicationSettings < ActiveRecord::Migration
+ def up
+ add_column :application_settings, :send_user_confirmation_email, :boolean, default: false
+
+ #Sets confirmation email to true by default on existing installations.
+ ApplicationSetting.update_all(send_user_confirmation_email: true)
+ end
+
+ def down
+ remove_column :application_settings, :send_user_confirmation_email
+ end
+end
diff --git a/db/migrate/20160421141709_add_skip_confirmation_email_to_application_settings.rb b/db/migrate/20160421141709_add_skip_confirmation_email_to_application_settings.rb
deleted file mode 100644
index 953f1cea896..00000000000
--- a/db/migrate/20160421141709_add_skip_confirmation_email_to_application_settings.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-class AddSkipConfirmationEmailToApplicationSettings < ActiveRecord::Migration
- def change
- #Skip confirmation emails just for new installations
- default_value = User.count > 0 ? false : true
-
- add_column :application_settings, :skip_user_confirmation_email, :boolean, default: default_value
- end
-end