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 3e534a9b
authored
Sep 27, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop the expected tables
1 parent
9d007d55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
test/dao-factory.test.js
test/dao-factory.test.js
View file @
3e534a9
...
...
@@ -3537,10 +3537,12 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
beforeEach
(
function
(
done
)
{
var
self
=
this
Support
.
clearDatabase
(
this
.
sequelize
,
function
()
{
self
.
Author
=
self
.
sequelize
.
define
(
'author'
,
{
firstName
:
Sequelize
.
STRING
})
self
.
Author
.
sync
({
force
:
true
}).
success
(
function
()
{
done
()
this
.
sequelize
.
getQueryInterface
().
dropTable
(
'posts'
,
{
force
:
true
}).
success
(
function
()
{
self
.
sequelize
.
getQueryInterface
().
dropTable
(
'authors'
,
{
force
:
true
}).
success
(
function
()
{
self
.
Author
=
self
.
sequelize
.
define
(
'author'
,
{
firstName
:
Sequelize
.
STRING
})
self
.
Author
.
sync
({
force
:
true
}).
success
(
function
()
{
done
()
})
})
})
})
...
...
@@ -3548,7 +3550,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
afterEach
(
function
(
done
)
{
var
self
=
this
self
.
sequelize
.
getQueryInterface
().
dropTable
(
'posts'
,
{
force
:
true
}).
success
(
function
()
{
this
.
sequelize
.
getQueryInterface
().
dropTable
(
'posts'
,
{
force
:
true
}).
success
(
function
()
{
self
.
sequelize
.
getQueryInterface
().
dropTable
(
'authors'
,
{
force
:
true
}).
success
(
function
()
{
done
()
})
...
...
@@ -3572,11 +3574,9 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
Post
.
sync
().
on
(
'sql'
,
function
(
sql
)
{
if
(
dialect
===
'postgres'
)
{
expect
(
sql
).
to
.
match
(
/"authorId" INTEGER REFERENCES "authors"
\(
"id"
\)
/
)
}
else
if
(
dialect
===
'mysql'
)
{
}
else
if
(
dialect
===
'mysql'
)
{
expect
(
sql
).
to
.
match
(
/FOREIGN KEY
\(
`authorId`
\)
REFERENCES `authors`
\(
`id`
\)
/
)
}
else
if
(
dialect
===
'sqlite'
)
{
}
else
if
(
dialect
===
'sqlite'
)
{
expect
(
sql
).
to
.
match
(
/`authorId` INTEGER REFERENCES `authors`
\(
`id`
\)
/
)
}
else
{
throw
new
Error
(
'Undefined dialect!'
)
...
...
@@ -3603,11 +3603,9 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
Post
.
sync
().
on
(
'sql'
,
function
(
sql
)
{
if
(
dialect
===
'postgres'
)
{
expect
(
sql
).
to
.
match
(
/"authorId" INTEGER REFERENCES "authors"
\(
"id"
\)
/
)
}
else
if
(
dialect
===
'mysql'
)
{
}
else
if
(
dialect
===
'mysql'
)
{
expect
(
sql
).
to
.
match
(
/FOREIGN KEY
\(
`authorId`
\)
REFERENCES `authors`
\(
`id`
\)
/
)
}
else
if
(
dialect
===
'sqlite'
)
{
}
else
if
(
dialect
===
'sqlite'
)
{
expect
(
sql
).
to
.
match
(
/`authorId` INTEGER REFERENCES `authors`
\(
`id`
\)
/
)
}
else
{
throw
new
Error
(
'Undefined dialect!'
)
...
...
@@ -3644,12 +3642,10 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}).
error
(
function
(
err
)
{
if
(
dialect
===
'mysql'
)
{
expect
(
err
.
message
).
to
.
match
(
/ER_CANNOT_ADD_FOREIGN|ER_CANT_CREATE_TABLE/
)
}
else
if
(
dialect
===
'sqlite'
)
{
}
else
if
(
dialect
===
'sqlite'
)
{
// the parser should not end up here ... see above
expect
(
1
).
to
.
equal
(
2
)
}
else
if
(
dialect
===
'postgres'
)
{
}
else
if
(
dialect
===
'postgres'
)
{
expect
(
err
.
message
).
to
.
match
(
/relation "4uth0r5" does not exist/
)
}
else
{
throw
new
Error
(
'Undefined dialect!'
)
...
...
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