Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This migration comes from co_plan (originally 20260429000000)
class ExpandPlanVersionDiffUnified < ActiveRecord::Migration[8.0]
# The default `text` column tops out at ~64KB on MySQL, which we hit
# whenever a PlanVersion's unified diff exceeds that — easy with the
# PUT /api/v1/plans/:id/content endpoint, where agents can submit
# whole-file rewrites of large plans. content_markdown is already
# mediumtext (~16MB); diff_unified should match so any persistable
# content can also persist its diff.
def change
change_column :coplan_plan_versions, :diff_unified, :text, limit: 16.megabytes - 1
Comment on lines +9 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Rewrite migration using up/down for rollback safety

change_column is irreversible when used inside change, so rolling back this migration will raise ActiveRecord::IrreversibleMigration instead of restoring the old text definition. That makes deploy/database rollback paths fail when this migration has been applied (the same pattern is duplicated in the engine copy), which is a real operational risk for production rollbacks; use explicit up/down (or reversible) to define how to revert the column size change.

Useful? React with 👍 / 👎.

end
end
4 changes: 2 additions & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class ExpandPlanVersionDiffUnified < ActiveRecord::Migration[8.0]
# The default `text` column tops out at ~64KB on MySQL, which we hit
# whenever a PlanVersion's unified diff exceeds that — easy with the
# PUT /api/v1/plans/:id/content endpoint, where agents can submit
# whole-file rewrites of large plans. content_markdown is already
# mediumtext (~16MB); diff_unified should match so any persistable
# content can also persist its diff.
def change
change_column :coplan_plan_versions, :diff_unified, :text, limit: 16.megabytes - 1
end
end
Loading