| @@ 315-322 (lines=8) @@ | ||
| 312 | * |
|
| 313 | * @return string |
|
| 314 | */ |
|
| 315 | private function enumConstraint(): string |
|
| 316 | { |
|
| 317 | if (empty($this->constrainName)) { |
|
| 318 | $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 319 | } |
|
| 320 | ||
| 321 | return $this->constrainName; |
|
| 322 | } |
|
| 323 | ||
| 324 | /** |
|
| 325 | * Normalize default value. |
|
| @@ 310-317 (lines=8) @@ | ||
| 307 | * |
|
| 308 | * @return string |
|
| 309 | */ |
|
| 310 | protected function enumConstraint() |
|
| 311 | { |
|
| 312 | if (empty($this->enumConstraint)) { |
|
| 313 | $this->enumConstraint = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 314 | } |
|
| 315 | ||
| 316 | return $this->enumConstraint; |
|
| 317 | } |
|
| 318 | ||
| 319 | /** |
|
| 320 | * Get/generate name of default constrain. |
|
| @@ 324-331 (lines=8) @@ | ||
| 321 | * |
|
| 322 | * @return string |
|
| 323 | */ |
|
| 324 | protected function defaultConstrain(): string |
|
| 325 | { |
|
| 326 | if (empty($this->defaultConstraint)) { |
|
| 327 | $this->defaultConstraint = $this->table . '_' . $this->getName() . '_default_' . uniqid(); |
|
| 328 | } |
|
| 329 | ||
| 330 | return $this->defaultConstraint; |
|
| 331 | } |
|
| 332 | ||
| 333 | /** |
|
| 334 | * In SQLServer we can emulate enums similar way as in Postgres via column constrain. |
|