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


PHP Builder::hasTable方法代碼示例

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


在下文中一共展示了Builder::hasTable方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: runTestMigrations

 /**
  * Run migrations for tables only used for testing purposes.
  *
  * @return void
  */
 protected function runTestMigrations()
 {
     include_once __DIR__ . '/../resources/migrations/create_adjustments_table.php.stub';
     (new \CreateAdjustmentsTable())->up();
     if (!$this->schema->hasTable('fruits')) {
         $this->schema->create('fruits', function (Blueprint $table) {
             $table->increments('id');
             $table->string('name');
             $table->integer('price');
         });
     }
 }
開發者ID:mangopixel,項目名稱:laravel-adjuster,代碼行數:17,代碼來源:TestCase.php

示例2: dropInstance

 /**
  * instance 내 모든 데이터 삭제
  *
  * @param string $instanceId instance identifier
  * @return void
  */
 public function dropInstance($instanceId)
 {
     if ($this->isEnable($instanceId) === true) {
         if ($this->schema->hasTable($this->getTable($instanceId)) === true) {
             $this->schema->drop($this->getTable($instanceId));
         }
     }
     $this->repo->dropInstance($instanceId);
 }
開發者ID:mint-soft-com,項目名稱:xpressengine,代碼行數:15,代碼來源:DivisionDecorator.php

示例3: dropColumn

 /**
  * Drop a column.
  *
  * @param           $table
  * @param FieldType $type
  */
 public function dropColumn($table, FieldType $type)
 {
     $schema = $type->getSchema();
     if (!$this->schema->hasTable($table)) {
         return;
     }
     $this->schema->table($table, function (Blueprint $table) use($schema) {
         $schema->dropColumn($table);
     });
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:16,代碼來源:AssignmentSchema.php

示例4: cleanup

 /**
  * Clean up abandoned streams.
  */
 public function cleanup()
 {
     /* @var StreamInterface $stream */
     foreach ($this->model->all() as $stream) {
         if (!$this->schema->hasTable($stream->getEntryTableName())) {
             $this->delete($stream);
         }
     }
     $translations = $this->model->getTranslationModel();
     $translations->leftJoin('streams_streams', 'streams_streams_translations.stream_id', '=', 'streams_streams.id')->whereNull('streams_streams.id')->delete();
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:14,代碼來源:StreamRepository.php

示例5: runTestMigrations

 /**
  * Run migrations for tables only used for testing purposes.
  *
  * @return void
  */
 protected function runTestMigrations()
 {
     if (!$this->schema->hasTable('fruits')) {
         $this->schema->create('fruits', function (Blueprint $table) {
             $table->increments('id');
             $table->string('name');
             $table->integer('price');
             $table->boolean('is_rotten');
             $table->timestamps();
         });
     }
 }
開發者ID:flugger,項目名稱:laravel-responder,代碼行數:17,代碼來源:TestCase.php

示例6: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if ($connection = Capsule::connection($this->getConnection())) {
         $connection->useDefaultSchemaGrammar();
     } else {
         $app = app();
         $connection = $app['db']->connection($this->getConnection());
     }
     $schema = new Schema($connection);
     if (!$schema->hasTable('salesforce_tokens')) {
         $schema->create('salesforce_tokens', function (Blueprint $table) {
             $table->bigIncrements('id');
             $table->string('access_token');
             $table->string('refresh_token');
             $table->string('instance_base_url');
             $table->bigInteger('user_id');
             $table->datetime('expires')->nullable();
             $table->timestamps();
             $table->softDeletes();
         });
     }
 }
開發者ID:frankkessler,項目名稱:salesforce-laravel-oauth2-rest,代碼行數:27,代碼來源:salesforce.php

示例7: hasTable

 /**
  * Determine if the given table exists.
  *
  * @param string $table
  * @return bool 
  * @static 
  */
 public static function hasTable($table)
 {
     return \Illuminate\Database\Schema\Builder::hasTable($table);
 }
開發者ID:poovarasanvasudevan,項目名稱:voice-app,代碼行數:11,代碼來源:_ide_helper.php

示例8: createIfNotExists

 public function createIfNotExists($table, Closure $callback, Builder $builder)
 {
     if (!$builder->hasTable($table)) {
         $builder->create($table, $callback);
     }
 }
開發者ID:carlosafonso,項目名稱:laravel-goodies,代碼行數:6,代碼來源:Migration.php

示例9: createGalleryThumbnailTable

 protected function createGalleryThumbnailTable(Builder $schema)
 {
     if ($schema->hasTable('board_gallery_thumbs') === false) {
         $schema->create('board_gallery_thumbs', function (Blueprint $table) {
             $table->engine = "InnoDB";
             $table->string('targetId', 255);
             $table->string('boardThumbnailFileId', 255);
             $table->string('boardThumbnailExternalPath', 255);
             $table->string('boardThumbnailPath', 255);
             $table->primary(array('targetId'));
         });
     }
 }
開發者ID:xpressengine,項目名稱:plugin-board,代碼行數:13,代碼來源:plugin.php

示例10: hasTable

 /**
  * Determine if the given table exists.
  *
  * @param  string $table
  *
  * @return bool
  */
 public function hasTable($table)
 {
     return static::$schema->hasTable($table);
 }
開發者ID:formula9,項目名稱:framework,代碼行數:11,代碼來源:Schema.php


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