ファイル
btrc-hub/backend/db/migrate/20260519013100_add_video_ms_to_posts.rb
T
2026-05-22 03:29:18 +09:00

10 行
322 B
Ruby

class AddVideoMsToPosts < ActiveRecord::Migration[8.0]
def change
add_column :posts, :video_ms, :integer
add_index :posts, [:video_ms, :id], name: 'idx_posts_video_ms_id'
add_check_constraint :posts, 'video_ms IS NULL OR video_ms > 0',
name: 'chk_posts_video_ms_positive'
end
end