class Baza::Driver::Mysql::ForeignKey

Public Class Methods

new(args) click to toggle source
# File lib/baza/driver/mysql/foreign_key.rb, line 2
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

Public Instance Methods

drop() click to toggle source
# File lib/baza/driver/mysql/foreign_key.rb, line 12
def drop
  @db.query("
    ALTER TABLE #{@db.quote_table(table_name)}
    DROP FOREIGN KEY #{@db.quote_table(name)}
  ")
  true
end