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
ff50f150
Commit
ff50f150
authored
Jul 10, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proper quoting of sequence name.
parent
bc5028eb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
Schema.php
framework/db/oci/Schema.php
+1
-0
QueryBuilder.php
framework/db/pgsql/QueryBuilder.php
+2
-6
Schema.php
framework/db/pgsql/Schema.php
+1
-1
No files found.
framework/db/oci/Schema.php
View file @
ff50f150
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
namespace
yii\db\oci
;
namespace
yii\db\oci
;
use
yii\base\InvalidCallException
;
use
yii\db\TableSchema
;
use
yii\db\TableSchema
;
use
yii\db\ColumnSchema
;
use
yii\db\ColumnSchema
;
...
...
framework/db/pgsql/QueryBuilder.php
View file @
ff50f150
...
@@ -99,12 +99,8 @@ class QueryBuilder extends \yii\db\QueryBuilder
...
@@ -99,12 +99,8 @@ class QueryBuilder extends \yii\db\QueryBuilder
{
{
$table
=
$this
->
db
->
getTableSchema
(
$tableName
);
$table
=
$this
->
db
->
getTableSchema
(
$tableName
);
if
(
$table
!==
null
&&
$table
->
sequenceName
!==
null
)
{
if
(
$table
!==
null
&&
$table
->
sequenceName
!==
null
)
{
$sequence
=
'"'
.
$table
->
sequenceName
.
'"'
;
// c.f. http://www.postgresql.org/docs/8.1/static/functions-sequence.html
$sequence
=
$this
->
db
->
quoteTableName
(
$table
->
sequenceName
);
if
(
strpos
(
$sequence
,
'.'
)
!==
false
)
{
$sequence
=
str_replace
(
'.'
,
'"."'
,
$sequence
);
}
$tableName
=
$this
->
db
->
quoteTableName
(
$tableName
);
$tableName
=
$this
->
db
->
quoteTableName
(
$tableName
);
if
(
$value
===
null
)
{
if
(
$value
===
null
)
{
$key
=
reset
(
$table
->
primaryKey
);
$key
=
reset
(
$table
->
primaryKey
);
...
...
framework/db/pgsql/Schema.php
View file @
ff50f150
...
@@ -405,7 +405,7 @@ SQL;
...
@@ -405,7 +405,7 @@ SQL;
if
(
$column
->
isPrimaryKey
)
{
if
(
$column
->
isPrimaryKey
)
{
$table
->
primaryKey
[]
=
$column
->
name
;
$table
->
primaryKey
[]
=
$column
->
name
;
if
(
$table
->
sequenceName
===
null
&&
preg_match
(
"/nextval
\\
('
\"
?
\\
w+
\"
?\.?
\"
?
\\
w+
\"
?'(::regclass)?
\\
)/"
,
$column
->
defaultValue
)
===
1
)
{
if
(
$table
->
sequenceName
===
null
&&
preg_match
(
"/nextval
\\
('
\"
?
\\
w+
\"
?\.?
\"
?
\\
w+
\"
?'(::regclass)?
\\
)/"
,
$column
->
defaultValue
)
===
1
)
{
$table
->
sequenceName
=
trim
(
preg_replace
([
'/nextval/'
,
'/::/'
,
'/regclass/'
,
'/\'\)/'
,
'/\(\'/'
],
''
,
$column
->
defaultValue
),
'"'
);
$table
->
sequenceName
=
preg_replace
([
'/nextval/'
,
'/::/'
,
'/regclass/'
,
'/\'\)/'
,
'/\(\'/'
],
''
,
$column
->
defaultValue
);
}
}
$column
->
defaultValue
=
null
;
$column
->
defaultValue
=
null
;
}
elseif
(
$column
->
defaultValue
)
{
}
elseif
(
$column
->
defaultValue
)
{
...
...
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