diff --git a/src/db/Table.php b/src/db/Table.php index d014f4f..513ddd7 100644 --- a/src/db/Table.php +++ b/src/db/Table.php @@ -15,18 +15,61 @@ use Phinx\Db\Table\Column; class Table extends \Phinx\Db\Table { + /** + * 设置id + * @param $id + * @return $this + */ public function setId($id) { $this->options['id'] = $id; return $this; } + /** + * 设置主键 + * @param $key + * @return $this + */ public function setPrimaryKey($key) { $this->options['primary_key'] = $key; return $this; } + /** + * 设置引擎 + * @param $engine + * @return $this + */ + public function setEngine($engine) + { + $this->options['engine'] = $engine; + return $this; + } + + /** + * 设置表注释 + * @param $comment + * @return $this + */ + public function setComment($comment) + { + $this->options['comment'] = $comment; + return $this; + } + + /** + * 设置排序比对方法 + * @param $collation + * @return $this + */ + public function setCollation($collation) + { + $this->options['collation'] = $collation; + return $this; + } + public function addTimestamps($createdAtColumnName = 'create_time', $updatedAtColumnName = 'update_time') { return parent::addTimestamps($createdAtColumnName, $updatedAtColumnName);