Module: DbAgile::Contract::Schema::TransactionDriven

Included in:
Utils::Full
Defined in:
lib/dbagile/contract/schema/transaction_driven.rb

Instance Method Summary collapse

Instance Method Details

#add_columns(transaction, table_name, columns) ⇒ Boolean

Adds some columns to a table

Parameters:

  • transaction (DbAgile::Core::Transaction)

    the current transaction

  • table_name (Symbol)

    the name of a table

  • columns (Hash)

    column definitions

Returns:

  • (Boolean)

    true to indicate that everything is fine



45
46
47
# File 'lib/dbagile/contract/schema/transaction_driven.rb', line 45

def add_columns(transaction, table_name, columns)
  Kernel.raise NotImplementedError
end

#create_table(transaction, table_name, columns) ⇒ Hash

Creates a table with some columns.

Parameters:

  • transaction (DbAgile::Core::Transaction)

    the current transaction

  • table_name (Symbol)

    the name of a table

  • a (Hash)

    table heading

Returns:

  • (Hash)

    the actual table heading that has been created



16
17
18
# File 'lib/dbagile/contract/schema/transaction_driven.rb', line 16

def create_table(transaction, table_name, columns)
  Kernel.raise NotImplementedError
end

#drop_table(transaction, table_name) ⇒ Boolean

Drops a table

Parameters:

Returns:

  • (Boolean)

    true to indicate that everything is fine



29
30
31
# File 'lib/dbagile/contract/schema/transaction_driven.rb', line 29

def drop_table(transaction, table_name)
  Kernel.raise NotImplementedError
end

#key!(transaction, table_name, columns) ⇒ Boolean

Make columns be a candidate key for the table.

Parameters:

  • transaction (DbAgile::Core::Transaction)

    the current transaction

  • table_name (Symbol)

    the name of a table

  • columns (Array<Symbol>)

    column names

Returns:

  • (Boolean)

    true to indicate that everything is fine



61
62
63
# File 'lib/dbagile/contract/schema/transaction_driven.rb', line 61

def key!(transaction, table_name, columns)
  Kernel.raise NotImplementedError
end