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


PHP Schema::connection方法代码示例

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


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

示例1: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::connection('ff-actions-calc')->drop('terminals');
     Schema::connection('ff-actions-calc')->drop('events');
     Schema::connection('ff-actions-calc')->drop('rules');
     Schema::connection('ff-actions-calc')->drop('signals');
 }
开发者ID:fintech-fab,项目名称:actions-calc,代码行数:12,代码来源:2014_07_01_154552_tables_for_actions-calc.php

示例2: testArtisanRefresh

 public function testArtisanRefresh()
 {
     $this->executeDefaultMigration()->call('migrate:refresh', array('--type' => $this->testType));
     $this->resetLaravelPaths();
     $this->assertTrue(Schema::connection('artisantest_' . $this->testType)->hasTable('test_tbl'));
     $entry = $this->app['db']->connection('artisantest_' . $this->testType)->table('test_tbl')->where('id', 1)->first();
     $this->assertEquals($this->testType, $entry->test_val);
 }
开发者ID:codengine,项目名称:laravel-custom-migrations,代码行数:8,代码来源:ArtisanDefaultMigrationTest.php

示例3: createSchema

 /**
  * Create Table Schema.
  *
  * @param  \Closure  $blueprint
  */
 protected function createSchema(Closure $blueprint)
 {
     if (!$this->hasConnection()) {
         Schema::create($this->getTableName(), $blueprint);
         return;
     }
     Schema::connection($this->connection)->create($this->getTableName(), $blueprint);
 }
开发者ID:ChenPeiyuan,项目名称:student-infomation-manager,代码行数:13,代码来源:Migration.php

示例4: up

 /**
  * Run the migrations.
  */
 public function up()
 {
     Schema::connection($this->connection)->create($this->table, function (Blueprint $table) {
         $table->string('email')->index();
         $table->string('token')->index();
         $table->timestamp('created_at')->nullable();
     });
 }
开发者ID:ARCANEDEV,项目名称:LaravelAuth,代码行数:11,代码来源:2015_01_01_000008_create_auth_password_resets_table.php

示例5: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::connection('ff-qiwi-gate')->table('merchants_bills', function (Blueprint $table) {
         $table->dropColumn('lifetime');
     });
     Schema::connection('ff-qiwi-gate')->table('merchants_bills', function (Blueprint $table) {
         $table->string('lifetime')->after('comment');
     });
 }
开发者ID:fintech-fab,项目名称:qiwi-gate,代码行数:14,代码来源:2014_04_30_213959_change_type_column_lifetime_to_timestampe.php

示例6: up

 /**
  * Run the migrations.
  */
 public function up()
 {
     Schema::connection($this->connection)->create($this->table, function (Blueprint $table) {
         $table->integer('permission_id')->unsigned();
         $table->integer('role_id')->unsigned();
         $table->timestamps();
         $table->primary(['permission_id', 'role_id']);
     });
 }
开发者ID:bztrn,项目名称:LaravelAuth,代码行数:12,代码来源:2015_01_01_000006_create_auth_permission_role_pivot_table.php

示例7: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::connection('ff-qiwi-shop')->drop('orders_pay_return');
     Schema::connection('ff-qiwi-shop')->table('orders', function (Blueprint $table) {
         $table->string('statusReturn')->nullable()->after('status')->default(null);
     });
     Schema::connection('ff-qiwi-shop')->table('orders', function (Blueprint $table) {
         $table->dropColumn('idLastReturn');
     });
 }
开发者ID:fintech-fab,项目名称:qiwi-shop,代码行数:15,代码来源:2014_05_03_171357_qiwi_shop_pay_return_table.php

示例8: up

 /**
  * Run the migrations.
  */
 public function up()
 {
     Schema::connection($this->connection)->create($this->table, function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->string('slug');
         $table->string('description')->nullable();
         $table->timestamps();
         $table->unique('slug');
     });
 }
开发者ID:bztrn,项目名称:LaravelAuth,代码行数:14,代码来源:2015_01_01_000003_create_auth_permissions_groups_table.php

