Skip to content

Commit 81738ab

Browse files
committed
[sqlite3] fix from AR
1 parent ccd621f commit 81738ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/arjdbc/sqlite3/adapter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ def table_structure(table_name)
364364
# See: https://www.sqlite.org/lang_altertable.html
365365
# SQLite has an additional restriction on the ALTER TABLE statement
366366
def invalid_alter_table_type?(type, options)
367-
type.to_sym == :primary_key || options[:primary_key]
367+
type.to_sym == :primary_key || options[:primary_key] ||
368+
options[:null] == false && options[:default].nil?
368369
end
369370

370371
def alter_table(table_name, foreign_keys = foreign_keys(table_name), **options)

0 commit comments

Comments
 (0)