class TableCopy::PG::Index

Attributes

columns[R]
name[R]
table[R]

Public Class Methods

new(table, name, columns) click to toggle source
# File lib/table_copy/pg/index.rb, line 6
def initialize(table, name, columns)
  @table   = table
  @name    = name
  @columns = columns
end

Public Instance Methods

create() click to toggle source
# File lib/table_copy/pg/index.rb, line 12
def create
  @create ||= "create index on #{table} using btree (#{columns.join(', ')})"
end
drop() click to toggle source
# File lib/table_copy/pg/index.rb, line 16
def drop
  @drop ||= "drop index if exists #{name}"
end