|
17 | 17 |
|
18 | 18 | class Grammar extends MySqlGrammar
|
19 | 19 | {
|
20 |
| - use CompilesKeys, ModifiesColumns; |
| 20 | + use CompilesKeys; |
| 21 | + use ModifiesColumns; |
21 | 22 |
|
22 | 23 | public function __construct()
|
23 | 24 | {
|
@@ -64,7 +65,8 @@ protected function compileCreateTable($blueprint, $command, $connection)
|
64 | 65 | // We want to do as little as possible ourselves, so we rely on the parent
|
65 | 66 | // to compile everything and then potentially sneak some modifiers in.
|
66 | 67 | return $this->insertCreateTableModifiers(
|
67 |
| - $blueprint, parent::compileCreateTable($blueprint, $command, $connection) |
| 68 | + $blueprint, |
| 69 | + parent::compileCreateTable($blueprint, $command, $connection) |
68 | 70 | );
|
69 | 71 | }
|
70 | 72 |
|
@@ -174,4 +176,19 @@ protected function compileKey(Blueprint $blueprint, Fluent $command, $type)
|
174 | 176 | // creating the indexes as a part of the create statement.
|
175 | 177 | return str_replace(sprintf('alter table %s add ', $this->wrapTable($blueprint)), '', $compiled);
|
176 | 178 | }
|
| 179 | + |
| 180 | + /** |
| 181 | + * Convert an array of column names into a delimited string (with direction parameter). |
| 182 | + * |
| 183 | + * @param array $columns |
| 184 | + * @return string |
| 185 | + */ |
| 186 | + protected function columnizeWithDirection(array $columns, string $direction) |
| 187 | + { |
| 188 | + $wrapped = array_map([$this, 'wrap'], $columns); |
| 189 | + |
| 190 | + return implode(", ", array_map(function ($column) use ($direction) { |
| 191 | + return $column . ' ' . $direction; |
| 192 | + }, $wrapped)); |
| 193 | + } |
177 | 194 | }
|
0 commit comments