当前位置: 首页>>代码示例>>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;未经允许,请勿转载。