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

Feature request: Pretty print migrations #1913

Closed
douglas-treadwell opened this issue Jun 8, 2021 · 1 comment
Closed

Feature request: Pretty print migrations #1913

douglas-treadwell opened this issue Jun 8, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@douglas-treadwell
Copy link

Is your feature request related to a problem? Please describe.

It's somewhat less convenient to read a long string of text for a migration with many columns. I'd prefer to be able to read the column definitions vertically.

Describe the solution you'd like

It would be more readable to have each column on its own line, like TypeORM's migration:generate --pretty flag.
Personally I would just make the pretty-printed version the default, unless whitespace causes problems with some DB drivers.

Describe alternatives you've considered
I'm planning to manually add line breaks to the generated migrations for now.

@douglas-treadwell douglas-treadwell added the enhancement New feature or request label Jun 8, 2021
@B4nan
Copy link
Member

B4nan commented Jun 9, 2021

No plans to do this, as it could introduce issues in executing the queries - most of the adapters require (by default) to have single statement on a single line. Also it is (for most queries) knex that generates them, and as far as I know, there is no "pretty" option for knex (for this very same reason).

What I can offer is a way to plug in custom migration generator class, so you could for example extend the one you are using now and format the query how you like it.

@B4nan B4nan closed this as completed in 3cc366b Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants