adds activities
This commit is contained in:
13
db/migrate/20150921095553_create_activities.rb
Normal file
13
db/migrate/20150921095553_create_activities.rb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class CreateActivities < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :activities do |t|
|
||||||
|
t.integer :user_id
|
||||||
|
t.string :action
|
||||||
|
t.belongs_to :actionable, polymorphic: true
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index :activities, [:actionable_id, :actionable_type]
|
||||||
|
add_index :activities, :user_id
|
||||||
|
end
|
||||||
|
end
|
||||||
14
db/schema.rb
14
db/schema.rb
@@ -11,11 +11,23 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20150917102718) do
|
ActiveRecord::Schema.define(version: 20150921095553) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
|
create_table "activities", force: :cascade do |t|
|
||||||
|
t.integer "user_id"
|
||||||
|
t.string "action"
|
||||||
|
t.integer "actionable_id"
|
||||||
|
t.string "actionable_type"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "activities", ["actionable_id", "actionable_type"], name: "index_activities_on_actionable_id_and_actionable_type", using: :btree
|
||||||
|
add_index "activities", ["user_id"], name: "index_activities_on_user_id", using: :btree
|
||||||
|
|
||||||
create_table "addresses", force: :cascade do |t|
|
create_table "addresses", force: :cascade do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.string "street"
|
t.string "street"
|
||||||
|
|||||||
Reference in New Issue
Block a user