Skip to content

Commit 7cec5b7

Browse files
author
Chris Cho
committed
PRR fixes
1 parent 205961b commit 7cec5b7

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

docs/eloquent-models/schema-builder.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,16 @@ following changes to perform the schema changes on your MongoDB database:
6363

6464
- Replace the ``Illuminate\Database\Schema\Blueprint`` import with
6565
``MongoDB\Laravel\Schema\Blueprint`` if it is referenced in your migration
66-
- Specify ``mongodb`` in the ``$connection`` field
6766
- Use only commands and syntax supported by {+odm-short+}
6867

6968
.. tip::
7069

71-
Make sure you set ``DB_CONNECTION=mongodb`` in your ``.env`` configuration
72-
file so that PHP artisan performs the migration on the correct database.
70+
If your default database connection is set to anything other than your
71+
MongoDB database, update the following items so that PHP artisan performs
72+
the migration on the correct database::
73+
74+
- Specify ``mongodb`` in the ``$connection`` field of your migration class
75+
- Set ``DB_CONNECTION=mongodb`` in your ``.env`` configuration file
7376

7477
The following example migration class contains the following methods:
7578

docs/includes/schema-builder/astronauts_migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
return new class extends Migration
1010
{
11-
protected $connect = 'mongodb';
11+
protected $connection = 'mongodb';
1212

1313
/**
1414
* Run the migrations.

docs/includes/schema-builder/flights_migration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
return new class extends Migration
1010
{
11-
protected $connect = 'mongodb';
11+
protected $connection = 'mongodb';
1212

1313
public function up(): void
1414
{
1515
// begin create index
1616
Schema::create('flights', function (Blueprint $collection) {
1717
$collection->index('mission_type');
1818
$collection->index(['launch_location' => 1, 'launch_date' => -1]);
19-
$collection->unique('mission_id', null, null, ['name' => 'unique_mission_id_idx']);
19+
$collection->unique('mission_id', options: ['name' => 'unique_mission_id_idx']);
2020
});
2121
// end create index
2222
}

docs/includes/schema-builder/passengers_migration.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88

99
return new class extends Migration
1010
{
11-
protected $connect = 'mongodb';
11+
protected $connection = 'mongodb';
1212

1313
public function up(): void
1414
{
1515
// begin index options
1616
Schema::create('passengers', function (Blueprint $collection) {
17-
$collection->index('last_name', 'passengers_collation_idx', null, [
18-
'collation' => [ 'locale' => 'de@collation=phonebook', 'numericOrdering' => true ],
19-
]);
17+
$collection->index(
18+
'last_name',
19+
name: 'passengers_collation_idx',
20+
options: [
21+
'collation' => [ 'locale' => 'de@collation=phonebook', 'numericOrdering' => true ],
22+
],
23+
);
2024
});
2125
// end index options
2226
}

docs/includes/schema-builder/planets_migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
return new class extends Migration
1010
{
11-
protected $connect = 'mongodb';
11+
protected $connection = 'mongodb';
1212

1313
public function up(): void
1414
{

docs/includes/schema-builder/spaceports_migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
return new class extends Migration
1010
{
11-
protected $connect = 'mongodb';
11+
protected $connection = 'mongodb';
1212

1313
/**
1414
* Run the migrations.

docs/includes/schema-builder/stars_migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
return new class extends Migration
99
{
10-
protected $connect = 'mongodb';
10+
protected $connection = 'mongodb';
1111

1212
public function up(): void
1313
{

0 commit comments

Comments
 (0)