Skip to content

Commit 41cd5b2

Browse files
committed
Join migration type fix
+ other helpers
1 parent 6f6973b commit 41cd5b2

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/Schema/Blueprint.php

+5
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,9 @@ public function update(): Fluent
344344
{
345345
return $this->addCommand('update');
346346
}
347+
348+
public function mapProperty($name, $type, $parameters = []): PropertyDefinition
349+
{
350+
return $this->addColumn($type, $name, $parameters);
351+
}
347352
}

src/Schema/Builder.php

+5
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ public function getIndices(): array
184184
return $this->getIndex();
185185
}
186186

187+
public function getIndicesSummary(): array
188+
{
189+
return $this->getTables();
190+
}
191+
187192
/**
188193
* Returns the mapping details about your indices.
189194
*/

src/Schema/ManagesElasticMigrations.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ public function ipRange(string $name, array $parameters = []): PropertyDefinitio
123123
*
124124
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html
125125
*/
126-
public function join(string $name, array $relations): PropertyDefinition
126+
public function join(string $parent, string $child): PropertyDefinition
127127
{
128-
return $this->addColumn('join', $name, compact('relations'));
128+
$name = $parent.'_'.$child.'_join';
129+
$parameters = [
130+
'relations' => [$parent => $child],
131+
];
132+
133+
return $this->addColumn('join', $name, $parameters);
129134
}
130135

131136
/**

0 commit comments

Comments
 (0)