Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
migrate-js v0.0.4
node v4.9.1
version:
0.0.4
endpoint
share
tweet
This is a playground to test JavaScript. It runs a completely standard copy of Node.js on a virtual server created just for you. Every one of npm’s 300,000+ packages are pre-installed, so try it out:
const Migrate = require("migrate-js"); const migrate = new Migrate(); await migrate.create("add-users"); await migrate.create("add-blog-posts"); let pending = await migrate.pending(); console.log("pending", pending.migrations.map((m) => m.title)); migrate.on("migration", (migration, direction) => { console.log(`${direction}: ${migration.title}`); }); await migrate.up(); pending = await migrate.pending(); console.log("pending", pending.migrations.map((m) => m.title)); let executed = await migrate.executed(); console.log("executed", executed.migrations.map((m) => m.title)); await migrate.down(); executed = await migrate.executed(); console.log("executed", executed.migrations.map((m) => m.title)); pending = await migrate.pending(); console.log("pending", pending.migrations.map((m) => m.title));
Loading…
no comments
sign in
to comment