| @@ 106-118 (lines=13) @@ | ||
| 103 | * |
|
| 104 | * @return Index |
|
| 105 | */ |
|
| 106 | public function index($columns) |
|
| 107 | { |
|
| 108 | $columns = is_array($columns) ? $columns : func_get_args(); |
|
| 109 | ||
| 110 | $index = new Index( |
|
| 111 | $this->builder, |
|
| 112 | $columns |
|
| 113 | ); |
|
| 114 | ||
| 115 | $this->queue($index); |
|
| 116 | ||
| 117 | return $index; |
|
| 118 | } |
|
| 119 | ||
| 120 | /** |
|
| 121 | * @param array|string $fields |
|
| @@ 125-137 (lines=13) @@ | ||
| 122 | * |
|
| 123 | * @return Primary |
|
| 124 | */ |
|
| 125 | public function primary($fields) |
|
| 126 | { |
|
| 127 | $fields = is_array($fields) ? $fields : func_get_args(); |
|
| 128 | ||
| 129 | $primary = new Primary( |
|
| 130 | $this->builder, |
|
| 131 | $fields |
|
| 132 | ); |
|
| 133 | ||
| 134 | $this->queue($primary); |
|
| 135 | ||
| 136 | return $primary; |
|
| 137 | } |
|
| 138 | ||
| 139 | /** |
|
| 140 | * @param array|string $columns |
|
| @@ 144-156 (lines=13) @@ | ||
| 141 | * |
|
| 142 | * @return UniqueConstraint |
|
| 143 | */ |
|
| 144 | public function unique($columns) |
|
| 145 | { |
|
| 146 | $columns = is_array($columns) ? $columns : func_get_args(); |
|
| 147 | ||
| 148 | $unique = new UniqueConstraint( |
|
| 149 | $this->builder, |
|
| 150 | $columns |
|
| 151 | ); |
|
| 152 | ||
| 153 | $this->queue($unique); |
|
| 154 | ||
| 155 | return $unique; |
|
| 156 | } |
|
| 157 | ||
| 158 | /** |
|
| 159 | * @param string $embeddable |
|