You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
734 B
JavaScript

#!/usr/bin/env node
"use strict";
const yargs = require("yargs");
const matchValue = require("match-value");
let argv = yargs
.command("change", "Create a new schema revision")
.command("upgrade <revision>", "Upgrade the database to a new schema revision", {
revision: { describe: "The number of the revision to upgrade to (or 'latest')" }
})
.command("undo", "Undo the most recent schema revision upgrade")
.command("show <revision>", "Show the full database schema at a given revision")
.argv;
console.log(argv);
matchValue(argv._[0], {
change: () => {
console.log("change");
},
upgrade: () => {
console.log("upgrade");
},
undo: () => {
console.log("undo");
},
show: () => {
console.log("show");
}
});