Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
cbad97c7
Commit
cbad97c7
authored
Dec 29, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change back the visibility of findTableNames to protected.
parent
70c23ca4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
5 deletions
+5
-5
Schema.php
framework/yii/db/mysql/Schema.php
+1
-1
QueryBuilder.php
framework/yii/db/pgsql/QueryBuilder.php
+1
-1
Schema.php
framework/yii/db/pgsql/Schema.php
+1
-1
Schema.php
framework/yii/db/sqlite/Schema.php
+1
-1
SchemaTest.php
tests/unit/framework/db/SchemaTest.php
+1
-1
No files found.
framework/yii/db/mysql/Schema.php
View file @
cbad97c7
...
...
@@ -280,7 +280,7 @@ class Schema extends \yii\db\Schema
* @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
* @return array all table names in the database. The names have NO schema name prefix.
*/
p
ublic
function
findTableNames
(
$schema
=
''
)
p
rotected
function
findTableNames
(
$schema
=
''
)
{
$sql
=
'SHOW TABLES'
;
if
(
$schema
!==
''
)
{
...
...
framework/yii/db/pgsql/QueryBuilder.php
View file @
cbad97c7
...
...
@@ -109,7 +109,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
{
$enable
=
$check
?
'ENABLE'
:
'DISABLE'
;
$schema
=
$schema
?
$schema
:
$this
->
db
->
schema
->
defaultSchema
;
$tableNames
=
$table
?
[
$table
]
:
$this
->
db
->
schema
->
find
TableNames
(
$schema
);
$tableNames
=
$table
?
[
$table
]
:
$this
->
db
->
schema
->
get
TableNames
(
$schema
);
$command
=
''
;
foreach
(
$tableNames
as
$tableName
)
{
...
...
framework/yii/db/pgsql/Schema.php
View file @
cbad97c7
...
...
@@ -158,7 +158,7 @@ class Schema extends \yii\db\Schema
* @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
* @return array all table names in the database. The names have NO schema name prefix.
*/
p
ublic
function
findTableNames
(
$schema
=
''
)
p
rotected
function
findTableNames
(
$schema
=
''
)
{
if
(
$schema
===
''
)
{
$schema
=
$this
->
defaultSchema
;
...
...
framework/yii/db/sqlite/Schema.php
View file @
cbad97c7
...
...
@@ -87,7 +87,7 @@ class Schema extends \yii\db\Schema
* If not empty, the returned table names will be prefixed with the schema name.
* @return array all table names in the database.
*/
p
ublic
function
findTableNames
(
$schema
=
''
)
p
rotected
function
findTableNames
(
$schema
=
''
)
{
$sql
=
"SELECT DISTINCT tbl_name FROM sqlite_master WHERE tbl_name<>'sqlite_sequence'"
;
return
$this
->
db
->
createCommand
(
$sql
)
->
queryColumn
();
...
...
tests/unit/framework/db/SchemaTest.php
View file @
cbad97c7
...
...
@@ -11,7 +11,7 @@ use yii\db\Schema;
*/
class
SchemaTest
extends
DatabaseTestCase
{
public
function
test
Find
TableNames
()
public
function
test
Get
TableNames
()
{
/** @var Schema $schema */
$schema
=
$this
->
getConnection
()
->
schema
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment