question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m submitting a…


[ ] Regression 
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I can’t understand how can I use migrations with @nestjs/typeorm.

Expected behavior

As developer, I want to have a doc explaining how to use @nestjs/typeorm migrations.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Nest version: 5.0.0

 
For Tooling issues:
- Node version: 9.6.0  
- Platform:  Mac 

Others:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:16
  • Comments:26 (4 by maintainers)

github_iconTop GitHub Comments

55reactions
benswinburnecommented, Jun 12, 2019

I believe ultimately what people want from this is a NestJS way of running migrations, not a TypeORM way of running migrations which may or many not work with Nest.

Whilst that is doable through putting a config file here or duplicating something there, there isn’t a Nest way of doing it. A framework like Nest is beginning to provide an all encompassing solution to many of the things necessary to build an application; of which, migrations are one.

In an ideal world, Nest would facilitate a means by which to run or proxy the migrations of TypeORM (or whichever ORM people are using, Objection for example).

nest migrate which perhaps runs typeorm migrate with the configuration from Nest passed in would be it’s most simple form?

I personally don’t want to have multiple cli tools installed to manage the framework and the application(s) built on it. There’s a fantastic plugin architecture but seemingly no way to integrate these plugins into the CLI. If nestjs/typeorm could register commands with Nestjs and Nestjs would bootstrap and pass information from things like the config and the container etc into that CLI then nestjs/typeorm could register commands like nest migrate etc.

Providing a means by which for the various plugins to extend the CLI not only would help solve this particular issue, but simplifies the UX of the framework in its entirety.

On Wed, 12 Jun 2019 at 15:55, SriNath notifications@github.com wrote:

Actually, I don’t think we should copy & paste typeorm documentation and duplicate it inside Nest docs. The migrations feature has nothing to do with @nestjs/typeorm wrapper, you shall follow instructions written down here https://github.com/typeorm/typeorm/blob/master/docs/migrations.md, as @BrunnerLivio https://github.com/BrunnerLivio mentioned.

Yes, I agree that it is not principally correct and neither does it afford any use. It is merely redundant. However, do you have examples/samples of how nestjs can connect with typeorm? If not, then I strongly feel having one would help people who are new to Angular way of thinking and its architecture.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nestjs/typeorm/issues/33?email_source=notifications&email_token=AAJHFEJ24UMATVSI3NMNKLTP2EE73A5CNFSM4FERG5S2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXQWRKQ#issuecomment-501311658, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJHFEPJZGWOT2GAEGH2QQLP2EE73ANCNFSM4FERG5SQ .

26reactions
kamilmysliwieccommented, Jun 22, 2018

Actually, I don’t think we should copy & paste typeorm documentation and duplicate it inside Nest docs. The migrations feature has nothing to do with @nestjs/typeorm wrapper, you shall follow instructions written down here, as @BrunnerLivio mentioned.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database Migration: What It Is and How to Do It - CloudBees
Now that you know how database migrations came about, let me walk you ... Option 2: Use Independent Database-Migration-Focused Software.
Read more >
Usage - db-migrate - Read the Docs
To use db-migrate, you call it via the command line. When entering only the command without paramaters you will see something like this:...
Read more >
Database Migrations: What are the Types of DB ... - Prisma
Discover how database migrations allow developers to make controlled, ... State vs change based migrations; How do you use database migrations?
Read more >
Database migration: Concepts and principles (Part 1)
In some use cases, data is migrated from source databases to target databases unmodified. These straight-through migrations are typically ...
Read more >
Database Migration: What It Is and How It Is Done | Astera
Database migration moves data from one database to another. Find out how you can expedite the process with a data migration tool.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found