Comments (7)
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.
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.
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.
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.
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.
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.
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)
- Unable to load custom TS aliases like `@/models` HOT 4
- Unable to load environment variables from `.env.local` HOT 3
- Importing `IOptions` interface externally HOT 3
- prune not pruning the migrations HOT 2
- swc/core issue: "Cannot find module '../index.js'" HOT 3
- How to use migrations from within code? HOT 1
- Duplicate identifier HOT 10
- Possibly a problem with dynamic import HOT 7
- swcrc module type HOT 8
- compiling the migration file HOT 3
- commander.ts doesn't seem to pass the `connectOptions` forward HOT 3
- ESM problem with wrong export * as IOptions from './interfaces/IOptions'; HOT 4
- runMigration() fails while importing the migration file using ESM HOT 4
- v3.6.3 Client must be connected before running operations HOT 1
- Using tsyringe in migration file HOT 1
- Proper way to scale migrations HOT 1
- Want to be able work with centralized migration with multiple sub migration. HOT 1
- Choose env.<local,dev,staging,prod> HOT 2
- Can't access models when running the package programmatically HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-migrate-mongoose.