| @@ 300-307 (lines=8) @@ | ||
| 297 | * |
|
| 298 | * @return string |
|
| 299 | */ |
|
| 300 | private function enumConstraint(): string |
|
| 301 | { |
|
| 302 | if (empty($this->constrainName)) { |
|
| 303 | $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 304 | } |
|
| 305 | ||
| 306 | return $this->constrainName; |
|
| 307 | } |
|
| 308 | ||
| 309 | /** |
|
| 310 | * Normalize default value. |
|
| @@ 289-296 (lines=8) @@ | ||
| 286 | * |
|
| 287 | * @return string |
|
| 288 | */ |
|
| 289 | protected function enumConstraint() |
|
| 290 | { |
|
| 291 | if (empty($this->enumConstraint)) { |
|
| 292 | $this->enumConstraint = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 293 | } |
|
| 294 | ||
| 295 | return $this->enumConstraint; |
|
| 296 | } |
|
| 297 | ||
| 298 | /** |
|
| 299 | * Get/generate name of default constrain. |
|
| @@ 303-310 (lines=8) @@ | ||
| 300 | * |
|
| 301 | * @return string |
|
| 302 | */ |
|
| 303 | protected function defaultConstrain(): string |
|
| 304 | { |
|
| 305 | if (empty($this->defaultConstraint)) { |
|
| 306 | $this->defaultConstraint = $this->table . '_' . $this->getName() . '_default_' . uniqid(); |
|
| 307 | } |
|
| 308 | ||
| 309 | return $this->defaultConstraint; |
|
| 310 | } |
|
| 311 | ||
| 312 | /** |
|
| 313 | * In SQLServer we can emulate enums similar way as in Postgres via column constrain. |
|