Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit fd426d7c
authored
Aug 31, 2015
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug(postgres) Fall back to latest version if parsing db version fails. Closes #4368
1 parent
45775541
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
1 deletions
changelog.md
lib/dialects/abstract/connection-manager.js
lib/dialects/mysql/index.js
lib/dialects/postgres/index.js
lib/dialects/sqlite/index.js
changelog.md
View file @
fd426d7
# Next
-
[
FIXED
]
Fall back to a default version when parsing the DB version fails
[
#4368
](
https://github.com/sequelize/sequelize/issues/4368
)
# 3.6.0
-
[
ADDED
]
Model.findCreateFind: A more performant findOrCreate that will not work under a transaction (atleast not in postgres)
-
[
FIXED
]
Show indexes query on Postgres fails to return functional indexes
[
#3911
](
https://github.com/sequelize/sequelize/issues/3911
)
...
...
lib/dialects/abstract/connection-manager.js
View file @
fd426d7
...
...
@@ -3,6 +3,7 @@
var
Pooling
=
require
(
'generic-pool'
)
,
Promise
=
require
(
'../../promise'
)
,
_
=
require
(
'lodash'
)
,
semver
=
require
(
'semver'
)
,
defaultPoolingConfig
=
{
max
:
5
,
min
:
0
,
...
...
@@ -196,7 +197,8 @@ ConnectionManager.prototype.getConnection = function(options) {
_options
.
logging
.
__testLoggingFn
=
true
;
return
self
.
sequelize
.
databaseVersion
(
_options
).
then
(
function
(
version
)
{
self
.
sequelize
.
options
.
databaseVersion
=
version
;
self
.
sequelize
.
options
.
databaseVersion
=
semver
.
valid
(
version
)
?
version
:
self
.
defaultVersion
;
self
.
versionPromise
=
undefined
;
self
.
$disconnect
(
connection
);
...
...
@@ -216,6 +218,7 @@ ConnectionManager.prototype.getConnection = function(options) {
});
});
};
ConnectionManager
.
prototype
.
releaseConnection
=
function
(
connection
)
{
var
self
=
this
;
...
...
lib/dialects/mysql/index.js
View file @
fd426d7
...
...
@@ -36,6 +36,7 @@ MysqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support
GEOMETRY
:
true
});
ConnectionManager
.
prototype
.
defaultVersion
=
'5.6.0'
;
MysqlDialect
.
prototype
.
Query
=
Query
;
MysqlDialect
.
prototype
.
QueryGenerator
=
QueryGenerator
;
MysqlDialect
.
prototype
.
DataTypes
=
DataTypes
;
...
...
lib/dialects/postgres/index.js
View file @
fd426d7
...
...
@@ -49,6 +49,7 @@ PostgresDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.supp
deferrableConstraints
:
true
});
ConnectionManager
.
prototype
.
defaultVersion
=
'9.4.0'
;
PostgresDialect
.
prototype
.
Query
=
Query
;
PostgresDialect
.
prototype
.
DataTypes
=
DataTypes
;
PostgresDialect
.
prototype
.
name
=
'postgres'
;
...
...
lib/dialects/sqlite/index.js
View file @
fd426d7
...
...
@@ -29,6 +29,7 @@ SqliteDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.suppor
groupedLimit
:
false
});
ConnectionManager
.
prototype
.
defaultVersion
=
'3.8.0'
;
SqliteDialect
.
prototype
.
Query
=
Query
;
SqliteDialect
.
prototype
.
DataTypes
=
DataTypes
;
SqliteDialect
.
prototype
.
name
=
'sqlite'
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment