departurerb / departure

Percona's pt-online-schema-change runner for ActiveRecord migrations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to alter a table?

sasharevzin opened this issue · comments

commented

I would like to change encoding for one of my tables by using Percona, but the only way I googled is to execute a custom SQL like:

class ChangeCommentsToUtf8mb4 < ActiveRecord::Migration
  def up
    execute "ALTER TABLE comments CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"
  end
end

but in this case, it won't run with Percona.
Is there a way to alter a table and still run it via Percona?

commented

I see that execute works via Percona as well, somehow I missed it. Sorry