Sha256: 80429bab53c13fda6fcd8ffc9881705811b7e318ae0b7ae6febc511b3a8a10e6

Contents?: true

Size: 794 Bytes

Versions: 12

Compression:

Stored size: 794 Bytes

Contents

module StrongMigrations
  module Adapters
    class MariaDBAdapter < MySQLAdapter
      def name
        "MariaDB"
      end

      def min_version
        "10.2"
      end

      def server_version
        @server_version ||= begin
          target_version(StrongMigrations.target_mariadb_version) do
            select_all("SELECT VERSION()").first["VERSION()"].split("-").first
          end
        end
      end

      def set_statement_timeout(timeout)
        # fix deprecation warning with Active Record 7.1
        timeout = timeout.value if timeout.is_a?(ActiveSupport::Duration)

        select_all("SET max_statement_time = #{connection.quote(timeout)}")
      end

      def add_column_default_safe?
        server_version >= Gem::Version.new("10.3.2")
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
strong_migrations-1.7.0 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.6.4 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.6.3 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.6.2 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.6.1 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.6.0 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.5.0 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.4.4 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.4.3 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.4.2 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.4.1 lib/strong_migrations/adapters/mariadb_adapter.rb
strong_migrations-1.4.0 lib/strong_migrations/adapters/mariadb_adapter.rb