feat: posts.title を Nullable に(#209) (#212)

Merge branch 'feature/209' of https://git.miteruzo.com/miteruzo/btrc-hub into feature/209

Merge branch 'main' into feature/209

Merge remote-tracking branch 'origin/main' into feature/209

#209

#209

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #212
このコミットはPull リクエスト #212 でマージされました.
このコミットが含まれているのは:
2026-01-12 14:38:06 +09:00
コミット f2b774ab1d
3個のファイルの変更32行の追加4行の削除
+28
ファイルの表示
@@ -0,0 +1,28 @@
class MakeTitleNullableInPosts < ActiveRecord::Migration[7.0]
def up
change_column_null :posts, :title, true
execute <<~SQL
UPDATE
posts
SET
title = NULL
WHERE
title = ''
SQL
end
def down
execute <<~SQL
UPDATE
posts
SET
title = ''
WHERE
title IS NULL
SQL
change_column_null :posts, :title, false
end
end