Created
August 21, 2025 15:05
-
-
Save buncis/7c424ecb3d84ebf078e5652a5d49e4a6 to your computer and use it in GitHub Desktop.
Revisions
-
buncis created this gist
Aug 21, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ create boolean value that could be nilled ``` class AddActiveToQuestionnaire < ActiveRecord::Migration[7.2] def change add_column :questionnaires, :active, :boolean add_check_constraint :questionnaires, "active", name: "only_accept_true_or_null" add_index :questionnaires, :active, unique: true end end ``` https://github.com/buncis/norma/commit/2ee90bb3e57fde446a24e59b1087714f2239f845