Skip to content

Commit

Permalink
Use configured table name on add_tenant migration (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
as181920 authored Nov 9, 2021
1 parent 3d3cdaf commit 5d86cce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions db/migrate/7_add_tenant_to_taggings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ class AddTenantToTaggings < ActiveRecord::Migration; end
end
AddTenantToTaggings.class_eval do
def self.up
add_column :taggings, :tenant, :string, limit: 128
add_index :taggings, :tenant unless index_exists? :taggings, :tenant
add_column ActsAsTaggableOn.taggings_table, :tenant, :string, limit: 128
add_index ActsAsTaggableOn.taggings_table, :tenant unless index_exists? ActsAsTaggableOn.taggings_table, :tenant
end

def self.down
remove_index :taggings, :tenant
remove_column :taggings, :tenant
remove_index ActsAsTaggableOn.taggings_table, :tenant
remove_column ActsAsTaggableOn.taggings_table, :tenant
end
end

0 comments on commit 5d86cce

Please sign in to comment.