Skip to content

themusicman/Blacksmith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blacksmith (BETA)

A MySQL database manipulation module for Kohana 3

Create a table

$blacksmith = Blacksmith::create();
$table = $blacksmith->table(Blacksmith_Table::IF_NOT_EXISTS, 'people');
$table->increments('id');
$table->string('email', 100)->default_value('example@example.com');
$table->string('password', 50);
$blacksmith->forge();

Alter/Modify a column

$blacksmith = Blacksmith::alter();
$table = $blacksmith->table('people');
$table->modify_column()->string('password', 255);
$blacksmith->forge();

Drop a column

$blacksmith = Blacksmith::alter();
$table = $blacksmith->table('people');
$table->drop_column('password');
$blacksmith->forge();

Alter/Add a column

$blacksmith = Blacksmith::alter();
$table = $blacksmith->table('people');
$table->add_column()->string('password');
$blacksmith->forge();

Drop a table

$blacksmith = Blacksmith::drop();
$blacksmith->table(Blacksmith_Table::IF_EXISTS, 'people');
$blacksmith->forge();

About

A MySQL database manipulation module for Kohana 3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages