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 809453f7
authored
May 07, 2013
by
Martin Aspeli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor updates following comments form @janmeier
1 parent
35aeb2c8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 additions
and
12 deletions
lib/dialects/sqlite/connector-manager.js
spec-jasmine/sqlite/query-generator.spec.js
spec/associations/belongs-to.spec.js
spec/associations/has-many.spec.js
spec/associations/has-one.spec.js
lib/dialects/sqlite/connector-manager.js
View file @
809453f
...
...
@@ -7,7 +7,7 @@ module.exports = (function() {
this
.
sequelize
=
sequelize
this
.
database
=
db
=
new
sqlite3
.
Database
(
sequelize
.
options
.
storage
||
':memory:'
,
function
(
err
)
{
if
(
!
err
&&
sequelize
.
options
.
foreignKeys
!==
false
)
{
// Make it possible to define and use foreign key constraints un
el
ss
// Make it possible to define and use foreign key constraints un
le
ss
// explicitly disallowed. It's still opt-in per relation
db
.
run
(
'PRAGMA FOREIGN_KEYS=ON'
)
}
...
...
spec-jasmine/sqlite/query-generator.spec.js
View file @
809453f
...
...
@@ -71,14 +71,6 @@ describe('QueryGenerator', function() {
expectation
:
"CREATE TABLE IF NOT EXISTS `myTable` (`title` VARCHAR(255), `name` VARCHAR(255));"
},
{
arguments
:
[
'myTable'
,
{
title
:
'VARCHAR(255)'
,
name
:
'VARCHAR(255)'
}],
expectation
:
"CREATE TABLE IF NOT EXISTS `myTable` (`title` VARCHAR(255), `name` VARCHAR(255));"
},
{
arguments
:
[
'myTable'
,
{
title
:
'VARCHAR(255)'
,
name
:
'VARCHAR(255)'
}],
expectation
:
"CREATE TABLE IF NOT EXISTS `myTable` (`title` VARCHAR(255), `name` VARCHAR(255));"
},
{
arguments
:
[
'myTable'
,
{
title
:
'ENUM("A", "B", "C")'
,
name
:
'VARCHAR(255)'
}],
expectation
:
"CREATE TABLE IF NOT EXISTS `myTable` (`title` ENUM(\"A\", \"B\", \"C\"), `name` VARCHAR(255));"
},
...
...
spec/associations/belongs-to.spec.js
View file @
809453f
...
...
@@ -135,7 +135,6 @@ describe(Helpers.getTestDialectTeaser("BelongsTo"), function() {
var
tableName
=
user
.
QueryInterface
.
QueryGenerator
.
addSchema
(
user
.
__factory
)
user
.
QueryInterface
.
update
(
user
,
tableName
,
{
id
:
999
},
user
.
id
)
.
success
(
function
()
{
// Should fail due to FK restriction
Task
.
findAll
().
success
(
function
(
tasks
)
{
expect
(
tasks
.
length
).
toEqual
(
1
)
expect
(
tasks
[
0
].
UserId
).
toEqual
(
999
)
...
...
spec/associations/has-many.spec.js
View file @
809453f
...
...
@@ -411,7 +411,6 @@ describe(Helpers.getTestDialectTeaser("HasMany"), function() {
var
tableName
=
user
.
QueryInterface
.
QueryGenerator
.
addSchema
(
user
.
__factory
)
user
.
QueryInterface
.
update
(
user
,
tableName
,
{
id
:
999
},
user
.
id
)
.
success
(
function
()
{
// Should fail due to FK restriction
Task
.
findAll
().
success
(
function
(
tasks
)
{
expect
(
tasks
.
length
).
toEqual
(
1
)
expect
(
tasks
[
0
].
UserId
).
toEqual
(
999
)
...
...
spec/associations/has-one.spec.js
View file @
809453f
...
...
@@ -135,7 +135,6 @@ describe(Helpers.getTestDialectTeaser("HasOne"), function() {
var
tableName
=
user
.
QueryInterface
.
QueryGenerator
.
addSchema
(
user
.
__factory
)
user
.
QueryInterface
.
update
(
user
,
tableName
,
{
id
:
999
},
user
.
id
)
.
success
(
function
()
{
// Should fail due to FK restriction
Task
.
findAll
().
success
(
function
(
tasks
)
{
expect
(
tasks
.
length
).
toEqual
(
1
)
expect
(
tasks
[
0
].
UserId
).
toEqual
(
999
)
...
...
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