2014-01-14 65 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")) 
    ) 
)); 

希望這將是幫助別人:)