public function test_create_table() { $blacksmith = Blacksmith::create(); $table = $blacksmith->table(Blacksmith_Table::IF_NOT_EXISTS, 'people'); $table->increments('id'); $table->string('email', 100)->default_value('*****@*****.**'); $table->string('password', 50); $create_sql = $blacksmith->sql(); $this->assertEquals($create_sql, "CREATE TABLE IF NOT EXISTS `people` (`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `email` VARCHAR(100) DEFAULT '*****@*****.**', `password` VARCHAR(50), PRIMARY KEY (`id`))"); }
public function __construct() { $this->_db_prefix = Database::instance('default')->table_prefix(); $this->_db = Database::instance(); $this->_bs = Blacksmith::alter(); }
public function __construct() { $this->_db_prefix = core::config('database.default.table_prefix'); $this->_db = Database::instance(); $this->_bs = Blacksmith::alter(); }