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 ad3de548
authored
Jan 24, 2012
by
Meg Sharkey
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'sequelize/master'
2 parents
a22ea8ec
2d3cdc4d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
9 deletions
changelog.md
lib/migrator.js
package.json
spec/config/config.js
changelog.md
View file @
ad3de54
# v1.3.1 #
-
[
REFACTORING
]
renamed ModelManager to ModelFactoryManager
-
[
IMPROVEMENT
]
decreased delay of CustomEventEmitter execution from 5ms to 1ms
-
[
IMPROVEMENT
]
improved performance of association handling (many-to-many) (thanks to magshark)
-
[
FEATURE
]
added possibility to specify name of the join table (thanks to magshark)
-
[
FEATURE
]
mysql is emitting a 'sql'-event when executing a query
-
[
BUG
]
correctly delete existing SequelizeMeta entry from database after undoing migration
-
[
BUG
]
fix path of migration files in executable
# v1.3.0 #
-
[
REFACTORING
]
Model#all is now a function and not a getter.
...
...
lib/migrator.js
View file @
ad3de54
...
...
@@ -36,9 +36,12 @@ module.exports = (function() {
emitter
.
emit
(
'failure'
,
err
)
}
else
{
var
chainer
=
new
Utils
.
QueryChainer
,
from
=
migrations
[
0
]
if
(
options
.
method
==
'down'
)
if
(
options
.
method
==
'down'
)
{
migrations
.
reverse
()
from
=
migrations
[
0
]
}
migrations
.
forEach
(
function
(
migration
)
{
chainer
.
add
(
migration
,
'execute'
,
[
options
],
{
...
...
@@ -51,7 +54,10 @@ module.exports = (function() {
console
.
log
(
'Executed migration: '
+
migration
.
filename
)
},
success
:
function
(
migration
,
callback
)
{
saveSuccessfulMigration
.
call
(
self
,
migrations
[
0
],
migration
,
callback
)
if
(
options
.
method
==
'down'
)
deleteUndoneMigration
.
call
(
self
,
from
,
migration
,
callback
)
else
saveSuccessfulMigration
.
call
(
self
,
from
,
migration
,
callback
)
}
})
})
...
...
@@ -195,5 +201,17 @@ module.exports = (function() {
})
}
var
deleteUndoneMigration
=
function
(
from
,
to
,
callback
)
{
var
self
=
this
self
.
findOrCreateSequelizeMetaModel
().
success
(
function
(
SequelizeMeta
)
{
SequelizeMeta
.
find
({
from
:
from
.
migrationId
,
to
:
to
.
migrationId
})
.
success
(
function
(
meta
)
{
meta
.
destroy
().
success
(
callback
)
})
})
}
return
Migrator
})()
package.json
View file @
ad3de54
{
"name"
:
"sequelize"
,
"description"
:
"MySQL ORM for Node.JS"
,
"version"
:
"1.3.
0
"
,
"version"
:
"1.3.
1
"
,
"author"
:
"Sascha Depold <sascha@depold.com>"
,
"contributors"
:
[
{
"name"
:
"Sascha Depold"
,
"email"
:
"sascha@depold.com"
}
{
"name"
:
"Sascha Depold"
,
"email"
:
"sascha@depold.com"
},
{
"name"
:
"Meg Sharkey"
}
],
"dependencies"
:
{
"mysql"
:
"0.9.x"
,
...
...
@@ -29,4 +30,4 @@
"node"
:
">=0.4.6"
},
"license"
:
"MIT"
}
\ No newline at end of file
}
spec/config/config.js
View file @
ad3de54
module
.
exports
=
{
username
:
"
meg
"
,
password
:
"meg"
,
database
:
'test'
,
username
:
"
root
"
,
password
:
null
,
database
:
'
sequelize_
test'
,
host
:
'127.0.0.1'
,
rand
:
function
()
{
return
parseInt
(
Math
.
random
()
*
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