Sha256: 3e2c377dcc9e10e3c3f15997524bcec8ff390fd8190e351ddc326ccfe04eca8a

Contents?: true

Size: 419 Bytes

Versions: 14

Compression:

Stored size: 419 Bytes

Contents

class Baza::Driver::Pg::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 CONSTRAINT #{@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/pg/foreign_key.rb
baza-0.0.34 lib/baza/driver/pg/foreign_key.rb
baza-0.0.33 lib/baza/driver/pg/foreign_key.rb
baza-0.0.32 lib/baza/driver/pg/foreign_key.rb
baza-0.0.31 lib/baza/driver/pg/foreign_key.rb
baza-0.0.30 lib/baza/driver/pg/foreign_key.rb
baza-0.0.29 lib/baza/driver/pg/foreign_key.rb
baza-0.0.28 lib/baza/driver/pg/foreign_key.rb
baza-0.0.27 lib/baza/driver/pg/foreign_key.rb
baza-0.0.26 lib/baza/driver/pg/foreign_key.rb
baza-0.0.25 lib/baza/driver/pg/foreign_key.rb
baza-0.0.24 lib/baza/driver/pg/foreign_key.rb
baza-0.0.23 lib/baza/driver/pg/foreign_key.rb
baza-0.0.22 lib/baza/driver/pg/foreign_key.rb