Giter VIP home page Giter VIP logo

Comments (5)

seppevs avatar seppevs commented on May 26, 2024

I don't think that's a migrate-mongo issue.

The error test.physical-type' already exists indicates the collection 'physical-type' already exists. Are you sure you have deleted your existing data?

I also don't understand your setup, it looks way too complicated to me.

For example:

  1. I see that your migration files are in the directory 'scripts/sprint001', while your config indicates they are in the dir 'migrations'.
  2. Why did you rename & move the generated migration files? It's not something I supported. Plus, the generated 'timestamp' prefix is important: it is used to determine the order of your migrations.
  3. I have no idea what npm run deploy does, because you have not checked in a package.json file in your migrate-mongo-issue git repo.

Please follow the Quickstart section of the README, and use migrate-mongo as intended.

from migrate-mongo.

stherrienaspnet avatar stherrienaspnet commented on May 26, 2024

Hello, I just push the file package.json sorry for that. If you make a pull you will see it clearly, the predeloy.js will just take script in the folders and move them into migrations folder and they will be in alpha order. I really deleted manually the database. If you try it you will probably see what I see. Just exec npm run deploy and delete the test bd and exec npm run deploy again you should see that strange behaviour.

from migrate-mongo.

seppevs avatar seppevs commented on May 26, 2024

I currently don't have the time to reproduce your issue, but I'm 100% sure it's not an issue with migrate-mongo: The error is clearly stating that the collection test.physical-type already exists (when your migration is trying to create that collection).

EDIT: I've just spotted a serious flaw in your migration script:
https://github.com/stherrienaspnet/migrate-mongo-issue/blob/master/scripts/sprint001/script001-add-physical-type.js
=> You did not call next() callback correctly. You need to call it when all your I/O operations are done.
In your script, you did not provide a callback to the createCollection and insertMany functions (or used their Promise counterpart).

Please read how i/o works in Node.js. I'm afraid I don't have the time to help you with that.

from migrate-mongo.

stherrienaspnet avatar stherrienaspnet commented on May 26, 2024

Thanks :) using async(db, next), await and next to the latest io operation finally resolve it :)

from migrate-mongo.

seppevs avatar seppevs commented on May 26, 2024

Great, good luck!

from migrate-mongo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.