Soc/db/migrate/20231006070935_add_summary_...

8 lines
228 B
Ruby
Raw Normal View History

2023-10-06 07:26:16 +00:00
class AddSummaryToBlogPost < ActiveRecord::Migration[7.1]
def change
add_column :blog_posts, :summary, :string, null: true
BlogPost.update_all(summary: "")
change_column_null :blog_posts, :summary, false
end
end