コード例 #1
0
 public function testGeneratesCreateTableSQLWithCheckConstraints()
 {
     $table = new Table('test');
     $table->addColumn('id', 'integer');
     $table->addColumn('check_max', 'integer', array('platformOptions' => array('max' => 10)));
     $table->addColumn('check_min', 'integer', array('platformOptions' => array('min' => 10)));
     $table->setPrimaryKey(array('id'));
     $this->assertEquals(array('CREATE TABLE test (id INTEGER NOT NULL, check_max INTEGER NOT NULL, check_min INTEGER NOT NULL, PRIMARY KEY(id), CHECK (check_max <= 10), CHECK (check_min >= 10))'), $this->_platform->getCreateTableSQL($table));
 }