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
6fd25815
Commit
6fd25815
authored
May 25, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added more types to pgsql schema, better detection
fixes #3578
parent
c11ca087
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
22 deletions
+57
-22
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Schema.php
framework/db/pgsql/Schema.php
+56
-22
No files found.
framework/CHANGELOG.md
View file @
6fd25815
...
...
@@ -32,6 +32,7 @@ Yii Framework 2 Change Log
-
Bug #3548: Fixed the bug that X-Rate-Limit-Remaining header is always zero when using RateLimiter (qiangxue)
-
Bug #3564: Fixed the bug that primary key columns should not take default values from schema (qiangxue)
-
Bug #3567: Fixed the bug that smallint was treated as string for PostgreSQL (qiangxue)
-
Bug #3578: Fixed postgreSQL column type detection, added missing types (MDMunir, cebe)
-
Bug: Fixed inconsistent return of
`\yii\console\Application::runAction()`
(samdark)
-
Enh #2264:
`CookieCollection::has()`
will return false for expired or removed cookies (qiangxue)
-
Enh #2435:
`yii\db\IntegrityException`
is now thrown on database integrity errors instead of general
`yii\db\Exception`
(samdark)
...
...
framework/db/pgsql/Schema.php
View file @
6fd25815
...
...
@@ -26,49 +26,83 @@ class Schema extends \yii\db\Schema
/**
* @var array mapping from physical column types (keys) to abstract
* column types (values)
* @see http://www.postgresql.org/docs/current/static/datatype.html#DATATYPE-TABLE
*/
public
$typeMap
=
[
'abstime'
=>
self
::
TYPE_TIMESTAMP
,
'bit'
=>
self
::
TYPE_STRING
,
'bit varying'
=>
self
::
TYPE_STRING
,
'varbit'
=>
self
::
TYPE_STRING
,
'bool'
=>
self
::
TYPE_BOOLEAN
,
'boolean'
=>
self
::
TYPE_BOOLEAN
,
'box'
=>
self
::
TYPE_STRING
,
'circle'
=>
self
::
TYPE_STRING
,
'point'
=>
self
::
TYPE_STRING
,
'line'
=>
self
::
TYPE_STRING
,
'lseg'
=>
self
::
TYPE_STRING
,
'polygon'
=>
self
::
TYPE_STRING
,
'path'
=>
self
::
TYPE_STRING
,
'character'
=>
self
::
TYPE_STRING
,
'bytea'
=>
self
::
TYPE_BINARY
,
'char'
=>
self
::
TYPE_STRING
,
'character varying'
=>
self
::
TYPE_STRING
,
'varchar'
=>
self
::
TYPE_STRING
,
'text'
=>
self
::
TYPE_TEXT
,
'bytea'
=>
self
::
TYPE_BINARY
,
'cidr'
=>
self
::
TYPE_STRING
,
'circle'
=>
self
::
TYPE_STRING
,
'date'
=>
self
::
TYPE_DATE
,
'inet'
=>
self
::
TYPE_STRING
,
'macaddr'
=>
self
::
TYPE_STRING
,
'real'
=>
self
::
TYPE_FLOAT
,
'float4'
=>
self
::
TYPE_FLOAT
,
'double precision'
=>
self
::
TYPE_FLOAT
,
'float8'
=>
self
::
TYPE_FLOAT
,
'decimal'
=>
self
::
TYPE_DECIMAL
,
'double precision'
=>
self
::
TYPE_DECIMAL
,
'inet'
=>
self
::
TYPE_STRING
,
'numeric'
=>
self
::
TYPE_DECIMAL
,
'money'
=>
self
::
TYPE_MONEY
,
'smallint'
=>
self
::
TYPE_SMALLINT
,
'int2'
=>
self
::
TYPE_
INTEGER
,
'int2'
=>
self
::
TYPE_
SMALLINT
,
'int4'
=>
self
::
TYPE_INTEGER
,
'int
8'
=>
self
::
TYPE_BIGINT
,
'int
'
=>
self
::
TYPE_INTEGER
,
'integer'
=>
self
::
TYPE_INTEGER
,
'bigint'
=>
self
::
TYPE_BIGINT
,
'interval'
=>
self
::
TYPE_STRING
,
'json'
=>
self
::
TYPE_STRING
,
'line'
=>
self
::
TYPE_STRING
,
'macaddr'
=>
self
::
TYPE_STRING
,
'money'
=>
self
::
TYPE_MONEY
,
'name'
=>
self
::
TYPE_STRING
,
'numeric'
=>
self
::
TYPE_STRING
,
'int8'
=>
self
::
TYPE_BIGINT
,
'oid'
=>
self
::
TYPE_BIGINT
,
// should not be used. it's pg internal!
'path'
=>
self
::
TYPE_STRING
,
'point'
=>
self
::
TYPE_STRING
,
'polygon'
=>
self
::
TYPE_STRING
,
'text'
=>
self
::
TYPE_TEXT
,
'smallserial'
=>
self
::
TYPE_SMALLINT
,
'serial2'
=>
self
::
TYPE_SMALLINT
,
'serial4'
=>
self
::
TYPE_INTEGER
,
'serial'
=>
self
::
TYPE_INTEGER
,
'bigserial'
=>
self
::
TYPE_BIGINT
,
'serial8'
=>
self
::
TYPE_BIGINT
,
'pg_lsn'
=>
self
::
TYPE_BIGINT
,
'date'
=>
self
::
TYPE_DATE
,
'interval'
=>
self
::
TYPE_STRING
,
'time without time zone'
=>
self
::
TYPE_TIME
,
'time'
=>
self
::
TYPE_TIME
,
'time with time zone'
=>
self
::
TYPE_TIME
,
'timetz'
=>
self
::
TYPE_TIME
,
'timestamp without time zone'
=>
self
::
TYPE_TIMESTAMP
,
'timestamp'
=>
self
::
TYPE_TIMESTAMP
,
'timestamp with time zone'
=>
self
::
TYPE_TIMESTAMP
,
'time with time zone'
=>
self
::
TYPE_TIMESTAMP
,
'timestamptz'
=>
self
::
TYPE_TIMESTAMP
,
'abstime'
=>
self
::
TYPE_TIMESTAMP
,
'tsquery'
=>
self
::
TYPE_STRING
,
'tsvector'
=>
self
::
TYPE_STRING
,
'txid_snapshot'
=>
self
::
TYPE_STRING
,
'unknown'
=>
self
::
TYPE_STRING
,
'uuid'
=>
self
::
TYPE_STRING
,
'
bit varying
'
=>
self
::
TYPE_STRING
,
'
character varying
'
=>
self
::
TYPE_STRING
,
'
json
'
=>
self
::
TYPE_STRING
,
'
jsonb
'
=>
self
::
TYPE_STRING
,
'xml'
=>
self
::
TYPE_STRING
];
...
...
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