yiiapi/framework/db/schema/sqlite/CSqliteSchema.php
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* CSqliteSchema class file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright 2008-2013 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* CSqliteSchema is the class for retrieving metadata information from a SQLite (2/3) database.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @package system.db.schema.sqlite
* @since 1.0
*/
class CSqliteSchema extends CDbSchema
{
/**
* @var array the abstract column types mapped to physical column types.
* @since 1.1.6
*/
public $columnTypes=array(
'pk' => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
'bigpk' => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
'string' => 'varchar(255)',
'text' => 'text',
'integer' => 'integer',
'bigint' => 'integer',
'float' => 'float',
'decimal' => 'decimal',
'datetime' => 'datetime',
'timestamp' => 'timestamp',
'time' => 'time',
'date' => 'date',
'binary' => 'blob',
'boolean' => 'tinyint(1)',
'money' => 'decimal(19,4)',
);
/**
* Resets the sequence value of a table's primary key.
* The sequence will be reset such that the primary key of the next new row inserted
* will have the specified value or max value of a primary key plus one (i.e. sequence trimming).
* @param CDbTableSchema $table the table schema whose primary key sequence will be reset
* @param integer|null $value the value for the primary key of the next new row inserted.
* If this is not set, the next new row's primary key will have the max value of a primary
* key plus one (i.e. sequence trimming).
* @since 1.1
*/
public function resetSequence($table,$value=null)
{
if($table->sequenceName===null)
return;
if($value!==null)
$value=(int)($value)-1;
else
$value=(int)$this->getDbConnection()
->createCommand("SELECT MAX(`{$table->primaryKey}`) FROM {$table->rawName}")
后面还有 282 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
