Sha256: 13b017e9c47dff5d2b21c6615cd1aac04d6a3b8e20bdc9f5623895993691db4e

Contents?: true

Size: 826 Bytes

Versions: 8

Compression:

Stored size: 826 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module SQLServer
      module SchemaDumper

        SQLSEVER_NO_LIMIT_TYPES = [
          'text',
          'ntext',
          'varchar(max)',
          'nvarchar(max)',
          'varbinary(max)'
        ].freeze

        private

        def explicit_primary_key_default?(column)
          column.is_primary? && !column.is_identity?
        end

        def schema_limit(column)
          return if SQLSEVER_NO_LIMIT_TYPES.include?(column.sql_type)
          super
        end

        def schema_collation(column)
          return unless column.collation
          column.collation if column.collation != collation
        end

        def default_primary_key?(column)
          super && column.is_primary? && column.is_identity?
        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
activerecord-jdbcsqlserver-adapter-51.1.0 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb
activerecord-jdbcsqlserver-adapter-51.0.1 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb
activerecord-jdbcsqlserver-adapter-51.0.0 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb
activerecord-sqlserver-adapter-5.1.6 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb
activerecord-sqlserver-adapter-5.1.5 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb
activerecord-sqlserver-adapter-5.1.2 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb
activerecord-sqlserver-adapter-5.1.1 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb
activerecord-sqlserver-adapter-5.1.0 lib/active_record/connection_adapters/sqlserver/schema_dumper.rb