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

feat: scaffold DB migration script for new app projects #2094

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Nov 29, 2018

As a follow-up for #2059:

  • Add a template of migrate.ts to lb4 app generator. All new app project will be created with src/migrate.ts now.

  • Further extend lb4 app generator to include the following npm/package script:

    "migrate": "node ./dist/src/migrate"
    
  • Apply these changes to examples/todo and examples/todo-list

  • Update Database migrations documentation page accordingly.

Checklist

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

@bajtos bajtos added Examples feature CLI Repository Issues related to @loopback/repository package labels Nov 29, 2018
@bajtos bajtos self-assigned this Nov 29, 2018
@bajtos bajtos requested review from raymondfeng and a team November 29, 2018 12:43
@bajtos bajtos requested a review from hacksparrow as a code owner November 29, 2018 12:43
Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@jannyHou
Copy link
Contributor

Do we have any plan to update other example repos like todo-list?

Copy link
Contributor

@b-admike b-admike left a comment

Choose a reason for hiding this comment

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

LGTM 🎉. On a side note, should we have the migrate script on other example projects besides todo? Janny already mentioned it :)

@bajtos
Copy link
Member Author

bajtos commented Nov 30, 2018

Do we have any plan to update other example repos like todo-list?

  • I am adding src/migrate.ts and npm run migrate to examples/todo-list as part of this PR.
  • examples/todo already contains src/migrate.ts, I added it as part of the previous PR. In this PR, I am adding npm run migrate script.

Did I miss anything?

@bajtos bajtos merged commit f783f07 into master Nov 30, 2018
@bajtos bajtos deleted the feat/cli-db-migration branch November 30, 2018 15:55
@jannyHou
Copy link
Contributor

sorry I found my comment was confusing, what I meant is

Do we have any plan to update other example repos like what's been added in this PR

I thought other examples in examples/* also needs the migration file but actually not. We are good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Examples feature Repository Issues related to @loopback/repository package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants