Has anyone else had a need to for a verification step. An assurance that the migration has completed successfully. e.g.
Lhm.change_table :my_table do |table|
table.ddl "ALTER TABLE `#{table.name}` DEFAULT CHARACTER SET utf8mb4, DEFAULT COLLATE utf8mb4_unicode_ci"
verification do |table|
result = table.query "SELECT count(*) FROM {#table.name) as new_table JOIN #{table.name} as old_table USING (id) WHERE new_table.name != old_table.name"
result.first[0] == 0
end
end
The verification block would be executed after the Chunker and before the Switcher. If it evaluated to false the change would be rolled back.
Does anyone else have a need for this and what strategies do you currently use? Does a feature like this fit into this gem?
Has anyone else had a need to for a verification step. An assurance that the migration has completed successfully. e.g.
The verification block would be executed after the Chunker and before the Switcher. If it evaluated to false the change would be rolled back.
Does anyone else have a need for this and what strategies do you currently use? Does a feature like this fit into this gem?