-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
31 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 @@ | ||
class UuidJid < ActiveRecord::Migration[5.2] | ||
def change | ||
self.class.schema_search_path = 'pgmq, public' | ||
execute %Q{create EXTENSION "uuid-ossp"} | ||
execute "ALTER TABLE jobs ALTER COLUMN jid DROP DEFAULT" | ||
execute "ALTER TABLE jobs ALTER COLUMN jid SET DATA TYPE UUID USING LPAD(TO_HEX(jid), 32, '0')::UUID;" | ||
execute "ALTER TABLE jobs ALTER COLUMN jid SET DEFAULT uuid_generate_v4()" | ||
execute "DROP SEQUENCE jobs_id_seq" | ||
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