當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。