Swoole\Model::createTable PHP Method

createTable() public method

建立表,必须在Model类中,指定create_sql
public createTable ( ) : boolean
return boolean
    function createTable()
    {
        if ($this->create_sql) {
            return $this->db->query($this->create_sql);
        } else {
            return false;
        }
    }

Usage Example

Example #1
0
 function createTable()
 {
     $this->model->createTable();
 }