added migration to replace existing file_extension containing nil with ''
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MigrateFiletypeExtensionsNotNil < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
FileType.all.find_all {|file_type| file_type.file_extension.nil? }.each do |file_type|
|
||||
file_type.update file_extension: ''
|
||||
end
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_01_20_185807) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_02_06_203117) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_trgm"
|
||||
enable_extension "pgcrypto"
|
||||
|
Reference in New Issue
Block a user