Skip to content

Commit

Permalink
Use standard way of generating migrations in engines
Browse files Browse the repository at this point in the history
Keep tenant column:

Until we merge the feature that always turns on tenancy
(#79), we must keep
the dummy Rails app's migrations disjoint from what
`rake plutus:migrations:install` actually copies over
  • Loading branch information
ramontayag authored and mbulat committed Oct 31, 2019
1 parent 2f77381 commit d742b70
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 41 deletions.
4 changes: 1 addition & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Installation
============

- Add the gem to your Gemfile `gem "plutus"`

- generate migration files `rails g plutus`

- generate migration files `rake plutus:install:migrations`
- run migrations `rake db:migrate`

Overview
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CreatePlutusTables < ActiveRecord::Migration[4.2]
def self.up
def change
create_table :plutus_accounts do |t|
t.string :name
t.string :type
Expand Down Expand Up @@ -30,10 +30,4 @@ def self.up
add_index :plutus_amounts, [:account_id, :entry_id]
add_index :plutus_amounts, [:entry_id, :account_id]
end

def self.down
drop_table :plutus_accounts
drop_table :plutus_entries
drop_table :plutus_amounts
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CreatePlutusTables < ActiveRecord::Migration[4.2]
def self.up
def change
create_table :plutus_accounts do |t|
t.string :name
t.string :type
Expand Down Expand Up @@ -30,10 +30,4 @@ def self.up
add_index :plutus_amounts, [:account_id, :entry_id]
add_index :plutus_amounts, [:entry_id, :account_id]
end

def self.down
drop_table :plutus_accounts
drop_table :plutus_entries
drop_table :plutus_amounts
end
end
2 changes: 1 addition & 1 deletion fixture_rails_root/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20170710174915) do
ActiveRecord::Schema.define(version: 20180709082453) do

create_table "plutus_accounts", force: :cascade do |t|
t.string "name"
Expand Down
6 changes: 0 additions & 6 deletions lib/generators/plutus/templates/add_date_migration.rb

This file was deleted.

17 changes: 0 additions & 17 deletions lib/generators/plutus/templates/update_migration.rb

This file was deleted.

0 comments on commit d742b70

Please sign in to comment.