First, create an empty migration, either by hand or using bin/rails g. Then use the change_column_null handle:

class FieldNullOnModel < ActiveRecord::Migration[5.1]
	def change
		change_column_null :table_name, :column_name, false

Save the changes and migrate (bin/rails db:migrate). Voila! The target column now requires content. Remember to update existing records to reflect this validation.

[Daily Tip] How to add extra fields during user registration with Devise [Daily Tip] How to speed up the DNS expiring process after you DNS change