Method: Sequel::Schema::AlterTableGenerator#set_column_not_null

Defined in:
lib/sequel/database/schema_generator.rb

#set_column_not_null(name) ⇒ Object

Set a given column as not allowing NULL values.

set_column_not_null(:artist_name) # ALTER COLUMN artist_name SET NOT NULL

On MySQL, make sure to use a symbol for the name of the column, as otherwise you can lose the default and type for the column.



694
695
696
# File 'lib/sequel/database/schema_generator.rb', line 694

def set_column_not_null(name)
  set_column_allow_null(name, false)
end