$this->assertEquals('`foo` int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY', $pkColumn->toSql());
}
+ public function testCreateTableCompositePk()
+ {
+ $table = $this->_conn->createTable('testings', array('primaryKey' => array('a_id', 'b_id')));
+ $table->column('a_id', 'integer');
+ $table->column('b_id', 'integer');
+ $table->end();
+
+ $pk = $this->_conn->primaryKey('testings');
+ $this->assertEquals(array('a_id', 'b_id'), $pk->columns);
+ }
+
public function testCreateTableForce()
{
$this->_createTestTable('sports');
$this->assertEquals('`foo` int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY', $pkColumn->toSql());
}
+ public function testCreateTableCompositePk()
+ {
+ $table = $this->_conn->createTable('testings', array('primaryKey' => array('a_id', 'b_id')));
+ $table->column('a_id', 'integer');
+ $table->column('b_id', 'integer');
+ $table->end();
+
+ $pk = $this->_conn->primaryKey('testings');
+ $this->assertEquals(array('a_id', 'b_id'), $pk->columns);
+ }
+
public function testCreateTableForce()
{
$this->_createTestTable('sports');
$this->assertEquals('"foo" serial primary key', $pkColumn->toSql());
}
+ public function testCreateTableCompositePk()
+ {
+ $table = $this->_conn->createTable('testings', array('primaryKey' => array('a_id', 'b_id')));
+ $table->column('a_id', 'integer');
+ $table->column('b_id', 'integer');
+ $table->end();
+
+ $pk = $this->_conn->primaryKey('testings');
+ $this->assertEquals(array('a_id', 'b_id'), $pk->columns);
+ }
+
public function testCreateTableForce()
{
$this->_createTestTable('sports');
$this->assertEquals('"foo" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL', $pkColumn->toSql());
}
+ public function testCreateTableCompositePk()
+ {
+ $table = $this->_conn->createTable('testings', array('primaryKey' => array('a_id', 'b_id')));
+ $table->column('a_id', 'integer');
+ $table->column('b_id', 'integer');
+ $table->end();
+
+ $pk = $this->_conn->primaryKey('testings');
+ $this->assertEquals(array('a_id', 'b_id'), $pk->columns);
+ }
+
public function testCreateTableForce()
{
$this->_createTestTable('sports');