File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ class NotNullColumn < Base
46
46
MSG = 'Do not add a NOT NULL column without a default value.'
47
47
RESTRICT_ON_SEND = %i[ add_column add_reference ] . freeze
48
48
49
+ VIRTUAL_TYPE_VALUES = [ :virtual , 'virtual' ] . freeze
50
+ TEXT_TYPE_VALUES = [ :text , 'text' ] . freeze
51
+
49
52
def_node_matcher :add_not_null_column? , <<~PATTERN
50
53
(send nil? :add_column _ _ $_ (hash $...))
51
54
PATTERN
@@ -92,8 +95,8 @@ def on_block(node)
92
95
93
96
def check_column ( type , pairs )
94
97
if type . respond_to? ( :value )
95
- return if type . value == :virtual || type . value == 'virtual'
96
- return if ( type . value == :text || type . value == 'text' ) && database == MYSQL
98
+ return if VIRTUAL_TYPE_VALUES . include? ( type . value )
99
+ return if TEXT_TYPE_VALUES . include? ( type . value ) && database == MYSQL
97
100
end
98
101
99
102
check_pairs ( pairs )
You can’t perform that action at this time.
0 commit comments