Sha256: 988ac8ee06fdfe1a53242abdecf01ec5992443d4784f8cf3329377ad31016248

Contents?: true

Size: 427 Bytes

Versions: 14

Compression:

Stored size: 427 Bytes

Contents

class Baza::Driver::Mysql::ForeignKey < Baza::ForeignKey
  def initialize(args)
    @db = args.fetch(:db)

    data = args.fetch(:data)

    @column_name = data.fetch(:COLUMN_NAME)
    @name = data.fetch(:CONSTRAINT_NAME)
    @table_name = data.fetch(:TABLE_NAME)
  end

  def drop
    @db.query("
      ALTER TABLE `#{@db.escape_table(table_name)}`
      DROP FOREIGN KEY `#{@db.escape_table(name)}`
    ")
    true
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
baza-0.0.35 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.34 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.33 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.32 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.31 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.30 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.29 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.28 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.27 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.26 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.25 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.24 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.23 lib/baza/driver/mysql/foreign_key.rb
baza-0.0.22 lib/baza/driver/mysql/foreign_key.rb