fullcube / loopback-component-migrate Goto Github PK
View Code? Open in Web Editor NEWMigration framework for loopback
Migration framework for loopback
Branch | Build failing π¨ |
---|---|
Dependency | commander |
Current Version | 2.15.1 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
commander is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 17 commits.
4cc348b
Merge pull request #822 from abetomo/version_bump_2.16.0
8db14db
version bump 2.16.0
1f9354f
Remove Makefile and test/run
(#821)
3f4f5ca
Make 'npm test' run on Windows (#820)
3b8e519
Merge pull request #807 from styfle/patch-1
77ffd4f
Merge pull request #814 from DanielRuf/chore/cache-node-modules
6889693
chore: cache node_modules
ff2f618
Merge pull request #813 from DanielRuf/chore/remove-nodejs-4-add-nodejs-10
d5c1d7d
chore: remove Node.js 4 (EOL), add Node.js 10
c05ed98
Merge pull request #812 from yausername/fixReadme
55ff22f
fixed typo in readme
2415089
Add badge to display install size
89edef0
Fix types (#804)
001d560
Update eslint to resolve vulnerabilities in lodash
988d09b
Merge pull request #791 from yausername/master
There are 17 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency | ghooks |
Current Version | 2.0.3 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
ghooks is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 1 commits.
1e80ce2
fix: node_modules absolute entry point never getting found (#224)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
How can I run migrations from a command like npm run migrate
?
also where to put Migrate.migrate('up', function(err) {});
??
I thought I should be implementing this using the CLI so that it could be part of a deploy sequence, something like:
Note: I've aliased loopback-component-migrate
binary command to lcm
I created a migration via lcm create initial
which created the migration file in ./migrations/20160810101725-initial.js
. The migration file looks like:
module.exports = {
up: function(dataSource, next) {
console.log('running initial up');
next();
},
down: function(dataSource, next) {
console.log('running initial down');
next();
}
};
When I run lcm up
, first thing output is "Migrating up to: "20160810101725-initial.js" [TODO]" and then I see output from starting the app up, just like I'd see if I ran node server.js
. I don't see the logs I inserted into the migration or anything. The app continues to listen for web requests/socket messages...
I'm using MongoDB as my data store and when I look inside, I don't see a collection for Migrations
or anything.
Is there any way to generate migration file?
Branch | Build failing π¨ |
---|---|
Dependency |
loopback
|
Current Version | 3.19.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
loopback is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 3 commits.
3e3092c
3.19.1
07e7592
Merge pull request #3883 from strongloop/fix/principal-type-polymorphic-user
2aead13
Fix isOwner() bug in multiple-principal setup
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
It looks like this components is currently only working properly when using the in memory datasource.
I have tried changing the datasource to MySQL and i'm getting errors because the table doesnt exist.
Branch | Build failing π¨ |
---|---|
Dependency | bluebird |
Current Version | 3.5.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
bluebird is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Bugfixes:
PromiseRejectionEvent
to contain .reason
and .promise
properties. (#1509, #1464)The new version differs by 22 commits.
50067ec
Release v3.5.2
f290da0
Fix memory being retained until promise queue is completely empty (#1544)
ad6d763
Update benchmarks (#1539)
49da1ac
Fix a typo. (#1534)
b06106a
Fix typo in readme introduced in #1530 (#1531)
c1dc5b9
Update README.md (#1530)
e35455f
chore: clone last 5 commits (#1521)
91ae9ce
chore: add Node.js 10 (#1523)
9159472
Added a simple usage example (#1369)
39081ba
Update promise.each.md (#1479)
77781fe
Fix header (#1513)
b8eedc1
Update LICENSE to 2018 (#1490)
4163e82
Added ES6 way to import the bluebird promise (#1461)
3790a92
DOC: add direct link to Promise.delay from API ref (#1465)
e8d8525
Update error documentation (#1469)
There are 22 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
I'm implementing the migration in a boot script before my actual application code is run like this:
const loopback = require('loopback');
const Migration = loopback.getModel('Migration');
module.exports = app => {
Migration.migrate('up', error => {
if (error) {
console.error('Error in migrations: %s', error.stack);
return;
}
console.log('boot app now');
});
};
This works when there are actual migrations pending. However, if not, I see "No new migrations to run." outputted, but the "boot app now" log line never gets executed.
If I put cb()
here: https://github.com/fullcube/loopback-component-migrate/blob/master/lib/models/migration.js#L152, it works ok, but I'm pretty sure that's not correct, also, this wouldn't return a promise. I'm not sure how to fix this in the right way.
I think you should be able to select the data source that you're migrating as part of the API rather than only selecting a single data source in a config file.
While working on the pull request I just submitted, I noticed that the MigrationMap model seems unused. Apart from the index.js defining the model and the files that define the model, there is absolutely no reference to it.
Can it be removed? I'd rather not have unused tables in my database... :)
Cheers,
Jouke
No where in the docs its mentioned how to generate migration files
Currently, migrationsDir expects an absolute path (even though the default value of server/migrations is relative). Path should be relative to the application root.
It would be really nice to be able to run migrations that apply to the current environment. The implementation could be similar to how Loopback currently deals with environment based configs. For example, if you only want to run a migration on stage you could name you file 0001-migration.stage.js
or if you only wanted to run it on production, it would be 0001-migration.production.js
.
The vulnerability report shows that there is a dependency with security issues.
https://david-dm.org/fullcube/loopback-component-migrate
The recommended path is to update the package
https://nodesecurity.io/advisories/534
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.