Skip to content

Commit

Permalink
adds resilient locked_until default
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoorai2000 committed Sep 26, 2015
1 parent 39d1c3d commit 545f5b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions db/migrate/20150926115929_adds_resilient_locked_until_default.rb
@@ -0,0 +1,11 @@
class AddsResilientLockedUntilDefault < ActiveRecord::Migration

def up
change_column_default :locks, :locked_until, Time.new(2000, 1, 1, 1, 1, 1)
end

def down
change_column_default :locks, :locked_until, Time.now
end

end
4 changes: 2 additions & 2 deletions db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150921095553) do
ActiveRecord::Schema.define(version: 20150926115929) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -181,7 +181,7 @@
create_table "locks", force: :cascade do |t|
t.integer "user_id"
t.integer "tries", default: 0
t.datetime "locked_until", default: '2015-09-15 07:56:29', null: false
t.datetime "locked_until", default: '2000-01-01 00:01:01', null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
Expand Down

0 comments on commit 545f5b5

Please sign in to comment.