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 321394b4
authored
Oct 13, 2017
by
Gabe Gorelick
Committed by
Sushant
Oct 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(abstract/querygenerator): correctly name indexes that live in custom schemas (#8151)
1 parent
f25a59de
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
lib/dialects/abstract/query-generator.js
test/integration/query-interface.test.js
lib/dialects/abstract/query-generator.js
View file @
321394b
...
@@ -425,6 +425,11 @@ const QueryGenerator = {
...
@@ -425,6 +425,11 @@ const QueryGenerator = {
},
},
nameIndexes
(
indexes
,
rawTablename
)
{
nameIndexes
(
indexes
,
rawTablename
)
{
if
(
typeof
rawTablename
===
'object'
)
{
// don't include schema in the index name
rawTablename
=
rawTablename
.
tableName
;
}
return
_
.
map
(
indexes
,
index
=>
{
return
_
.
map
(
indexes
,
index
=>
{
if
(
!
index
.
hasOwnProperty
(
'name'
))
{
if
(
!
index
.
hasOwnProperty
(
'name'
))
{
const
onlyAttributeNames
=
index
.
fields
.
map
(
field
=>
typeof
field
===
'string'
?
field
:
field
.
name
||
field
.
attribute
);
const
onlyAttributeNames
=
index
.
fields
.
map
(
field
=>
typeof
field
===
'string'
?
field
:
field
.
name
||
field
.
attribute
);
...
...
test/integration/query-interface.test.js
View file @
321394b
...
@@ -138,6 +138,8 @@ describe(Support.getTestDialectTeaser('QueryInterface'), () => {
...
@@ -138,6 +138,8 @@ describe(Support.getTestDialectTeaser('QueryInterface'), () => {
tableName
:
'table'
tableName
:
'table'
}).
then
(
indexes
=>
{
}).
then
(
indexes
=>
{
expect
(
indexes
.
length
).
to
.
eq
(
1
);
expect
(
indexes
.
length
).
to
.
eq
(
1
);
const
index
=
indexes
[
0
];
expect
(
index
.
name
).
to
.
eq
(
'table_name_is_admin'
);
});
});
});
});
});
});
...
...
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