无论你在哪找到”booklink”都要用你的项目的名字来代替他。用下面例子的结构。
<?php class BooklinkInstaller extends AkInstaller { function up_1(){ $this->createTable('books', // The table name must be plural. 'id,'. // This key must be in every table. 'col_1 string(10),'. // Columns have default characteristics. 'col_last' // The last column does not end with a "." ); } function down_1(){ $this->dropTables('books'); } } ?>
简单是一件好事… 列的类型选择如下
你使用的数据库的任何类型在这里是得到支持的,例如MYsql的varchar 或者 smallint 。 但是有一个警告:不要在MySql中使用tinyint,因为那样的话,他会被当作boolean类型。
在http://phplens.com/lens/adodb/docs-datadict.htm看一下如何定制列的选择。
./script/migrate Booklink install来建立一个文件。svn status?”,输入svn add <path>svn commit -m '建立books table' . 任何一个评论也许都会在-m之后。