Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] feat(cli): add help for db commands #139

Merged
merged 1 commit into from
Apr 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion packages/cli/src/commands/db.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import {spawn} from 'cross-spawn'
import {flags} from '@oclif/command'
import {Command} from '@oclif/command'
import chalk from 'chalk'
import * as path from 'path'

export default class Db extends Command {
static description = 'Run database commands'
static description = `Run database commands

${chalk.bold('migrate')} Run any needed migrations via Prisma 2 and generate Prisma Client.

${chalk.bold(
'introspect',
)} Will introspect the database defined in db/schema.prisma and automatically generate a complete schema.prisma file for you. Lastly, it\'ll generate Prisma Client.

${chalk.bold(
'studio',
)} Open the Prisma Studio UI at http://localhost:5555 so you can easily see and change data in your database.
`

static args = [
{
Expand All @@ -13,6 +26,10 @@ export default class Db extends Command {
},
]

static flags = {
help: flags.help({char: 'h'}),
}

async run() {
const {args} = this.parse(Db)
const command = args['command']
Expand Down