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 4de34c55
authored
Apr 30, 2019
by
Simon Schick
Committed by
GitHub
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(sync): handle alter correctly with underscored/aliased columns (#10872)
1 parent
5767fbac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
lib/model.js
test/integration/sequelize.test.js
lib/model.js
View file @
4de34c5
...
...
@@ -1296,7 +1296,7 @@ class Model {
const
removedConstraints
=
{};
_
.
each
(
attributes
,
(
columnDesc
,
columnName
)
=>
{
if
(
!
columns
[
columnName
])
{
if
(
!
columns
[
columnName
]
&&
!
columns
[
attributes
[
columnName
].
field
]
)
{
changes
.
push
(()
=>
this
.
QueryInterface
.
addColumn
(
this
.
getTableName
(
options
),
attributes
[
columnName
].
field
||
columnName
,
attributes
[
columnName
]));
}
});
...
...
test/integration/sequelize.test.js
View file @
4de34c5
...
...
@@ -1120,6 +1120,20 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
});
});
it
(
'handles alter: true with underscore correctly'
,
function
()
{
this
.
sequelize
.
define
(
'access_metric'
,
{
user_id
:
{
type
:
DataTypes
.
INTEGER
}
},
{
underscored
:
true
});
return
this
.
sequelize
.
sync
({
alter
:
true
});
});
describe
(
"doesn't emit logging when explicitly saying not to"
,
()
=>
{
afterEach
(
function
()
{
this
.
sequelize
.
options
.
logging
=
false
;
...
...
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