Module: Hippo::DB::Migrations::TableDefinitionHelpers

Defined in:
lib/hippo/db/migrations.rb

Overview

Migration table definition helpers methods

Instance Method Summary collapse

Instance Method Details

#track_modifications(create_only: false, null: false) ⇒ Object

track user modifications


16
17
18
19
20
21
22
23
# File 'lib/hippo/db/migrations.rb', line 16

def track_modifications(create_only: false, null: false)
    column(:created_at, :datetime,   null: null)
    column(:created_by_id, :integer, null: null)
    return if create_only

    column(:updated_at, :datetime,   null: null)
    column(:updated_by_id, :integer, null: null)
end