Ejemplo n.º 1
0
 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`))");
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->_db_prefix = Database::instance('default')->table_prefix();
     $this->_db = Database::instance();
     $this->_bs = Blacksmith::alter();
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $this->_db_prefix = core::config('database.default.table_prefix');
     $this->_db = Database::instance();
     $this->_bs = Blacksmith::alter();
 }