示例9: executeSchema

 /**
  * Check if we need to run the schema
  * @return [type] [description]
  */
 public static function executeSchema()
 {
     $schema = Schema::connection('mysql');
     if (!$schema->hasTable('users')) {
         Schema::connection('mysql')->create('users', function ($table) {
             $table->increments('id');
             $table->string('name');
             $table->timestamps();
         });
     }
 }
开发者ID:danielheyman,项目名称:TechDimeProjects,代码行数:15,代码来源:MysqlUser.php

示例10: executeSchema

 /**
  * Check if we need to run the schema
  * @return [type] [description]
  */
 public static function executeSchema()
 {
     $schema = Schema::connection('mysql');
     if (!$schema->hasTable('books')) {
         Schema::connection('mysql')->create('books', function ($table) {
             $table->string('title');
             $table->string('author_id');
             $table->timestamps();
         });
     }
 }
开发者ID:danielheyman,项目名称:TechDimeProjects,代码行数:15,代码来源:MysqlBook.php

示例11: up

 /**
  * Run the migrations.
  */
 public function up()
 {
     if ($this->isThrottlable()) {
         Schema::connection($this->connection)->create($this->table, function (Blueprint $table) {
             $table->increments('id');
             $table->integer('user_id')->unsigned()->nullable();
             $table->string('type');
             $table->string('ip')->nullable();
             $table->timestamps();
         });
     }
 }
开发者ID:bztrn,项目名称:LaravelAuth,代码行数:15,代码来源:2015_01_01_000007_create_auth_throttles_table.php

示例12: emptyDatabase

 /**
  * Delete all database tables.
  */
 private function emptyDatabase()
 {
     if (!$this->option('empty-database')) {
         return;
     }
     $this->info("Truncating {$this->connection} database.");
     $tableNames = Schema::connection($this->connection)->getConnection()->getDoctrineSchemaManager()->listTableNames();
     DB::connection($this->connection)->statement($this->sql->setForeignKeyChecks(false));
     foreach ($tableNames as $table) {
         Schema::connection($this->connection)->drop($table);
     }
     DB::connection($this->connection)->statement($this->sql->setForeignKeyChecks(true));
 }
开发者ID:antennaio,项目名称:laravel-codeception-dbdump,代码行数:16,代码来源:DbDump.php

示例13: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $data = $request->all();
     $userFields = Schema::connection('mysql')->getColumnListing('users');
     if (isset($data)) {
         $user = User::find($data['id']);
         foreach ($data as $key => $value) {
             if (in_array($key, $userFields)) {
                 $user[$key] = $value;
             }
         }
         $user->save();
     }
     return response()->json(array('success' => 'true'));
 }
开发者ID:guyjstitt,项目名称:RJL-Redux,代码行数:22,代码来源:UserController.php

示例14: __construct

 /**
  * Create a new Local gateway instance.
  *
  * @return void
  */
 public function __construct($connection = null)
 {
     if (null === $connection) {
         $connection = config('billing.gateways.local');
     }
     $this->connection = $connection;
     \Config::set('database.connections.billinglocal', Arr::get($connection, 'database'));
     $path = Arr::get($connection, 'database.database');
     if (!file_exists($path) && is_dir(dirname($path))) {
         touch($path);
     }
     if (!Schema::connection('billinglocal')->hasTable('customers')) {
         include_once 'Models/migration.php';
     }
 }
开发者ID:autocar,项目名称:laravel-billing,代码行数:20,代码来源:Gateway.php

示例15: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $data = $request->all();
     $noteFields = Schema::connection('mysql')->getColumnListing('notes');
     if (isset($data)) {
         $note = Note::find($id);
         if (in_array($data['name'], $noteFields)) {
             if ($this->utilityService->isDateField($data['name'])) {
                 $data['value'] = $this->utilityService->parseToMysqlDate($data['value']);
             }
             $note[$data['name']] = $data['value'];
         }
         $note->save();
     }
     return response()->json(array('note' => $note->toArray()));
 }
开发者ID:guyjstitt,项目名称:RJL-Redux,代码行数:23,代码来源:NoteController.php


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