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 1cffab70
authored
Jul 22, 2019
by
Tony Brix
Committed by
Sushant
Jul 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(describetable): support string length for char in mssql (#11212)
1 parent
dc6249a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
lib/dialects/mssql/query.js
test/integration/dialects/mssql/regressions.test.js
lib/dialects/mssql/query.js
View file @
1cffab7
...
@@ -173,7 +173,7 @@ class Query extends AbstractQuery {
...
@@ -173,7 +173,7 @@ class Query extends AbstractQuery {
};
};
if
(
if
(
result
[
_result
.
Name
].
type
.
includes
(
'
VAR
CHAR'
)
result
[
_result
.
Name
].
type
.
includes
(
'CHAR'
)
&&
_result
.
Length
&&
_result
.
Length
)
{
)
{
if
(
_result
.
Length
===
-
1
)
{
if
(
_result
.
Length
===
-
1
)
{
...
...
test/integration/dialects/mssql/regressions.test.js
View file @
1cffab7
...
@@ -95,4 +95,17 @@ if (dialect.match(/^mssql/)) {
...
@@ -95,4 +95,17 @@ if (dialect.match(/^mssql/)) {
});
});
});
});
});
});
it
(
'sets the char(10) length correctly on describeTable'
,
function
()
{
const
Users
=
this
.
sequelize
.
define
(
'_Users'
,
{
username
:
Sequelize
.
CHAR
(
10
)
},
{
freezeTableName
:
true
});
return
Users
.
sync
({
force
:
true
}).
then
(()
=>
{
return
this
.
sequelize
.
getQueryInterface
().
describeTable
(
'_Users'
).
then
(
metadata
=>
{
const
username
=
metadata
.
username
;
expect
(
username
.
type
).
to
.
include
(
'(10)'
);
});
});
});
}
}
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