Sha256: 95a447b45d027cc416f182a5110012faf3ce0049344c7e95fe44ada9d4104ce7

Contents?: true

Size: 1017 Bytes

Versions: 2

Compression:

Stored size: 1017 Bytes

Contents

require 'dm-constraints/adapters/dm-do-adapter'

module DataMapper
  module Constraints
    module Adapters

      module MysqlAdapter

        include DataObjectsAdapter

        module SQL
        private

          ##
          # MySQL specific query to drop a foreign key
          #
          # @param storage_name [String]
          #   name of table to constrain
          # @param constraint_name [String]
          #   name of foreign key constraint
          #
          # @return [String]
          #   SQL DDL Statement to destroy a constraint
          #
          # @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

2 entries across 2 versions & 1 rubygems

Version Path
dm-constraints-1.1.0 lib/dm-constraints/adapters/dm-mysql-adapter.rb
dm-constraints-1.1.0.rc3 lib/dm-constraints/adapters/dm-mysql-adapter.rb