Skip to content

Commit

Permalink
refactor: Add handle column to events, along with index and unique
Browse files Browse the repository at this point in the history
We've removed both the AddHandleToEvents and ChangeHandleToEvents
migrations, because it's possible to complete both changes in a
single migration (AddIndexToEvents).
  • Loading branch information
yagosansz authored and ChaelCodes committed Oct 17, 2021
1 parent 1b66158 commit 27fa2b7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
8 changes: 0 additions & 8 deletions db/migrate/20211014013357_add_handle_to_events.rb

This file was deleted.

8 changes: 0 additions & 8 deletions db/migrate/20211015020446_change_handle_to_events.rb

This file was deleted.

10 changes: 10 additions & 0 deletions db/migrate/20211017005416_add_index_to_events.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# Add a handle column to events table.
# Add index and unique to handle attribute in the events table.
class AddIndexToEvents < ActiveRecord::Migration[6.1]
def change
add_column :events, :handle, :string
add_index :events, :handle, unique: true
end
end
2 changes: 1 addition & 1 deletion db/schema.rb

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

0 comments on commit 27fa2b7

Please sign in to comment.