このコミットが含まれているのは:
2025-12-30 15:04:46 +09:00
コミット 599fa65428
4個のファイルの変更75行の追加7行の削除
+27
ファイルの表示
@@ -0,0 +1,27 @@
class MakeThumbnailBaseNullableInPosts < ActiveRecord::Migration[7.0]
def up
change_column_null :posts, :thumbnail_base, true
execute <<~SQL
UPDATE
posts
SET
thumbnail_base = NULL
WHERE
thumbnail_base = ''
SQL
end
def down
execute <<~SQL
UPDATE
posts
SET
thumbnail_base = ''
WHERE
thumbnail_base IS NULL
SQL
change_column_null :posts, :thumbnail_base, false
end
end