Server IP : 173.249.157.85 / Your IP : 18.117.77.136 Web Server : Apache System : Linux server.frogzhost.com 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : econtech ( 1005) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/econtech/www/vendor/laravel/framework/src/Illuminate/Database/Schema/ |
Upload File : |
<?php namespace Illuminate\Database\Schema; class PostgresBuilder extends Builder { /** * Determine if the given table exists. * * @param string $table * @return bool */ public function hasTable($table) { list($schema, $table) = $this->parseSchemaAndTable($table); $table = $this->connection->getTablePrefix().$table; return count($this->connection->select( $this->grammar->compileTableExists(), [$schema, $table] )) > 0; } /** * Drop all tables from the database. * * @return void */ public function dropAllTables() { $tables = []; $excludedTables = ['spatial_ref_sys']; foreach ($this->getAllTables() as $row) { $row = (array) $row; $table = reset($row); if (! in_array($table, $excludedTables)) { $tables[] = $table; } } if (empty($tables)) { return; } $this->connection->statement( $this->grammar->compileDropAllTables($tables) ); } /** * Get all of the table names for the database. * * @return array */ protected function getAllTables() { return $this->connection->select( $this->grammar->compileGetAllTables($this->connection->getConfig('schema')) ); } /** * Get the column listing for a given table. * * @param string $table * @return array */ public function getColumnListing($table) { list($schema, $table) = $this->parseSchemaAndTable($table); $table = $this->connection->getTablePrefix().$table; $results = $this->connection->select( $this->grammar->compileColumnListing(), [$schema, $table] ); return $this->connection->getPostProcessor()->processColumnListing($results); } /** * Parse the table name and extract the schema and table. * * @param string $table * @return array */ protected function parseSchemaAndTable($table) { $table = explode('.', $table); if (is_array($schema = $this->connection->getConfig('schema'))) { if (in_array($table[0], $schema)) { return [array_shift($table), implode('.', $table)]; } $schema = head($schema); } return [$schema ?: 'public', implode('.', $table)]; } }