Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function generate(string $tableName, Column $column): string |
||
25 | { |
||
26 | $setting = app(MigrationsGeneratorSetting::class); |
||
27 | $tableCollation = $setting->getSchema()->listTableDetails($tableName)->getOptions()['collation'] ?? null; |
||
28 | |||
29 | $columnCollation = $column->getPlatformOptions()['collation'] ?? null; |
||
30 | if (!empty($column->getPlatformOptions()['collation'])) { |
||
31 | if ($columnCollation !== $tableCollation) { |
||
32 | return $this->decorator->decorate( |
||
33 | ColumnModifier::COLLATION, |
||
34 | [$this->decorator->columnDefaultToString($columnCollation)] |
||
35 | ); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | return ''; |
||
40 | } |
||
42 |