Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ConvertMessageToUtf8mb4 < ActiveRecord::Migration
- def change
- reversible do |dir|
- dir.up do
- execute "ALTER TABLE live_reports CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"
- execute "ALTER TABLE live_reports CHANGE message message VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"
- end
- dir.down do
- execute "ALTER TABLE live_reports CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"
- execute "ALTER TABLE live_reports CHANGE message message VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci;"
- end
- end
- end
- end
- development:
- adapter: mysql2
- database: omz
- # encoding: utf8
- username:
- password:
- host: localhost
- encoding: utf8mb4
- collation: utf8mb4_unicode_ci
Add Comment
Please, Sign In to add comment