Sha256: dd1afa150ec745e4a40e67e38b4c3dbdd143303bc7635f56890f618f92ab7754

Contents?: true

Size: 856 Bytes

Versions: 3

Compression:

Stored size: 856 Bytes

Contents

require 'data_mapper/constraints/adapters/do_adapter'

module DataMapper
  module Constraints
    module Adapters

      module MysqlAdapter

        include DataObjectsAdapter

        module SQL
        private

          ##
          # MySQL specific query to drop a foreign key
          #
          # @see DataMapper::Constraints::Adapters::DataObjectsAdapter#destroy_constraints_statement
          #
          # @api private
          def destroy_constraints_statement(storage_name, constraint_name)
            DataMapper::Ext::String.compress_lines(<<-SQL)
              ALTER TABLE #{quote_name(storage_name)}
              DROP FOREIGN KEY #{quote_name(constraint_name)}
            SQL
          end
        end

        include SQL

      end # module MysqlAdapter

    end # module Adapters
  end # module Constraints
end # module DataMapper

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dm-constraints-1.2.0 lib/data_mapper/constraints/adapters/mysql_adapter.rb
dm-constraints-1.2.0.rc2 lib/data_mapper/constraints/adapters/mysql_adapter.rb
dm-constraints-1.2.0.rc1 lib/data_mapper/constraints/adapters/mysql_adapter.rb