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 f4b8b1bb
authored
Feb 19, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrap undo/migrate in an authenticate call and log error
1 parent
9a0b38ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
bin/sequelize
bin/sequelize
View file @
f4b8b1b
...
@@ -229,27 +229,31 @@ if (program.migrate || program.undo) {
...
@@ -229,27 +229,31 @@ if (program.migrate || program.undo) {
migratorOptions
=
_
.
merge
(
migratorOptions
,
{
filesFilter
:
/
\.
js$|
\.
coffee$/
})
migratorOptions
=
_
.
merge
(
migratorOptions
,
{
filesFilter
:
/
\.
js$|
\.
coffee$/
})
}
}
var
migrator
=
sequelize
.
getMigrator
(
migratorOptions
)
sequelize
.
authenticate
().
success
(
function
()
{
var
migrator
=
sequelize
.
getMigrator
(
migratorOptions
)
if
(
program
.
undo
)
{
migrator
.
findOrCreateSequelizeMetaDAO
().
success
(
function
(
Meta
)
{
if
(
program
.
undo
)
{
Meta
.
find
({
order
:
'id DESC'
}).
success
(
function
(
meta
)
{
migrator
.
findOrCreateSequelizeMetaDAO
().
success
(
function
(
Meta
)
{
if
(
meta
)
{
Meta
.
find
({
order
:
'id DESC'
}).
success
(
function
(
meta
)
{
migrator
=
sequelize
.
getMigrator
(
_
.
extend
(
migratorOptions
,
meta
.
values
),
true
)
if
(
meta
)
{
migrator
.
migrate
({
method
:
'down'
}).
success
(
function
()
{
migrator
=
sequelize
.
getMigrator
(
_
.
extend
(
migratorOptions
,
meta
.
values
),
true
)
migrator
.
migrate
({
method
:
'down'
}).
success
(
function
()
{
process
.
exit
(
0
)
})
}
else
{
console
.
log
(
"There are no pending migrations."
)
process
.
exit
(
0
)
process
.
exit
(
0
)
})
}
}
else
{
})
console
.
log
(
"There are no pending migrations."
)
process
.
exit
(
0
)
}
})
})
})
}
else
{
}
else
{
sequelize
.
migrate
().
success
(
function
()
{
sequelize
.
migrate
().
success
(
function
()
{
process
.
exit
(
0
)
process
.
exit
(
0
)
})
})
}
}
}).
error
(
function
(
err
)
{
console
.
error
(
"Unable to connect to database: "
+
err
)
})
}
else
{
}
else
{
console
.
log
(
'Cannot find "'
+
configuration
.
configFile
+
'". Have you run "sequelize --init"?'
)
console
.
log
(
'Cannot find "'
+
configuration
.
configFile
+
'". Have you run "sequelize --init"?'
)
process
.
exit
(
1
)
process
.
exit
(
1
)
...
...
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