source/Spiral/Database/Drivers/MySQL/Schemas/TableSchema.php 1 location
|
@@ 75-85 (lines=11) @@
|
| 72 |
|
/** |
| 73 |
|
* {@inheritdoc} |
| 74 |
|
*/ |
| 75 |
|
protected function fetchColumns(): array |
| 76 |
|
{ |
| 77 |
|
$query = "SHOW FULL COLUMNS FROM {$this->driver->identifier($this->getName())}"; |
| 78 |
|
|
| 79 |
|
$result = []; |
| 80 |
|
foreach ($this->driver->query($query) as $schema) { |
| 81 |
|
$result[] = ColumnSchema::createInstance($this->getName(), $schema); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
return $result; |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
/** |
| 88 |
|
* {@inheritdoc} |
source/Spiral/Database/Drivers/SQLite/Schemas/TableSchema.php 1 location
|
@@ 71-81 (lines=11) @@
|
| 68 |
|
/** |
| 69 |
|
* {@inheritdoc} |
| 70 |
|
*/ |
| 71 |
|
protected function fetchReferences(): array |
| 72 |
|
{ |
| 73 |
|
$query = "PRAGMA foreign_key_list({$this->driver->quote($this->getName())})"; |
| 74 |
|
|
| 75 |
|
$result = []; |
| 76 |
|
foreach ($this->driver->query($query) as $schema) { |
| 77 |
|
$result[] = ReferenceSchema::createInstance($this->getName(), $schema); |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
return $result; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
/** |
| 84 |
|
* Fetching primary keys from table. |