summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-07-03 14:54:50 +0300
committerValery Sizov <vsv2711@gmail.com>2015-07-06 12:36:08 +0300
commit411829fdb5f24f97ce17e05f5fd018d47075b216 (patch)
treeaa39d65d78e0aa719df07ab268522a5bc3cb371f /db/migrate
parent8ba83cbab86349c5fa5ce5034df6ffc8225f137c (diff)
downloadgitlab-ce-411829fdb5f24f97ce17e05f5fd018d47075b216.tar.gz
Audit log for user authentication
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20141118150935_add_audit_event.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20141118150935_add_audit_event.rb b/db/migrate/20141118150935_add_audit_event.rb
new file mode 100644
index 00000000000..07383c6bbc7
--- /dev/null
+++ b/db/migrate/20141118150935_add_audit_event.rb
@@ -0,0 +1,22 @@
+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