Closed ypresto closed 4 years ago
Ah, it is not changeable option.
I should disable it because my non-primary column has both presence and uniqueness validator.
Finally I decided to prohibit id column in input csv.
before_batch_import: ->(importer) do
# https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html
raise 'Cannot specify id. Use subdomain for update key.' if importer.headers.keys.include?('id')
(NOTE: This is false by default in activerecord-import)