カラムにNOT NULL制約を追加するにはマイグレーションファイルに以下のように記述します。
def change
change_column_null :テーブル名, :カラム名, false
end
users
テーブルのis_sample
カラムにNOT NULL制約を追加する場合は以下のようになります。
def change
change_column_null :users, :is_sample, false
end
Go to list of users who liked
カラムにNOT NULL制約を追加するにはマイグレーションファイルに以下のように記述します。
def change
change_column_null :テーブル名, :カラム名, false
end
users
テーブルのis_sample
カラムにNOT NULL制約を追加する場合は以下のようになります。
def change
change_column_null :users, :is_sample, false
end
Register as a new user and use Qiita more conveniently
Go to list of users who liked