Skip to content

Commit

Permalink
update fixture to rails 5.1 and support ActiveRecord::Migration versi…
Browse files Browse the repository at this point in the history
…oning, fix for issue mentioned in mbulat#72
  • Loading branch information
mbulat committed Jul 10, 2017
1 parent 0270e1e commit 0b09df8
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 85 deletions.
2 changes: 1 addition & 1 deletion fixture_rails_root/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.2'
gem 'rails', '~> 5.1.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
Expand Down
108 changes: 54 additions & 54 deletions fixture_rails_root/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
PATH
remote: ../plutus
remote: ..
specs:
plutus (0.12.2)
jquery-rails (>= 3.0)
jquery-ui-rails (>= 4.2.2)
rails (>= 5.0)
rails (> 4.0)

GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.2)
actionpack (= 5.0.2)
nio4r (>= 1.2, < 3.0)
actioncable (5.1.2)
actionpack (= 5.1.2)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
actionmailer (5.1.2)
actionpack (= 5.1.2)
actionview (= 5.1.2)
activejob (= 5.1.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.2)
actionview (= 5.0.2)
activesupport (= 5.0.2)
actionpack (5.1.2)
actionview (= 5.1.2)
activesupport (= 5.1.2)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.2)
activesupport (= 5.0.2)
actionview (5.1.2)
activesupport (= 5.1.2)
builder (~> 3.1)
erubis (~> 2.7.0)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.2)
activesupport (= 5.0.2)
activejob (5.1.2)
activesupport (= 5.1.2)
globalid (>= 0.3.6)
activemodel (5.0.2)
activesupport (= 5.0.2)
activerecord (5.0.2)
activemodel (= 5.0.2)
activesupport (= 5.0.2)
arel (~> 7.0)
activesupport (5.0.2)
activemodel (5.1.2)
activesupport (= 5.1.2)
activerecord (5.1.2)
activemodel (= 5.1.2)
activesupport (= 5.1.2)
arel (~> 8.0)
activesupport (5.1.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
arel (8.0.0)
bindex (0.5.0)
builder (3.2.3)
byebug (9.0.6)
Expand All @@ -58,12 +58,12 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
erubis (2.7.0)
erubi (1.6.1)
execjs (2.7.0)
ffi (1.9.18)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.8.1)
globalid (0.4.0)
activesupport (>= 4.2.0)
i18n (0.8.6)
jbuilder (2.6.3)
activesupport (>= 3.0.0, < 5.2)
multi_json (~> 1.2)
Expand All @@ -78,42 +78,42 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mail (2.6.6)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.1)
mini_portile2 (2.2.0)
minitest (5.10.2)
multi_json (1.12.1)
nio4r (2.0.0)
nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
nio4r (2.1.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
puma (3.8.2)
rack (2.0.1)
rack (2.0.3)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.2)
actioncable (= 5.0.2)
actionmailer (= 5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
activemodel (= 5.0.2)
activerecord (= 5.0.2)
activesupport (= 5.0.2)
rails (5.1.2)
actioncable (= 5.1.2)
actionmailer (= 5.1.2)
actionpack (= 5.1.2)
actionview (= 5.1.2)
activejob (= 5.1.2)
activemodel (= 5.1.2)
activerecord (= 5.1.2)
activesupport (= 5.1.2)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.2)
railties (= 5.1.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.2)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.2)
actionpack (= 5.0.2)
activesupport (= 5.0.2)
railties (5.1.2)
actionpack (= 5.1.2)
activesupport (= 5.1.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
Expand Down Expand Up @@ -171,7 +171,7 @@ DEPENDENCIES
listen (~> 3.0.5)
plutus!
puma (~> 3.0)
rails (~> 5.0.2)
rails (~> 5.1.2)
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
Expand All @@ -182,4 +182,4 @@ DEPENDENCIES
web-console (>= 3.3.0)

BUNDLED WITH
1.14.5
1.15.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreatePlutusTables < ActiveRecord::Migration
class CreatePlutusTables < ActiveRecord::Migration[4.2]
def self.up
create_table :plutus_accounts do |t|
t.string :name
Expand Down
45 changes: 20 additions & 25 deletions fixture_rails_root/db/schema.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
Expand All @@ -9,42 +8,38 @@
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to 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 => 20150722204422) do
ActiveRecord::Schema.define(version: 20170710173916) do

create_table "plutus_accounts", :force => true do |t|
t.string "name"
t.string "type"
t.boolean "contra"
create_table "plutus_accounts", force: :cascade do |t|
t.string "name"
t.string "type"
t.boolean "contra"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "tenant_id"
t.index ["name", "type"], name: "index_plutus_accounts_on_name_and_type"
end

add_index "plutus_accounts", ["name", "type"], :name => "index_plutus_accounts_on_name_and_type"

create_table "plutus_amounts", :force => true do |t|
t.string "type"
create_table "plutus_amounts", force: :cascade do |t|
t.string "type"
t.integer "account_id"
t.integer "entry_id"
t.decimal "amount", :precision => 20, :scale => 10
t.decimal "amount", precision: 20, scale: 10
t.index ["account_id", "entry_id"], name: "index_plutus_amounts_on_account_id_and_entry_id"
t.index ["entry_id", "account_id"], name: "index_plutus_amounts_on_entry_id_and_account_id"
t.index ["type"], name: "index_plutus_amounts_on_type"
end

add_index "plutus_amounts", ["account_id", "entry_id"], :name => "index_plutus_amounts_on_account_id_and_entry_id"
add_index "plutus_amounts", ["entry_id", "account_id"], :name => "index_plutus_amounts_on_entry_id_and_account_id"
add_index "plutus_amounts", ["type"], :name => "index_plutus_amounts_on_type"

create_table "plutus_entries", :force => true do |t|
t.string "description"
t.date "date"
t.integer "commercial_document_id"
t.string "commercial_document_type"
create_table "plutus_entries", force: :cascade do |t|
t.string "description"
t.date "date"
t.integer "commercial_document_id"
t.string "commercial_document_type"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["commercial_document_id", "commercial_document_type"], name: "index_entries_on_commercial_doc"
t.index ["date"], name: "index_plutus_entries_on_date"
end

add_index "plutus_entries", ["commercial_document_id", "commercial_document_type"], :name => "index_entries_on_commercial_doc"
add_index "plutus_entries", ["date"], :name => "index_plutus_entries_on_date"

end
2 changes: 1 addition & 1 deletion lib/generators/plutus/templates/add_date_migration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddDateToPlutusEntries < ActiveRecord::Migration
class AddDateToPlutusEntries < ActiveRecord::Migration[4.2]
def change
add_column :plutus_entries, :date, :date
add_index :plutus_entries, :date
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/plutus/templates/migration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreatePlutusTables < ActiveRecord::Migration
class CreatePlutusTables < ActiveRecord::Migration[4.2]
def self.up
create_table :plutus_accounts do |t|
t.string :name
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/plutus/templates/tenant_migration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class TenantPlutusTables < ActiveRecord::Migration
class TenantPlutusTables < ActiveRecord::Migration[4.2]
def change
# add a tenant column to plutus accounts table.
add_column :plutus_accounts, :tenant_id, :integer, index: true
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/plutus/templates/update_migration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class UpdatePlutusTables < ActiveRecord::Migration
class UpdatePlutusTables < ActiveRecord::Migration[4.2]
def change
# we have to remove these indexes because the temporary
# table index name is too long
Expand Down

0 comments on commit 0b09df8

Please sign in to comment.