当前位置: 首页>>代码示例>>PHP>>正文


PHP Blueprint::primary方法代码示例

本文整理汇总了PHP中Illuminate\Database\Schema\Blueprint::primary方法的典型用法代码示例。如果您正苦于以下问题:PHP Blueprint::primary方法的具体用法?PHP Blueprint::primary怎么用?PHP Blueprint::primary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Database\Schema\Blueprint的用法示例。


在下文中一共展示了Blueprint::primary方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例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: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->integer('group_id')->unsigned();
     $table->integer('forum_id')->unsigned();
     $table->boolean('read_forum')->default(true);
     $table->boolean('post_replies')->default(true);
     $table->boolean('post_topics')->default(true);
     $table->primary(array('group_id', 'forum_id'));
 }
开发者ID:fluxbb,项目名称:core,代码行数:10,代码来源:ForumPerms.php

示例4: 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

示例5: testAddingPrimaryKey

 public function testAddingPrimaryKey()
 {
     $blueprint = new Blueprint('users');
     $blueprint->primary('foo', 'bar');
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table "users" add constraint bar primary key ("foo")', $statements[0]);
 }
开发者ID:hochanh,项目名称:Bootsoft-Bowling,代码行数:8,代码来源:SqlServerSchemaGrammarTest.php

示例6: modifyIncrement

 /**
  * Get the SQL for an auto-increment column modifier.
  *
  * @param  \Illuminate\Database\Schema\Blueprint $blueprint
  * @param  \Illuminate\Support\Fluent $column
  * @return string|null
  */
 protected function modifyIncrement(Blueprint $blueprint, Fluent $column)
 {
     if (in_array($column->type, $this->serials) && $column->autoIncrement) {
         $blueprint->primary($column->name);
     }
 }
开发者ID:rafael-renan-pacheco,项目名称:laravel-oci8,代码行数:13,代码来源:OracleGrammar.php

示例7: modifyIncrement

 /**
  * Get the SQL for an auto-increment column modifier.
  *
  * @param  Illuminate\Database\Schema\Blueprint  $blueprint
  * @param  Illuminate\Support\Fluent  $column
  * @return string|null
  */
 protected function modifyIncrement(Blueprint $blueprint, Fluent $column)
 {
     if ($column->type == 'integer' and $column->autoIncrement) {
         $blueprint->primary($column->name);
     }
 }
开发者ID:crazycodr,项目名称:laravel-oci8,代码行数:13,代码来源:OracleGrammar.php

示例8: primary

 /**
  * Store list primary to create i18n
  *
  * @param array|string $columns
  * @param null         $name
  *
  * @return \Illuminate\Support\Fluent
  */
 public function primary($columns, $name = null)
 {
     $this->addCachePrimary($columns);
     return parent::primary($columns, $name);
 }
开发者ID:tuanlq11,项目名称:dbi18n,代码行数:13,代码来源:I18NBlueprint.php


注:本文中的Illuminate\Database\Schema\Blueprint::primary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。