summaryrefslogtreecommitdiff
path: root/db
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
parent8ba83cbab86349c5fa5ce5034df6ffc8225f137c (diff)
downloadgitlab-ce-411829fdb5f24f97ce17e05f5fd018d47075b216.tar.gz
Audit log for user authentication
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20141118150935_add_audit_event.rb22
-rw-r--r--db/schema.rb18
2 files changed, 38 insertions, 2 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
diff --git a/db/schema.rb b/db/schema.rb
index 3a5af6a76d4..8736d1e0df5 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -28,16 +28,30 @@ ActiveRecord::Schema.define(version: 20150620233230) do
t.integer "default_branch_protection", default: 2
t.boolean "twitter_sharing_enabled", default: true
t.text "restricted_visibility_levels"
- t.boolean "version_check_enabled", default: true
t.integer "max_attachment_size", default: 10, null: false
t.integer "default_project_visibility"
t.integer "default_snippet_visibility"
t.text "restricted_signup_domains"
+ t.boolean "version_check_enabled", default: true
t.boolean "user_oauth_applications", default: true
t.string "after_sign_out_path"
t.integer "session_expire_delay", default: 10080, null: false
end
+ create_table "audit_events", force: true do |t|
+ t.integer "author_id", null: false
+ t.string "type", null: false
+ t.integer "entity_id", null: false
+ t.string "entity_type", null: false
+ t.text "details"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "audit_events", ["author_id"], name: "index_audit_events_on_author_id", using: :btree
+ add_index "audit_events", ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type", using: :btree
+ add_index "audit_events", ["type"], name: "index_audit_events_on_type", using: :btree
+
create_table "broadcast_messages", force: true do |t|
t.text "message", null: false
t.datetime "starts_at"
@@ -496,12 +510,12 @@ ActiveRecord::Schema.define(version: 20150620233230) do
t.string "bitbucket_access_token"
t.string "bitbucket_access_token_secret"
t.string "location"
+ t.string "public_email", default: "", null: false
t.string "encrypted_otp_secret"
t.string "encrypted_otp_secret_iv"
t.string "encrypted_otp_secret_salt"
t.boolean "otp_required_for_login", default: false, null: false
t.text "otp_backup_codes"
- t.string "public_email", default: "", null: false
t.integer "dashboard", default: 0
end