Handle size in binary columns
In the cable schema we use:
```
t.binary "payload", size: :long, null: false
```
This will fail when resetting the db otherwise with an error due to the unexpected size property.
This commit is contained in:
@@ -24,13 +24,13 @@ module TableDefinitionColumnLimits
|
||||
options[:limit] ||= STRING_DEFAULT_LIMIT
|
||||
end
|
||||
|
||||
if type == :text
|
||||
if type == :text || type == :binary
|
||||
if options.key?(:size)
|
||||
size = options.delete(:size)
|
||||
options[:limit] ||= TEXT_SIZE_TO_LIMIT.fetch(size) do
|
||||
raise ArgumentError, "Unknown text size: #{size.inspect}. Use :tiny, :medium, or :long"
|
||||
end
|
||||
else
|
||||
elsif type == :text
|
||||
options[:limit] ||= TEXT_DEFAULT_LIMIT
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user