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

Generate migration columns with comments #347

Merged
merged 4 commits into from
Aug 26, 2020
Merged

Generate migration columns with comments #347

merged 4 commits into from
Aug 26, 2020

Conversation

ghostwriter
Copy link
Contributor

  • single-quote and double-quote string accepted.

closes #344

Comment on lines +3 to +4
title: string:400 comment:"Some title for the profession"
description: string:400 nullable comment:'Some description for the profession'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought something like

Suggested change
title: string:400 comment:"Some title for the profession"
description: string:400 nullable comment:'Some description for the profession'
title: string:400 "comment:Some title for the profession"
description: string:400 nullable 'comment:Some description for the profession'

should have worked out of the box?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spaceemotion why is that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on https://blueprint.laravelshift.com/docs/model-data-types/:

When specifying an attribute or modifier value which contains a space, you must wrap the value in double quotes ("). For example, enum:Ordered,Completed,"On Hold". Blueprint will unwrap the value during parsing.

I thought this was a general thing for all attributes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It was. Or at least the double quotes. But in your example, you also quoted the attribute (i.e. comment)

Copy link
Collaborator

@jasonmccreary jasonmccreary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick tweak to tighten the quotes matching...

src/Lexers/ModelLexer.php Outdated Show resolved Hide resolved
Comment on lines +3 to +4
title: string:400 comment:"Some title for the profession"
description: string:400 nullable comment:'Some description for the profession'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spaceemotion why is that?

- ensure the opening and closing quotes match
@jasonmccreary jasonmccreary merged commit 62edefe into laravel-shift:master Aug 26, 2020
@ghostwriter ghostwriter deleted the feature/generate-migration-columns-with-comments branch August 26, 2020 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to generate comments for some db columns
3 participants