Today I’ve added to db utils ability to create table similar to Laravel:
db()->utils()->create_table($name, function($table_helper) {
$table_helper
->small_int('actor_id', array('length' => 5, 'unsigned' => true, 'nullable' => false, 'auto_inc' => true))
->string('first_name', array('length' => 45, 'nullable' => false))
->string('last_name', array('length' => 45, 'nullable' => false))
->primary('actor_id')
->index('last_name', 'idx_actor_last_name')
->option('engine', 'InnoDB')
->option('charset', 'utf8')
;
});
Full list of supported column types as methods is here:
https://github.com/yfix/yf/blob/master/classes/db/yf_db_utils_helper_create_table.class.php
You can take look at the tests here:
https://github.com/yfix/yf/blob/master/.dev/tests/functional/db/class_db_real_utils_mysql.Test.php#L312