| @@ 5616-5627 (lines=12) @@ | ||
| 5613 | /** |
|
| 5614 | * @see QueryWriter::addIndex |
|
| 5615 | */ |
|
| 5616 | public function addIndex( $type, $name, $property ) |
|
| 5617 | { |
|
| 5618 | try { |
|
| 5619 | $table = $this->esc( $type ); |
|
| 5620 | $name = preg_replace( '/\W/', '', $name ); |
|
| 5621 | $column = $this->esc( $property ); |
|
| 5622 | $this->adapter->exec( "CREATE INDEX $name ON $table ($column) " ); |
|
| 5623 | return TRUE; |
|
| 5624 | } catch ( SQLException $e ) { |
|
| 5625 | return FALSE; |
|
| 5626 | } |
|
| 5627 | } |
|
| 5628 | ||
| 5629 | /** |
|
| 5630 | * @see QueryWriter::addFK |
|
| @@ 6459-6471 (lines=13) @@ | ||
| 6456 | /** |
|
| 6457 | * @see QueryWriter::addIndex |
|
| 6458 | */ |
|
| 6459 | public function addIndex( $type, $name, $property ) |
|
| 6460 | { |
|
| 6461 | $table = $this->esc( $type ); |
|
| 6462 | $name = preg_replace( '/\W/', '', $name ); |
|
| 6463 | $column = $this->esc( $property ); |
|
| 6464 | ||
| 6465 | try { |
|
| 6466 | $this->adapter->exec( "CREATE INDEX {$name} ON $table ({$column}) " ); |
|
| 6467 | return TRUE; |
|
| 6468 | } catch ( SQLException $e ) { |
|
| 6469 | return FALSE; |
|
| 6470 | } |
|
| 6471 | } |
|
| 6472 | ||
| 6473 | /** |
|
| 6474 | * @see QueryWriter::addFK |
|