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 731ccd00
authored
Jan 17, 2016
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5236 from ajfranzoia/fixes-jshint-2.9.1
Code fixes for jshint@2.9.1
2 parents
25a24203
72c0fb8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
lib/dialects/abstract/query.js
lib/query-interface.js
test/integration/transaction.test.js
lib/dialects/abstract/query.js
View file @
731ccd0
...
...
@@ -109,17 +109,6 @@ var groupJoinData = function(rows, includeOptions, options) {
includeMap
[
previousPiece
]
=
$current
;
}
}
// Calcuate the last item in the array prefix ('Results' for 'User.Results.id')
,
lastKeyPrefixMemo
=
{}
,
lastKeyPrefix
=
function
(
key
)
{
if
(
!
lastKeyPrefixMemo
[
key
])
{
var
prefix
=
keyPrefix
(
key
)
,
length
=
prefix
.
length
;
lastKeyPrefixMemo
[
key
]
=
!
length
?
''
:
prefix
[
length
-
1
];
}
return
lastKeyPrefixMemo
[
key
];
}
// Calculate the string prefix of a key ('User.Results' for 'User.Results.id')
,
keyPrefixStringMemo
=
{}
,
keyPrefixString
=
function
(
key
,
memo
)
{
...
...
@@ -150,6 +139,17 @@ var groupJoinData = function(rows, includeOptions, options) {
}
return
keyPrefixMemo
[
key
];
}
// Calcuate the last item in the array prefix ('Results' for 'User.Results.id')
,
lastKeyPrefixMemo
=
{}
,
lastKeyPrefix
=
function
(
key
)
{
if
(
!
lastKeyPrefixMemo
[
key
])
{
var
prefix
=
keyPrefix
(
key
)
,
length
=
prefix
.
length
;
lastKeyPrefixMemo
[
key
]
=
!
length
?
''
:
prefix
[
length
-
1
];
}
return
lastKeyPrefixMemo
[
key
];
}
,
getUniqueKeyAttributes
=
function
(
model
)
{
var
uniqueKeyAttributes
=
Utils
.
_
.
chain
(
model
.
uniqueKeys
);
uniqueKeyAttributes
=
uniqueKeyAttributes
...
...
lib/query-interface.js
View file @
731ccd0
...
...
@@ -213,9 +213,11 @@ QueryInterface.prototype.dropTable = function(tableName, options) {
};
QueryInterface
.
prototype
.
dropAllTables
=
function
(
options
)
{
var
self
=
this
;
var
self
=
this
,
skip
;
options
=
options
||
{};
skip
=
options
.
skip
||
[];
var
dropAllTables
=
function
(
tableNames
)
{
return
Promise
.
each
(
tableNames
,
function
(
tableName
)
{
...
...
@@ -226,7 +228,6 @@ QueryInterface.prototype.dropAllTables = function(options) {
});
};
var
skip
=
options
.
skip
||
[];
return
self
.
showAllTables
(
options
).
then
(
function
(
tableNames
)
{
if
(
self
.
sequelize
.
options
.
dialect
===
'sqlite'
)
{
return
self
.
sequelize
.
query
(
'PRAGMA foreign_keys;'
,
options
).
then
(
function
(
result
)
{
...
...
test/integration/transaction.test.js
View file @
731ccd0
...
...
@@ -90,14 +90,14 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
field
:
'value'
}
})
,
self
=
this
,
transTest
=
function
(
val
)
{
return
self
.
sequelize
.
transaction
({
isolationLevel
:
'SERIALIZABLE'
},
function
(
t
)
{
return
SumSumSum
.
sum
(
'value'
,
{
transaction
:
t
}).
then
(
function
(
balance
)
{
return
SumSumSum
.
create
({
value
:
-
val
},
{
transaction
:
t
});
});
});
}
,
self
=
this
;
};
// Attention: this test is a bit racy. If you find a nicer way to test this: go ahead
return
SumSumSum
.
sync
({
force
:
true
}).
then
(
function
()
{
return
(
expect
(
Promise
.
join
(
transTest
(
80
),
transTest
(
80
),
transTest
(
80
))).
to
.
eventually
.
be
.
rejectedWith
(
'could not serialize access due to read/write dependencies among transactions'
));
...
...
@@ -239,7 +239,7 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
});
});
}
if
(
current
.
dialect
.
supports
.
transactionOptions
.
type
)
{
describe
(
'transaction types'
,
function
()
{
it
(
'should support default transaction type DEFERRED'
,
function
()
{
...
...
@@ -250,7 +250,7 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
});
});
});
Object
.
keys
(
Transaction
.
TYPES
).
forEach
(
function
(
key
)
{
it
(
'should allow specification of '
+
key
+
' type'
,
function
()
{
return
this
.
sequelize
.
transaction
({
...
...
@@ -262,7 +262,7 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
});
});
});
});
}
...
...
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