Documentation home page

cfrails
Component Migration

Migration

Creates tables / columns as defined by the derivative components

Method Summary
public any init()
          Initializes the newly created object of class Migration
public any create_table(string tableName, struct columns, [string orderedColumnsList=""])
public any down()
          This method must be overridden by the derivative components, and it should be used to drop the table
public any drop_table(string tableName)
          Drops the specified table
public any up()
          This method must be overridden by the derivative components, and it should be used to create the table
 

Method Detail

create_table

public any create_table(string tableName, struct columns, [string orderedColumnsList=""])
Parameters:
string tableName - The name of the table to be created
struct columns - A structure where the keys are the column names, and the values are their types.
[string orderedColumnsList=""] - A list of the columns' names in the order in which they should be created.

down

public any down()
This method must be overridden by the derivative components, and it should be used to drop the table


drop_table

public any drop_table(string tableName)
Drops the specified table

Parameters:
string tableName - The name of the table to be dropped

init

public any init()
Initializes the newly created object of class Migration


up

public any up()
This method must be overridden by the derivative components, and it should be used to create the table