本文整理汇总了PHP中Schema::connection方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::connection方法的具体用法?PHP Schema::connection怎么用?PHP Schema::connection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schema
的用法示例。
在下文中一共展示了Schema::connection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql')->create('roles', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
});
}
示例2: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::connection('mysql2')->table('pacientes', function ($table) {
$table->timestamps();
});
}
示例3: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
/* We create the table more for testing reason, because every server should have a database */
if (!Schema::connection('player')->hasTable('player')) {
DB::connection('player')->unprepared(file_get_contents(__DIR__ . '/sql/player.sql'));
}
}
示例4: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//Remove the owner id as foreign key
Schema::connection('store')->table('loadouts', function (Blueprint $table) {
$table->dropForeign('owner_id');
});
}
示例5: isExtensionDriverReady
public static function isExtensionDriverReady()
{
$driver = config('admin.extension_driver');
$connectionName = config('admin.extension_drivers.database.connection');
$migrationsTable = config('admin.migrations');
return $driver == 'file' || $driver == 'database' && \Schema::connection($connectionName)->hasTable($migrationsTable);
}
示例6: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('ff-mt-em')->dropIfExists('payments');
Schema::connection('ff-mt-em')->dropIfExists('terminals');
Schema::connection('ff-mt-em')->dropIfExists('cities');
Schema::connection('ff-mt-em')->dropIfExists('fee');
}
示例7: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('account')->table('accounts', function (Blueprint $table) {
$table->dropColumn('created_at');
$table->dropColumn('updated_at');
});
}
开发者ID:huludini,项目名称:aura-kingdom-web,代码行数:12,代码来源:2016_01_28_225624_add_columns_to_accounts_table.php
示例8: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('webpanel')->drop('permission_role');
Schema::connection('webpanel')->drop('permissions');
Schema::connection('webpanel')->drop('role_user');
Schema::connection('webpanel')->drop('roles');
}
开发者ID:brucewu16899,项目名称:WebPanel-Core,代码行数:12,代码来源:2015_05_02_000000_webpanel_entrust_setup_tables.php
示例9: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection(DatabaseConnection::systemConnectionName())->table('ssl_hostnames', function (Blueprint $table) {
// domain relation
$table->bigInteger('hostname_id')->unsigned();
});
}
示例10: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql2')->create('estates', function (Blueprint $table) {
$table->increments('id');
$table->string('title')->nullable();
$table->string('price')->nullable();
$table->string('price2')->nullable();
$table->string('metrs')->nullable();
$table->string('metrs2')->nullable();
$table->string('floor')->nullable();
$table->string('floors')->nullable();
$table->string('room')->nullable();
$table->string('adress')->nullable();
$table->string('rayon')->nullable();
$table->string('street')->nullable();
$table->string('dom')->nullable();
$table->string('date')->nullable();
$table->text('desc')->nullable();
$table->text('info')->nullable();
$table->boolean('active')->default(true);
$table->timestamp('last_up')->nullable();
$table->timestamp('published_at')->nullable();
$table->boolean('published')->default(false);
$table->timestamps();
});
}
示例11: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//Delete the store_users_loadouts table
Schema::connection('store')->drop('users_loadouts');
//Delete the privacy and owner_id column from the loadouts table
Schema::connection('store')->table('loadouts', function (Blueprint $table) {
$table->dropColumn('privacy');
$table->dropColumn('owner_id');
});
// Create the store_users_items_loadouts table
Schema::connection('store')->create('users_items_loadouts', function (Blueprint $table) {
$table->engine = "InnoDB";
$table->increments('id');
$table->integer('useritem_id')->unsigned();
$table->integer('loadout_id')->unsigned();
$table->timestamps();
$table->foreign('useritem_id')->references('id')->on('users_items')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('loadout_id')->references('id')->on('loadouts')->onUpdate('cascade')->onDelete('cascade');
});
//Delete the store_items_loadouts table
Schema::connection('store')->drop('items_loadouts');
//Delete the privacy and owner_id column from the loadouts table
Schema::connection('store')->table('users', function (Blueprint $table) {
$table->dropColumn('token');
$table->dropColumn('ip');
});
}
示例12: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$builder = Schema::connection('mysql-chat');
$builder->drop('channels');
$builder->drop('messages');
$builder->drop('messages_private');
}
示例13: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$builder = Schema::connection('mysql-chat');
$builder->table('channels', function ($table) {
$table->dropColumn('moderated');
});
}
示例14: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$connections = Config::get('database.connections');
foreach ($connections as $connection) {
Schema::connection(self::$connection)->dropIfExists(self::$tableName);
}
}
示例15: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$builder = Schema::connection('mysql-mp');
$builder->drop('events');
$builder->drop('game_scores');
$builder->drop('games');
$builder->drop('matches');
}