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 d1645f23
authored
Apr 18, 2019
by
Tony Brix
Committed by
Sushant
Apr 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(mssql): describeTable for VARCHAR(MAX) (#10795)
1 parent
c44c72ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
lib/dialects/mssql/query.js
test/integration/dialects/mssql/regressions.test.js
lib/dialects/mssql/query.js
View file @
d1645f2
...
@@ -176,8 +176,12 @@ class Query extends AbstractQuery {
...
@@ -176,8 +176,12 @@ class Query extends AbstractQuery {
result
[
_result
.
Name
].
type
.
includes
(
'VARCHAR'
)
result
[
_result
.
Name
].
type
.
includes
(
'VARCHAR'
)
&&
_result
.
Length
&&
_result
.
Length
)
{
)
{
if
(
_result
.
Length
===
-
1
)
{
result
[
_result
.
Name
].
type
+=
'(MAX)'
;
}
else
{
result
[
_result
.
Name
].
type
+=
`(
${
_result
.
Length
}
)`
;
result
[
_result
.
Name
].
type
+=
`(
${
_result
.
Length
}
)`
;
}
}
}
}
}
}
}
...
...
test/integration/dialects/mssql/regressions.test.js
View file @
d1645f2
...
@@ -82,4 +82,17 @@ if (dialect.match(/^mssql/)) {
...
@@ -82,4 +82,17 @@ if (dialect.match(/^mssql/)) {
});
});
});
});
});
});
it
(
'sets the varchar(max) length correctly on describeTable'
,
function
()
{
const
Users
=
this
.
sequelize
.
define
(
'_Users'
,
{
username
:
Sequelize
.
STRING
(
'MAX'
)
},
{
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
(
'(MAX)'
);
});
});
});
}
}
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