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
1f0d2ab7
Commit
1f0d2ab7
authored
Jul 24, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Oracle DB type mapping. (Fixes #4)
parent
65d08423
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
QueryBuilder.php
framework/db/oci/QueryBuilder.php
+22
-0
Schema.php
framework/db/oci/Schema.php
+0
-16
No files found.
framework/db/oci/QueryBuilder.php
View file @
1f0d2ab7
...
...
@@ -18,6 +18,28 @@ use yii\db\Connection;
*/
class
QueryBuilder
extends
\yii\db\QueryBuilder
{
/**
* @var array mapping from abstract column types (keys) to physical column types (values).
*/
public
$typeMap
=
[
Schema
::
TYPE_PK
=>
'NUMBER(10) NOT NULL PRIMARY KEY'
,
Schema
::
TYPE_BIGPK
=>
'NUMBER(20) NOT NULL PRIMARY KEY'
,
Schema
::
TYPE_STRING
=>
'VARCHAR2(255)'
,
Schema
::
TYPE_TEXT
=>
'CLOB'
,
Schema
::
TYPE_SMALLINT
=>
'NUMBER(5)'
,
Schema
::
TYPE_INTEGER
=>
'NUMBER(10)'
,
Schema
::
TYPE_BIGINT
=>
'NUMBER(20)'
,
Schema
::
TYPE_FLOAT
=>
'NUMBER'
,
Schema
::
TYPE_DECIMAL
=>
'NUMBER'
,
Schema
::
TYPE_DATETIME
=>
'TIMESTAMP'
,
Schema
::
TYPE_TIMESTAMP
=>
'TIMESTAMP'
,
Schema
::
TYPE_TIME
=>
'TIMESTAMP'
,
Schema
::
TYPE_DATE
=>
'DATE'
,
Schema
::
TYPE_BINARY
=>
'BLOB'
,
Schema
::
TYPE_BOOLEAN
=>
'NUMBER(1)'
,
Schema
::
TYPE_MONEY
=>
'NUMBER(19,4)'
,
];
private
$_sql
;
/**
...
...
framework/db/oci/Schema.php
View file @
1f0d2ab7
...
...
@@ -15,26 +15,11 @@ use yii\db\ColumnSchema;
/**
* Schema is the class for retrieving metadata from an Oracle database
*
* @todo mapping from physical types to abstract types
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
Schema
extends
\yii\db\Schema
{
const
TYPE_PK
=
'NUMBER(10) NOT NULL PRIMARY KEY'
;
const
TYPE_STRING
=
'VARCHAR2(255)'
;
const
TYPE_TEXT
=
'CLOB'
;
const
TYPE_INTEGER
=
'NUMBER(10)'
;
const
TYPE_FLOAT
=
'NUMBER'
;
const
TYPE_DECIMAL
=
'NUMBER'
;
const
TYPE_DATETIME
=
'TIMESTAMP'
;
const
TYPE_TIMESTAMP
=
'TIMESTAMP'
;
const
TYPE_TIME
=
'TIMESTAMP'
;
const
TYPE_DATE
=
'DATE'
;
const
TYPE_BINARY
=
'BLOB'
;
const
TYPE_BOOLEAN
=
'NUMBER(1)'
;
const
TYPE_MONEY
=
'NUMBER(19,4)'
;
/**
* @inheritdoc
*/
...
...
@@ -172,7 +157,6 @@ EOD;
* @internal param \yii\db\TableSchema $table ->name the table schema
* @return string whether the sequence exists
*/
protected
function
getTableSequenceName
(
$tablename
){
$seq_name_sql
=
"select ud.referenced_name as sequence_name
...
...
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