當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Schema\Blueprint類代碼示例

本文整理匯總了PHP中Illuminate\Database\Schema\Blueprint的典型用法代碼示例。如果您正苦於以下問題:PHP Blueprint類的具體用法?PHP Blueprint怎麽用?PHP Blueprint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Blueprint類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Illuminate\Database\Schema\Blueprint類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。