2014-01-14 35 views

回答

3

所以我已经找到了解决办法是这样的

$connection->createTable("robots", null, array(
     "columns" => array(
      new Column("id", array(
       "type" => Column::TYPE_INTEGER, 
       "size" => 10, 
       "notNull"  => true, 
       "autoIncrement" => true, 
      )), 
      new Column("name", array(
       "type" => Column::TYPE_VARCHAR, 
       "size" => 70, 
       "notNull" => true, 
      )), 
      new Column("year", array(
       "type" => Column::TYPE_INTEGER, 
       "size" => 11, 
       "notNull" => true, 
      )) 
    ), 
     "indexes" => array(
      new Index("PRIMARY", array("id")) 
    ) 
)); 

希望这将是帮助别人:)