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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
645ec364
Commit
645ec364
authored
Oct 17, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1006 from chelishchev/basic-support-pgsql-in-query-builder
Support PostgreSQL in QueryBuilder
parents
f03c689b
8f8c7053
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
QueryBuilder.php
framework/yii/db/pgsql/QueryBuilder.php
+39
-0
No files found.
framework/yii/db/pgsql/QueryBuilder.php
View file @
645ec364
...
@@ -38,4 +38,43 @@ class QueryBuilder extends \yii\db\QueryBuilder
...
@@ -38,4 +38,43 @@ class QueryBuilder extends \yii\db\QueryBuilder
Schema
::
TYPE_BOOLEAN
=>
'boolean'
,
Schema
::
TYPE_BOOLEAN
=>
'boolean'
,
Schema
::
TYPE_MONEY
=>
'numeric(19,4)'
,
Schema
::
TYPE_MONEY
=>
'numeric(19,4)'
,
);
);
/**
* Builds a SQL statement for dropping an index.
* @param string $name the name of the index to be dropped. The name will be properly quoted by the method.
* @param string $table the table whose index is to be dropped. The name will be properly quoted by the method.
* @return string the SQL statement for dropping an index.
*/
public
function
dropIndex
(
$name
,
$table
)
{
return
'DROP INDEX '
.
$this
->
db
->
quoteTableName
(
$name
);
}
/**
* Builds a SQL statement for renaming a DB table.
* @param string $oldName the table to be renamed. The name will be properly quoted by the method.
* @param string $newName the new table name. The name will be properly quoted by the method.
* @return string the SQL statement for renaming a DB table.
*/
public
function
renameTable
(
$oldName
,
$newName
)
{
return
'ALTER TABLE '
.
$this
->
db
->
quoteTableName
(
$oldName
)
.
' RENAME TO '
.
$this
->
db
->
quoteTableName
(
$newName
);
}
/**
* Builds a SQL statement for changing the definition of a column.
* @param string $table the table whose column is to be changed. The table name will be properly quoted by the method.
* @param string $column the name of the column to be changed. The name will be properly quoted by the method.
* @param string $type the new column type. The [[getColumnType()]] method will be invoked to convert abstract
* column type (if any) into the physical one. Anything that is not recognized as abstract type will be kept
* in the generated SQL. For example, 'string' will be turned into 'varchar(255)', while 'string not null'
* will become 'varchar(255) not null'.
* @return string the SQL statement for changing the definition of a column.
*/
public
function
alterColumn
(
$table
,
$column
,
$type
)
{
return
'ALTER TABLE '
.
$this
->
db
->
quoteTableName
(
$table
)
.
' ALTER COLUMN '
.
$this
->
db
->
quoteColumnName
(
$column
)
.
' TYPE '
.
$this
->
getColumnType
(
$type
);
}
}
}
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