Git Product home page Git Product logo

Comments (7)

ilovepixelart avatar ilovepixelart commented on June 18, 2024

Hm this is very strange setup, will be happy to hear more about it in detail.

I would assume now that use have multiple repos that represent individual project this means you can setup migration individually to each repo lets say they called Service A, Service B

Lets imagine you use .ts .json config in your repos

In Service A:

{
  "uri": "mongodb://localhost/my-db",
  "migrationsPath": "migrations"
  "collection": "service-a"
}

In Service B:

{
  "uri": "mongodb://localhost/my-db",
  "migrationsPath": "migrations"
  "collection": "service-b"
}

If you use CLI mode -c, --collection should be provided with the name service-a, service-b

from ts-migrate-mongoose.

ilovepixelart avatar ilovepixelart commented on June 18, 2024

For monorepo you can setup migration once but provide path to configs I gave as example above
-f, --config-path and path to config service-a.json, service-b.json

from ts-migrate-mongoose.

ilovepixelart avatar ilovepixelart commented on June 18, 2024

There is also setup property for migration folder path you can use it in combination with schema prop, basically explore readme and try achieving with tools provided first and then we can reevaluate

from ts-migrate-mongoose.

lanz0519 avatar lanz0519 commented on June 18, 2024

In your example, "collection": "service-a" and "collection": "service-b" are my current solutions, but I think this would result in having multiple tables for different services, which may appear confusing.
I would like to have the collections for all services be the same, but ensure that the migration for each service does not affect each other.

from ts-migrate-mongoose.

lanz0519 avatar lanz0519 commented on June 18, 2024

When I initialize a project, I would like to use "migrate up" to handle all migrations in the directories at once. It would be cumbersome for me to specify the path one by one.
Can we refer to mongo-migrate here? I have just migrated from it.

from ts-migrate-mongoose.

ilovepixelart avatar ilovepixelart commented on June 18, 2024

I think it doesn't really matter how it's implemented somewhere else, still feels like a niche functionality for my project. Idea with db/fs sync is that you always sure about your migration state and if you deleted file you must run prune command to resync

from ts-migrate-mongoose.

lanz0519 avatar lanz0519 commented on June 18, 2024

Alternatively, we should make sure that if a file is missing, it will not throw an error and interrupt the code execution.

from ts-migrate-mongoose.

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.