summaryrefslogtreecommitdiffstats
path: root/db/migrate/20151024082034_add_tokens_updated_on.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20151024082034_add_tokens_updated_on.rb')
-rw-r--r--db/migrate/20151024082034_add_tokens_updated_on.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/migrate/20151024082034_add_tokens_updated_on.rb b/db/migrate/20151024082034_add_tokens_updated_on.rb
new file mode 100644
index 000000000..0af28dc81
--- /dev/null
+++ b/db/migrate/20151024082034_add_tokens_updated_on.rb
@@ -0,0 +1,10 @@
+class AddTokensUpdatedOn < ActiveRecord::Migration
+ def self.up
+ add_column :tokens, :updated_on, :timestamp
+ Token.update_all("updated_on = created_on")
+ end
+
+ def self.down
+ remove_column :tokens, :updated_on
+ end
+end