Sha256: d8105727bec54c8017a99785b02301f790fe65b37a7df7b0e0e4fad089a3cf1b

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

module StrongMigrations
  module Adapters
    class AbstractAdapter
      def initialize(checker)
        @checker = checker
      end

      def name
        "Unknown"
      end

      def min_version
      end

      def set_statement_timeout(timeout)
        raise StrongMigrations::Error, "Statement timeout not supported for this database"
      end

      def set_lock_timeout(timeout)
        raise StrongMigrations::Error, "Lock timeout not supported for this database"
      end

      def check_lock_timeout(limit)
        # do nothing
      end

      def add_column_default_safe?
        false
      end

      def change_type_safe?(table, column, type, options, existing_column, existing_type)
        false
      end

      def rewrite_blocks
        "reads and writes"
      end

      private

      def connection
        @checker.send(:connection)
      end

      def select_all(statement)
        connection.select_all(statement)
      end

      def target_version(target_version)
        target_version ||= StrongMigrations.target_version
        version =
          if target_version && StrongMigrations.developer_env?
            target_version.to_s
          else
            yield
          end
        Gem::Version.new(version)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
strong_migrations-1.4.0 lib/strong_migrations/adapters/abstract_adapter.rb
strong_migrations-1.3.2 lib/strong_migrations/adapters/abstract_adapter.rb
strong_migrations-1.3.1 lib/strong_migrations/adapters/abstract_adapter.rb
strong_migrations-1.3.0 lib/strong_migrations/adapters/abstract_adapter.rb
strong_migrations-1.2.0 lib/strong_migrations/adapters/abstract_adapter.rb
strong_migrations-1.1.0 lib/strong_migrations/adapters/abstract_adapter.rb
strong_migrations-1.0.0 lib/strong_migrations/adapters/abstract_adapter.rb