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 aa099574
authored
Jan 18, 2016
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5221 from sequelize/greenkeeper-jshint-2.9.1
jshint@2.9.1 breaks build
⚠
️
2 parents
8760076b
731ccd00
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
19 deletions
lib/dialects/abstract/query.js
lib/query-interface.js
package.json
test/integration/transaction.test.js
lib/dialects/abstract/query.js
View file @
aa09957
...
...
@@ -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 @
aa09957
...
...
@@ -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
)
{
...
...
package.json
View file @
aa09957
...
...
@@ -61,7 +61,7 @@
"git"
:
"^0.1.5"
,
"hints"
:
"^0.2.0"
,
"istanbul"
:
"^0.4.0"
,
"jshint"
:
"^2.
8.0
"
,
"jshint"
:
"^2.
9.1
"
,
"lcov-result-merger"
:
"^1.0.0"
,
"mocha"
:
"^2.2.1"
,
"mysql"
:
"~2.10.0"
,
...
...
test/integration/transaction.test.js
View file @
aa09957
...
...
@@ -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