aiiinotate 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/migrate.js +3 -3
- package/cli/utils/mongoClient.js +0 -1
- package/docker/Dockerfile +2 -0
- package/migrations/baseConfig.js +7 -6
- package/package.json +1 -1
package/cli/migrate.js
CHANGED
|
@@ -61,12 +61,12 @@ function migrateMake(migrationName) {
|
|
|
61
61
|
|
|
62
62
|
/** apply all pending migrations */
|
|
63
63
|
function migrateApply() {
|
|
64
|
-
migrationConfigs.map((mc) => execSync(`npx migrate-mongo up -f ${mc}`));
|
|
64
|
+
migrationConfigs.map((mc) => execSync(`npx -- migrate-mongo@^12.1.3 up -f ${mc}`));
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/** revert the last migration */
|
|
68
68
|
function migrateRevert() {
|
|
69
|
-
migrationConfigs.map((mc) => execSync(`npx migrate-mongo down -f ${mc}`));
|
|
69
|
+
migrationConfigs.map((mc) => execSync(`npx migrate-mongo@^12.1.3 down -f ${mc}`));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/** revert all migrations */
|
|
@@ -76,7 +76,7 @@ function migrateRevertAll() {
|
|
|
76
76
|
// do this for each migration file (prod and test database).
|
|
77
77
|
migrationConfigs.map((mc) =>
|
|
78
78
|
fs.readdirSync(dirMigrationsScripts).map((_) =>
|
|
79
|
-
execSync(`npx migrate-mongo down -f ${mc}`)
|
|
79
|
+
execSync(`npx migrate-mongo@^12.1.3 down -f ${mc}`)
|
|
80
80
|
)
|
|
81
81
|
)
|
|
82
82
|
}
|
package/cli/utils/mongoClient.js
CHANGED
package/docker/Dockerfile
CHANGED
|
@@ -15,6 +15,8 @@ WORKDIR /aiiinotate
|
|
|
15
15
|
COPY ./config/.env /aiiinotate/.env
|
|
16
16
|
# install the app as an NPM library
|
|
17
17
|
RUN npm i -g aiiinotate
|
|
18
|
+
|
|
19
|
+
RUN npm i -g migrate-mongo@^12.1.3
|
|
18
20
|
# migrate the database
|
|
19
21
|
RUN aiiinotate --env=/aiiinotate/.env -- migrate apply
|
|
20
22
|
# expose the used port
|
package/migrations/baseConfig.js
CHANGED
|
@@ -23,12 +23,13 @@ export default (config) => ({
|
|
|
23
23
|
|
|
24
24
|
databaseName: config.dbName,
|
|
25
25
|
|
|
26
|
-
options: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
options: {}
|
|
27
|
+
|
|
28
|
+
// setting `true` causes an error in docker and a warning in node.
|
|
29
|
+
// options: {
|
|
30
|
+
// useNewUrlParser: true, // removes a deprecation warning when connecting
|
|
31
|
+
// useUnifiedTopology: true, // removes a deprecating warning when connecting
|
|
32
|
+
// }
|
|
32
33
|
},
|
|
33
34
|
|
|
34
35
|
// The migrations dir, can be an relative or absolute path. Only edit this when really necessary.
|