generated from DFE-Digital/govuk-rails-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ECF-410 Fix paper trail audit schema datatype (#176)
* fix audit schema * add default uuid to appease rubocop
- Loading branch information
Showing
2 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class ChangeItemIdTypeToUuid < ActiveRecord::Migration[6.1] | ||
def change | ||
remove_column :versions, :item_id, :bigint | ||
remove_index :versions, column: %i[item_type item_id], if_exists: true | ||
add_column :versions, :item_id, :uuid, default: "gen_random_uuid()", null: false | ||
add_index :versions, %i[item_type item_id] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters