mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-17 00:26:07 +10:00
Add audit event table.
This commit is contained in:
@@ -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
|
||||
+15
-1
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20141103160516) do
|
||||
ActiveRecord::Schema.define(version: 20141118150935) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -25,6 +25,20 @@ ActiveRecord::Schema.define(version: 20141103160516) do
|
||||
t.datetime "updated_at"
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user