class ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaCreation

def add_column_options!(sql, options)

def add_column_options!(sql, options)
  if options[:collation]
    sql << " COLLATE \"#{options[:collation]}\""
  end
  if as = options[:as]
    sql << " GENERATED ALWAYS AS (#{as})"
    if options[:stored]
      sql << " STORED"
    else
      raise ArgumentError, <<~MSG
        PostgreSQL currently does not support VIRTUAL (not persisted) generated columns.
        Specify 'stored: true' option for '#{options[:column].name}'
      MSG
    end
  end
  super
end