Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function makeField(string $tableName, array $field) |
||
24 | { |
||
25 | /** @var MigrationGeneratorSetting $setting */ |
||
26 | $setting = app(MigrationGeneratorSetting::class); |
||
27 | |||
28 | switch ($setting->getPlatform()) { |
||
29 | case Platform::POSTGRESQL: |
||
30 | $columnType = $this->pgsqlRepository->getTypeByColumnName($tableName, $field['field']); |
||
31 | if ($columnType !== null) { |
||
32 | $type = strtolower($columnType); |
||
33 | $type = preg_replace('/\s+/', '', $type); |
||
34 | |||
35 | if (isset(PgSQLGeography::MAP[$type])) { |
||
36 | $field['type'] = PgSQLGeography::MAP[$type]; |
||
37 | } |
||
38 | } |
||
39 | break; |
||
40 | default: |
||
41 | } |
||
42 | return $field; |
||
43 | } |
||
44 | } |
||
45 |