summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20130111111747_add_secret_token_to_gs_parameter.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/migrate/20130111111747_add_secret_token_to_gs_parameter.rb b/db/migrate/20130111111747_add_secret_token_to_gs_parameter.rb
new file mode 100644
index 0000000..bb99ace
--- /dev/null
+++ b/db/migrate/20130111111747_add_secret_token_to_gs_parameter.rb
@@ -0,0 +1,10 @@
+class AddSecretTokenToGsParameter < ActiveRecord::Migration
+ def up
+ require 'securerandom'
+ GsParameter.create(:name => 'SECRET_TOKEN', :section => 'Cookies', :value => SecureRandom.hex(64), :class_type => 'String')
+ end
+
+ def down
+ GsParameter.where(:name => 'SECRET_TOKEN').destroy_all
+ end
+end