2022-06-09 18:41:18 +00:00
|
|
|
|
2022-12-21 13:17:50 +00:00
|
|
|
const Myt = require('./myt');
|
2022-12-21 12:34:17 +00:00
|
|
|
const Command = require('./lib/command');
|
2022-06-09 18:41:18 +00:00
|
|
|
|
2022-12-21 12:34:17 +00:00
|
|
|
class Fixtures extends Command {
|
|
|
|
static usage = {
|
|
|
|
description: 'Dumps local fixtures from database',
|
|
|
|
operand: 'remote'
|
|
|
|
};
|
2022-06-09 18:41:18 +00:00
|
|
|
|
2022-12-21 12:34:17 +00:00
|
|
|
static localOpts = {
|
|
|
|
default: {
|
|
|
|
remote: 'docker'
|
|
|
|
}
|
|
|
|
};
|
2022-06-09 18:41:18 +00:00
|
|
|
|
2022-12-21 13:17:50 +00:00
|
|
|
async run(myt, opts) {
|
|
|
|
const dumpStream = await myt.initDump('fixtures.sql');
|
|
|
|
await myt.dumpFixtures(dumpStream, opts.localFixtures, true);
|
2022-06-09 18:41:18 +00:00
|
|
|
await dumpStream.end();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Fixtures;
|
|
|
|
|
|
|
|
if (require.main === module)
|
2022-12-21 13:17:50 +00:00
|
|
|
new Myt().run(Fixtures);
|
2022-06-09 18:41:18 +00:00
|
|
|
|