| @@ 305-312 (lines=8) @@ | ||
| 302 | * |
|
| 303 | * @return string |
|
| 304 | */ |
|
| 305 | private function enumConstraint(): string |
|
| 306 | { |
|
| 307 | if (empty($this->constrainName)) { |
|
| 308 | $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 309 | } |
|
| 310 | ||
| 311 | return $this->constrainName; |
|
| 312 | } |
|
| 313 | ||
| 314 | /** |
|
| 315 | * Normalize default value. |
|
| @@ 299-306 (lines=8) @@ | ||
| 296 | * |
|
| 297 | * @return string |
|
| 298 | */ |
|
| 299 | protected function enumConstraint() |
|
| 300 | { |
|
| 301 | if (empty($this->enumConstraint)) { |
|
| 302 | $this->enumConstraint = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 303 | } |
|
| 304 | ||
| 305 | return $this->enumConstraint; |
|
| 306 | } |
|
| 307 | ||
| 308 | /** |
|
| 309 | * Get/generate name of default constrain. |
|
| @@ 313-320 (lines=8) @@ | ||
| 310 | * |
|
| 311 | * @return string |
|
| 312 | */ |
|
| 313 | protected function defaultConstrain(): string |
|
| 314 | { |
|
| 315 | if (empty($this->defaultConstraint)) { |
|
| 316 | $this->defaultConstraint = $this->table . '_' . $this->getName() . '_default_' . uniqid(); |
|
| 317 | } |
|
| 318 | ||
| 319 | return $this->defaultConstraint; |
|
| 320 | } |
|
| 321 | ||
| 322 | /** |
|
| 323 | * In SQLServer we can emulate enums similar way as in Postgres via column constrain. |
|