-
Notifications
You must be signed in to change notification settings - Fork 2
Configured migrate-mongo as the DB migrations tool #786
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c0796b9
Configured migrate-mongo as the DB migrations tool
CapoMK25 f7e1f07
chore: added folder structure and gitkeep
CapoMK25 8a5f374
changed autoindex back to true to accomodate the current scope
CapoMK25 1e758b4
Update lodash to version 4.18.1 to avoid conflicts
tickBit 01b6fb1
Merge branch 'dev' into 451-configure-db-migrations-tool
tickBit e27a9fb
Merge branch 'dev' into 451-configure-db-migrations-tool
CapoMK25 0af25f3
Created a database dir at root, moved the files there and changed the…
CapoMK25 a76fbd0
Merge branch 'dev' into 451-configure-db-migrations-tool
CapoMK25 08be9f5
Merge branch 'dev' into 451-configure-db-migrations-tool
CapoMK25 106d413
boilerplate readme
CapoMK25 5c6e536
small addition to docs
CapoMK25 43e4de1
Remade the readme with Kimi and modified it
CapoMK25 4a660a4
Merge branch 'dev' into 451-configure-db-migrations-tool
CapoMK25 c82eb51
Merge branch 'dev' into 451-configure-db-migrations-tool
CapoMK25 89b6f36
Migration is now tested as fully working with the upcoming sound setup
CapoMK25 5ddeffd
Merge branch 'dev' into 451-configure-db-migrations-tool
CapoMK25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| require('dotenv').config(); | ||
|
|
||
| const { | ||
| MONGO_USERNAME, | ||
| MONGO_PASSWORD, | ||
| MONGO_HOST, | ||
| MONGO_PORT, | ||
| MONGO_DB_NAME | ||
| } = process.env; | ||
|
|
||
| const url = `mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}/?replicaSet=rs0`; | ||
|
|
||
| const config = { | ||
| mongodb: { | ||
| url: url, | ||
| databaseName: MONGO_DB_NAME, | ||
| options: { | ||
| } | ||
| }, | ||
| migrationsDir: "src/database/migrations", | ||
| changelogCollectionName: "migrations_changelog", | ||
| migrationFileExtension: ".js", | ||
| useFileHash: false, | ||
| moduleSystem: 'esm', | ||
| }; | ||
|
|
||
| module.exports = config; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /** | ||
| * @param db {import('mongodb').Db} | ||
| * @param client {import('mongodb').MongoClient} | ||
| */ | ||
| export const up = async (db, client) => { | ||
| // TODO: Write your migration logic here when applicable | ||
| }; | ||
|
|
||
| /** | ||
| * @param db {import('mongodb').Db} | ||
| * @param client {import('mongodb').MongoClient} | ||
| */ | ||
| export const down = async (db, client) => { | ||
| // TODO: Write your rollback logic here when applicable | ||
| }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.