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 ad2661d0
authored
Nov 27, 2013
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1087 from webcast-io/feature/export-migrator-helpers
Make available migrator helpers
2 parents
c96e3d22
622e1e33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
lib/migrator.js
lib/migrator.js
View file @
ad2661d
...
@@ -233,7 +233,7 @@ module.exports = (function() {
...
@@ -233,7 +233,7 @@ module.exports = (function() {
// private
// private
var
getLastMigrationFromDatabase
=
function
()
{
var
getLastMigrationFromDatabase
=
Migrator
.
prototype
.
getLastMigrationFromDatabase
=
function
()
{
var
self
=
this
var
self
=
this
return
new
Utils
.
CustomEventEmitter
(
function
(
emitter
)
{
return
new
Utils
.
CustomEventEmitter
(
function
(
emitter
)
{
...
@@ -255,7 +255,7 @@ module.exports = (function() {
...
@@ -255,7 +255,7 @@ module.exports = (function() {
}).
run
()
}).
run
()
}
}
var
getLastMigrationIdFromDatabase
=
function
()
{
var
getLastMigrationIdFromDatabase
=
Migrator
.
prototype
.
getLastMigrationIdFromDatabase
=
function
()
{
var
self
=
this
var
self
=
this
return
new
Utils
.
CustomEventEmitter
(
function
(
emitter
)
{
return
new
Utils
.
CustomEventEmitter
(
function
(
emitter
)
{
...
@@ -270,7 +270,7 @@ module.exports = (function() {
...
@@ -270,7 +270,7 @@ module.exports = (function() {
}).
run
()
}).
run
()
}
}
var
getFormattedDateString
=
function
(
s
)
{
var
getFormattedDateString
=
Migrator
.
prototype
.
getFormattedDateString
=
function
(
s
)
{
var
result
=
null
var
result
=
null
try
{
try
{
...
@@ -282,11 +282,11 @@ module.exports = (function() {
...
@@ -282,11 +282,11 @@ module.exports = (function() {
return
result
return
result
}
}
var
stringToDate
=
function
(
s
)
{
var
stringToDate
=
Migrator
.
prototype
.
stringToDate
=
function
(
s
)
{
return
moment
(
getFormattedDateString
(
s
),
"YYYYMMDDHHmmss"
)
return
moment
(
getFormattedDateString
(
s
),
"YYYYMMDDHHmmss"
)
}
}
var
saveSuccessfulMigration
=
function
(
from
,
to
,
callback
)
{
var
saveSuccessfulMigration
=
Migrator
.
prototype
.
saveSuccessfulMigration
=
function
(
from
,
to
,
callback
)
{
var
self
=
this
var
self
=
this
self
.
findOrCreateSequelizeMetaDAO
().
success
(
function
(
SequelizeMeta
)
{
self
.
findOrCreateSequelizeMetaDAO
().
success
(
function
(
SequelizeMeta
)
{
...
@@ -296,7 +296,7 @@ module.exports = (function() {
...
@@ -296,7 +296,7 @@ module.exports = (function() {
})
})
}
}
var
deleteUndoneMigration
=
function
(
from
,
to
,
callback
)
{
var
deleteUndoneMigration
=
Migrator
.
prototype
.
deleteUndoneMigration
=
function
(
from
,
to
,
callback
)
{
var
self
=
this
var
self
=
this
self
.
findOrCreateSequelizeMetaDAO
().
success
(
function
(
SequelizeMeta
)
{
self
.
findOrCreateSequelizeMetaDAO
().
success
(
function
(
SequelizeMeta
)
{
...
...
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