Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ gem 'jsonapi-resources'

gem 'rack-cors', :require => 'rack/cors'

gem 'paper_trail', '~> 4.0.0'

group :production do
gem 'pg'
end
Expand Down
10 changes: 8 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ GEM
minitest (5.8.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
paper_trail (4.0.0)
activerecord (>= 3.0, < 6.0)
activesupport (>= 3.0, < 6.0)
request_store (~> 1.1)
pg (0.18.3)
pry (0.10.1)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -96,6 +100,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
request_store (1.2.0)
rspec-core (3.3.2)
rspec-support (~> 3.3.0)
rspec-expectations (3.3.1)
Expand All @@ -114,7 +119,7 @@ GEM
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
slop (3.6.0)
spring (1.3.6)
spring (1.6.3)
sprockets (3.3.4)
rack (~> 1.0)
sprockets-rails (2.3.3)
Expand All @@ -133,6 +138,7 @@ PLATFORMS
DEPENDENCIES
factory_girl_rails (~> 4.0)
jsonapi-resources
paper_trail (~> 4.0.0)
pg
pry
rack-cors
Expand All @@ -142,4 +148,4 @@ DEPENDENCIES
sqlite3

BUNDLED WITH
1.10.6
1.11.2
20 changes: 20 additions & 0 deletions db/migrate/20151014232426_create_versions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class CreateVersions < ActiveRecord::Migration

# The largest text column available in all supported RDBMS is
# 1024^3 - 1 bytes, roughly one gibibyte. We specify a size
# so that MySQL will use `longtext` instead of `text`. Otherwise,
# when serializing very large objects, `text` might not be big enough.
TEXT_BYTES = 1_073_741_823

def change
create_table :versions do |t|
t.string :item_type, :null => false
t.integer :item_id, :null => false
t.string :event, :null => false
t.string :whodunnit
t.text :object, :limit => TEXT_BYTES
t.datetime :created_at
end
add_index :versions, [:item_type, :item_id]
end
end
19 changes: 18 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150921161235) do
ActiveRecord::Schema.define(version: 20151014232426) do

create_table "internets", force: :cascade do |t|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alassiter This probably won't need to be in the final PR.

t.string "address"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "locations", force: :cascade do |t|
t.string "name"
Expand Down Expand Up @@ -43,4 +49,15 @@
add_index "things", ["location_id"], name: "index_things_on_location_id"
add_index "things", ["name"], name: "index_things_on_name", unique: true

create_table "versions", force: :cascade do |t|
t.string "item_type", null: false
t.integer "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
t.text "object", limit: 1073741823
t.datetime "created_at"
end

add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"

end