本文整理汇总了PHP中Illuminate\Database\Schema\Blueprint类的典型用法代码示例。如果您正苦于以下问题:PHP Blueprint类的具体用法?PHP Blueprint怎么用?PHP Blueprint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Blueprint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _schema_profilemodel
public static function _schema_profilemodel(\Illuminate\Database\Schema\Blueprint $table)
{
$table->unsignedInteger('user_id');
$table->text('avatar');
$table->index(['user_id']);
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:7,代码来源:ProfileModel.php
示例2: create
protected function create(Blueprint $table)
{
$table->create();
$table->string('conf_name', 255)->default('');
$table->text('conf_value')->nullable();
$table->primary('conf_name');
}
开发者ID:fluxbb,项目名称:core,代码行数:7,代码来源:Config.php
示例3: _schema_tagModel
public static function _schema_tagModel(\Illuminate\Database\Schema\Blueprint $table)
{
$table->text('name')->nullable();
$table->string('type')->default('default');
$table->morphs('taggable');
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:7,代码来源:TagModel.php
示例4: create
protected function create(Blueprint $table)
{
$table->create();
$table->integer('user_id')->unsigned();
$table->integer('topic_id')->unsigned();
$table->primary(array('user_id', 'topic_id'));
}
开发者ID:fluxbb,项目名称:core,代码行数:7,代码来源:TopicSubscriptions.php
示例5: create
protected function create(Blueprint $table)
{
$table->create();
$table->increments('id');
$table->string('title', 50)->default('');
$table->integer('parent_group_id')->unsigned()->nullable();
}
开发者ID:fluxbb,项目名称:core,代码行数:7,代码来源:Groups.php
示例6: addConfirmationColumns
/**
* Add confirmation columns.
*
* @param \Illuminate\Database\Schema\Blueprint $table
*/
private function addConfirmationColumns(Blueprint $table)
{
if (UserConfirmator::isEnabled()) {
$table->boolean('is_confirmed')->default(0);
$table->string('confirmation_code', UserConfirmator::getLength())->nullable();
$table->timestamp('confirmed_at')->nullable();
}
}
开发者ID:ARCANEDEV,项目名称:LaravelAuth,代码行数:13,代码来源:2015_01_01_000001_create_auth_users_table.php
示例7: build
/**
* Execute the blueprint to build / modify the table.
*
* @param \Cooperl\Database\DB2\Schema\Blueprint $blueprint
* @return void
*/
protected function build(Blueprint $blueprint)
{
$schemaTable = explode(".", $blueprint->getTable());
if (count($schemaTable) > 1) {
$this->connection->setCurrentSchema($schemaTable[0]);
}
$blueprint->build($this->connection, $this->grammar);
$this->connection->resetCurrentSchema();
}
开发者ID:jacksonwebservices,项目名称:laravel-iseries,代码行数:15,代码来源:Builder.php
示例8: getInheritedTables
/**
* Compile the blueprint's inherits definitions.
*
* @param BaseBlueprint $blueprint
* @return array
*/
protected function getInheritedTables(BaseBlueprint $blueprint)
{
$tables = [];
foreach ($blueprint->getInheritedTables() as $table) {
//$sql = $this->wrapTable($table);
$tables[] = $table;
}
return $tables;
}
开发者ID:jumper423,项目名称:laravel-postgresql-inherit,代码行数:15,代码来源:PostgresGrammar.php
示例9: buildDynamicTable
protected function buildDynamicTable(Blueprint $table)
{
$reference_column = $this->getDynamicType() . '_id';
$reference_table = $this->getDynamicType() . 's';
$reference_index = 'FK_' . $this->getDynamicTableName() . '_' . $reference_column . '_' . $reference_table;
$table->increments('id');
$table->integer($reference_column)->unsigned()->nullable();
$table->foreign($reference_column, $reference_index)->references('id')->on($reference_table)->onUpdate('CASCADE')->onDelete('SET NULL');
$table->timestamps();
}
开发者ID:sodacms,项目名称:sodacms,代码行数:10,代码来源:AbstractDynamicType.php
示例10: testIndexDefaultNames
public function testIndexDefaultNames()
{
$blueprint = new Blueprint('users');
$blueprint->unique(array('foo', 'bar'));
$commands = $blueprint->getCommands();
$this->assertEquals('users_foo_bar_unique', $commands[0]->index);
$blueprint = new Blueprint('users');
$blueprint->index('foo');
$commands = $blueprint->getCommands();
$this->assertEquals('users_foo_index', $commands[0]->index);
}
开发者ID:hochanh,项目名称:Bootsoft-Bowling,代码行数:11,代码来源:SchemaBlueprintTest.php
示例11: create
protected function create(Blueprint $table)
{
$table->create();
$table->string('id', 40);
$table->integer('user_id')->unsigned()->default(1);
$table->integer('created')->unsigned()->default(0);
$table->integer('last_activity')->unsigned()->default(0);
$table->string('last_ip', 200)->default('0.0.0.0');
$table->text('payload');
$table->primary('id');
$table->index('user_id');
}
开发者ID:fluxbb,项目名称:core,代码行数:12,代码来源:Sessions.php
示例12: getQualifiedAutoIncrementColumn
/**
* get qualified autoincrement column
*
* @param Blueprint $blueprint
* @return Fluent|null
*/
public function getQualifiedAutoIncrementColumn(Blueprint $blueprint)
{
$columns = $blueprint->getColumns();
// search for primary key / autoIncrement column
foreach ($columns as $column) {
// if column is autoIncrement set the primary col name
if ($column->autoIncrement) {
return $column;
}
}
return null;
}
开发者ID:hadimazalan,项目名称:laravel-oci8,代码行数:18,代码来源:OracleAutoIncrementHelper.php
示例13: _schema_LoginableTrait
/**
* @param Blueprint $table
* @return Blueprint
*/
public static function _schema_LoginableTrait(Blueprint $table)
{
$table->string('password')->nullable();
$table->rememberToken('remember_token');
$table->dateTime('last_login')->nullable();
$table->string('last_ip')->nullable();
$table->integer('fails')->default(0);
$table->enum('is_banned', [0, 1])->default(0);
$table->text('ban_reason')->nullable();
$table->enum('locked_screen', [0, 1])->default(0);
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:16,代码来源:LoginableTrait.php
示例14: describeSchema
/**
* Give me the tools and I will tell you what my schema is...
*
* @param Blueprint $table The blueprint for the database table.
* @return Blueprint The designed database table schema.
*/
public static function describeSchema(Blueprint $table)
{
$table->increments('id');
$table->string('uuid', 36);
$table->integer('playhead')->unsigned();
$table->text('metadata');
$table->text('payload');
$table->string('recorded_on', 32);
$table->text('type');
$table->unique(['uuid', 'playhead']);
return $table;
}
开发者ID:cminor-io,项目名称:laravel-on-broadway-eventstore,代码行数:18,代码来源:LaravelStoreSchema.php
示例15: getBlueprint
/**
* @return Blueprint|null
*/
public function getBlueprint()
{
if ($this->hasPivotTable()) {
$left = $this->buildLeftColumnName();
$right = $this->getColumn();
$table = $this->getTable();
$blueprint = new Blueprint($table);
$blueprint->increments('id');
$blueprint->integer($left);
$blueprint->integer($right);
return $blueprint;
}
}
开发者ID:boyhagemann,项目名称:model,代码行数:16,代码来源:Relation.php
示例16: _schema_imageModel
public static function _schema_imageModel(Blueprint $table)
{
$table->string('image');
$table->string('url');
$table->unsignedInteger('order')->default(0);
$table->string('type')->default('default');
$table->integer('width');
$table->integer('height');
$table->morphs('imageable');
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:11,代码来源:ImageModel.php
示例17: _schema_activityTrait
public static function _schema_activityTrait(\Illuminate\Database\Schema\Blueprint $table)
{
$table->dateTime('activity_start')->nullable();
$table->dateTime('activity_end')->nullable();
$table->dateTime('signup_start')->nullable();
$table->dateTime('signup_end')->nullable();
$table->text('activity_title')->nullable();
$table->longText('activity_content')->nullable();
$table->morphs('owner');
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:11,代码来源:ActivityTrait.php
示例18: _schema_UserModel
public static function _schema_UserModel(Blueprint $table)
{
$table->string('email')->nullable()->label('邮箱');
$table->string('mobile')->nullable()->label('手机号码');
$table->string('username')->nullable()->label('姓名');
$table->string('nickname')->nullable()->label('昵称');
$table->enum('gender', ['未填' => '未填', '男' => '男', '女' => '女'])->default('未填')->label('性别');
$table->string('avatar')->nullable()->label('头像');
$table->date('birthday')->nullable()->label('生日');
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:11,代码来源:UserModelBase.php
示例19: _schema_multiStatusTrait
public static function _schema_multiStatusTrait(\Illuminate\Database\Schema\Blueprint $table)
{
$status = static::$AllowedStatus;
$default = $status[0];
$table->enum('status', $status)->default($default);
if (isset(static::$StatusDateTime)) {
foreach (static::$StatusDateTime as $column) {
if (!in_array($column, ['created_at', 'updated_at', 'deleted_at'])) {
$table->dateTime($column)->nullable();
}
}
}
$table->index(['status']);
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:15,代码来源:MultiStatusTrait.php
示例20: _schema
/**
* @param Blueprint $table
* @return Blueprint
*/
public static function _schema(Blueprint $table)
{
$class = get_called_class();
$ref = new \ReflectionClass($class);
$methods = $ref->getMethods(\ReflectionMethod::IS_STATIC);
$table->engine = 'InnoDB';
$table->increments('id');
foreach ($methods as $method) {
if (preg_match('/^_schema_.*/', $method->name)) {
$name = $method->name;
$table = static::$name($table);
}
}
$table->softDeletes();
$table->timestamps();
return $table;
}
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:21,代码来源:BaseModel.php
注:本文中的Illuminate\Database\Schema\Blueprint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论