def add_foreign_key(from_table, to_table, is_required = false)
def remove_foreign_key(from_table, to_table)
def remove_foreign_key_column(from_table, col_name)
def define_foreign_key_column(from_table, from_column, to_table, to_column = "id")
# join_table = addresses_users
# must pass in the correct order, it won't order it for you
def create_join_table(table_one, table_two, fk = true)
def drop_join_table(table_one, table_two)
# reference table is a simple table with just an id and name column
# for each table passed in it will create add a foreign key
# relationship
def create_reference_table(tname, *referenced_by)
def drop_reference_table(tname, *referenced_by)
Install by:
./script/plugin install http://stonean.googlecode.com/svn/mysql_utils/trunk
Nothing spectacular, but may be useful to someone.

0 comments:
Post a Comment