98bb435f42
Migrations shouldn't fail RuboCop checks - especially lint checks, such as the nested method check. To avoid changing code in existing migrations, add the magic comment to the top of each of them to skip that file.
23 lines
585 B
Ruby
23 lines
585 B
Ruby
# rubocop:disable all
|
|
class AddAuditEvent < ActiveRecord::Migration
|
|
def change
|
|
create_table :audit_events do |t|
|
|
t.integer :author_id, null: false
|
|
t.string :type, null: false
|
|
|
|
# "Namespace" where the change occurs
|
|
# eg. On a project, group or user
|
|
t.integer :entity_id, null: false
|
|
t.string :entity_type, null: false
|
|
|
|
# Details for the event
|
|
t.text :details
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :audit_events, :author_id
|
|
add_index :audit_events, :type
|
|
add_index :audit_events, [:entity_id, :entity_type]
|
|
end
|
|
end
|