Skip to content

Commit

Permalink
Remove unique index on portfolio_stocks on portfolio and stock
Browse files Browse the repository at this point in the history
- Multiple portfolio_stocks can exist for a portfolio with different purchase prices
  • Loading branch information
jonny5 committed Jun 2, 2024
1 parent bbe21f3 commit 2d82828
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions db/migrate/20240601215111_remove_portfolio_stocks_index.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class RemovePortfolioStocksIndex < ActiveRecord::Migration[7.1]
def change
remove_index :portfolio_stocks, name: 'index_portfolio_stocks_on_portfolio_and_stock'

add_index :portfolio_stocks, [:portfolio_id, :stock_id], name: "index_portfolio_stocks_on_portfolio_and_stock"
end
end
4 changes: 2 additions & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2d82828

Please sign in to comment.