Skip to content

Commit 976b33a

Browse files
committed
Changed the attach keyword to init keyword per @denizgolbas's keywording request.
1 parent c65aa08 commit 976b33a

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Schema::createHashPartitioned('[YourTableNameHere]', function (Blueprint $table)
8989
use ORPTech\MigrationPartition\Database\Schema\Blueprint;
9090
use ORPTech\MigrationPartition\Support\Facades\Schema;
9191

92-
Schema::attachRangePartition('[YourCreatedPartitionTableNameHere]', function (Blueprint $table) {}, '[SubfixForPartition]', '[StartDate]', '[EndDate]');
92+
Schema::initRangePartition('[YourCreatedPartitionTableNameHere]', function (Blueprint $table) {}, '[SubfixForPartition]', '[StartDate]', '[EndDate]');
9393
```
9494

9595
#### List Partition
@@ -98,7 +98,7 @@ Schema::attachRangePartition('[YourCreatedPartitionTableNameHere]', function (Bl
9898
use ORPTech\MigrationPartition\Database\Schema\Blueprint;
9999
use ORPTech\MigrationPartition\Support\Facades\Schema;
100100

101-
Schema::attachListPartition('[YourCreatedPartitionTableNameHere]', function (Blueprint $table) {}, '[SubfixForPartition]', '[listPartitionValue]');
101+
Schema::initListPartition('[YourCreatedPartitionTableNameHere]', function (Blueprint $table) {}, '[SubfixForPartition]', '[listPartitionValue]');
102102
```
103103

104104
#### Hash Partition
@@ -107,7 +107,7 @@ Schema::attachListPartition('[YourCreatedPartitionTableNameHere]', function (Blu
107107
use ORPTech\MigrationPartition\Database\Schema\Blueprint;
108108
use ORPTech\MigrationPartition\Support\Facades\Schema;
109109

110-
Schema::attachHashPartition('[YourCreatedPartitionTableNameHere]', function (Blueprint $table) {}, '[SubfixForPartition]', '[hashModulus]', '[hashRemainder]');
110+
Schema::initHashPartition('[YourCreatedPartitionTableNameHere]', function (Blueprint $table) {}, '[SubfixForPartition]', '[hashModulus]', '[hashRemainder]');
111111
```
112112

113113
## Testing

src/Database/Schema/Blueprint.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public function createRangePartitioned()
117117
*
118118
* @return \Illuminate\Support\Fluent
119119
*/
120-
public function attachRangePartition()
120+
public function initRangePartition()
121121
{
122-
return $this->addCommand('attachRangePartition');
122+
return $this->addCommand('initRangePartition');
123123
}
124124

125125
/**
@@ -137,9 +137,9 @@ public function createListPartitioned()
137137
*
138138
* @return \Illuminate\Support\Fluent
139139
*/
140-
public function attachListPartition()
140+
public function initListPartition()
141141
{
142-
return $this->addCommand('attachListPartition');
142+
return $this->addCommand('initListPartition');
143143
}
144144

145145
/**
@@ -157,8 +157,8 @@ public function createHashPartitioned()
157157
*
158158
* @return \Illuminate\Support\Fluent
159159
*/
160-
public function attachHashPartition()
160+
public function initHashPartition()
161161
{
162-
return $this->addCommand('attachHashPartition');
162+
return $this->addCommand('initHashPartition');
163163
}
164164
}

src/Database/Schema/Builder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function createRangePartitioned(string $table, Closure $callback, string
4848
* @param string $endDate
4949
* @return void
5050
*/
51-
public function attachRangePartition(string $table, Closure $callback, string $subfixForPartition, string $startDate, string $endDate)
51+
public function initRangePartition(string $table, Closure $callback, string $subfixForPartition, string $startDate, string $endDate)
5252
{
5353
$this->build(tap($this->createBlueprint($table), function ($blueprint) use ($callback, $subfixForPartition, $startDate, $endDate) {
5454
$blueprint->attachRangePartition();
@@ -91,7 +91,7 @@ public function createListPartitioned(string $table, Closure $callback, string $
9191
* @param string $listPartitionValue
9292
* @return void
9393
*/
94-
public function attachListPartition(string $table, Closure $callback, string $subfixForPartition, string $listPartitionValue)
94+
public function initListPartition(string $table, Closure $callback, string $subfixForPartition, string $listPartitionValue)
9595
{
9696
$this->build(tap($this->createBlueprint($table), function ($blueprint) use ($callback, $subfixForPartition, $listPartitionValue) {
9797
$blueprint->attachListPartition();
@@ -134,7 +134,7 @@ public function createHashPartitioned(string $table, Closure $callback, string $
134134
* @param int $hashRemainder
135135
* @return void
136136
*/
137-
public function attachHashPartition(string $table, Closure $callback, string $subfixForPartition, int $hashModulus, int $hashRemainder)
137+
public function initHashPartition(string $table, Closure $callback, string $subfixForPartition, int $hashModulus, int $hashRemainder)
138138
{
139139
$this->build(tap($this->createBlueprint($table), function ($blueprint) use ($callback, $subfixForPartition, $hashModulus, $hashRemainder) {
140140
$blueprint->attachHashPartition();

src/Database/Schema/Grammars/PostgresGrammar.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function compileCreateRangePartitioned(Blueprint $blueprint, Fluent $comm
3030
* @param \Illuminate\Support\Fluent $command
3131
* @return array
3232
*/
33-
public function compileAttachRangePartition(Blueprint $blueprint, Fluent $command)
33+
public function compileInitRangePartition(Blueprint $blueprint, Fluent $command)
3434
{
3535
return array_values(array_filter(array_merge([sprintf('create table %s_%s partition of %s for values from (\'%s\') to (\'%s\')',
3636
str_replace("\"", "", $this->wrapTable($blueprint)),
@@ -63,7 +63,7 @@ public function compileCreateListPartitioned(Blueprint $blueprint, Fluent $comma
6363
* @param \Illuminate\Support\Fluent $command
6464
* @return array
6565
*/
66-
public function compileAttachListPartition(Blueprint $blueprint, Fluent $command)
66+
public function compileInitListPartition(Blueprint $blueprint, Fluent $command)
6767
{
6868
return array_values(array_filter(array_merge([sprintf('create table %s_%s partition of %s for values in (\'%s\')',
6969
str_replace("\"", "", $this->wrapTable($blueprint)),
@@ -95,7 +95,7 @@ public function compileCreateHashPartitioned(Blueprint $blueprint, Fluent $comma
9595
* @param \Illuminate\Support\Fluent $command
9696
* @return array
9797
*/
98-
public function compileAttachHasPartition(Blueprint $blueprint, Fluent $command)
98+
public function compileInitHasPartition(Blueprint $blueprint, Fluent $command)
9999
{
100100
return array_values(array_filter(array_merge([sprintf('create table %s_%s partition of %s for values with (modulus %s, remainder %s)',
101101
str_replace("\"", "", $this->wrapTable($blueprint)),

src/Support/Facades/Schema.php

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

99
/**
1010
* @method static createRangePartitioned(string $table, \Closure $callback, string $pkCompositeOne, string $pkCompositeTwo, string $rangeKey)
11-
* @method static attachRangePartition(string $table, \Closure $callback, string $subfixForPartition, string $startDate, string $endDate)
11+
* @method static initRangePartition(string $table, \Closure $callback, string $subfixForPartition, string $startDate, string $endDate)
1212
* @method static createListPartitioned(string $table, \Closure $callback, string $pkCompositeOne, string $pkCompositeTwo, string $listPartitionKey)
13-
* @method static attachListPartition(string $table, \Closure $callback, string $subfixForPartition, string $listPartitionValue)
13+
* @method static initListPartition(string $table, \Closure $callback, string $subfixForPartition, string $listPartitionValue)
1414
* @method static createHashPartitioned(string $table, \Closure $callback, string $pkCompositeOne, string $pkCompositeTwo, string $hashPartitionKey)
15-
* @method static attachHashPartition(string $table, \Closure $callback, string $subfixForPartition, int $hashModulus, int $hashRemainder)
15+
* @method static initHashPartition(string $table, \Closure $callback, string $subfixForPartition, int $hashModulus, int $hashRemainder)
1616
* @see \ORPTech\MigrationPartition\Database\Schema\Builder
1717
*/
1818
class Schema extends Facade

0 commit comments

Comments
 (0)