discourse-ai/db/post_migrate/20230314184514_migrate_disc...

14 lines
391 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class MigrateDiscourseAiReviewables < ActiveRecord::Migration[7.0]
def up
DB.exec("UPDATE reviewables SET type='ReviewableAiPost' WHERE type='ReviewableAIPost'")
DB.exec(
"UPDATE reviewables SET type='ReviewableAiChatMessage' WHERE type='ReviewableAIChatMessage'",
)
end
def down
raise ActiveRecord::IrreversibleMigration
end
end