Flowdock
method

structure_dump

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: PostgreSQLDatabaseTasks
structure_dump(filename) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/tasks/postgresql_database_tasks.rb, line 45
      def structure_dump(filename)
        set_psql_env

        search_path = case ActiveRecord::Base.dump_schemas
        when :schema_search_path
          configuration['schema_search_path']
        when :all
          nil
        when String
          ActiveRecord::Base.dump_schemas
        end

        args = ['-s', '-x', '-O', '-f', filename]
        unless search_path.blank?
          args += search_path.split(',').map do |part|
            "--schema=#{part.strip}"
          end
        end
        args << configuration['database']
        run_cmd('pg_dump', args, 'dumping')
        File.open(filename, "a") { |f| f << "SET search_path TO #{connection.schema_search_path};\n\n" }
      end
Register or log in to add new notes.