Skip to content

Commit 5fda963

Browse files
authored
Merge pull request #129 from topcoder-platform/feature/data-scripts
Feature/data scripts - improvements
2 parents f9a65a9 + e07acb4 commit 5fda963

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@
117117
npm run local:init
118118
```
119119

120-
This command will do 2 things:
120+
This command will do 3 things:
121121

122-
- create Database table
123-
- create Elasticsearch indexes
122+
- create Database tables (drop if exists)
123+
- create Elasticsearch indexes (drop if exists)
124+
- import demo data to Database and index it to ElasticSearch (clears any existent data if exist)
124125

125126
5. 🚀 Start Topcoder TaaS API
126127

@@ -153,7 +154,8 @@
153154
| `npm run services:up` | Start services via docker-compose for local development. |
154155
| `npm run services:down` | Stop services via docker-compose for local development. |
155156
| `npm run services:logs -- -f <service_name>` | View logs of some service inside docker-compose. |
156-
| `npm run local:init` | Creates Elasticsearch indexes and initializes Database. |
157+
| `npm run local:init` | Recreate Database and Elasticsearch indexes and populate demo data for local development (removes any existent data). |
158+
| `npm run local:reset` | Recreate Database and Elasticsearch indexes (removes any existent data). |
157159
| `npm run cov` | Code Coverage Report. |
158160
| `npm run migrate` | Run any migration files which haven't run yet. |
159161
| `npm run migrate:undo` | Revert most recent migration. |

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"services:up": "docker-compose -f ./local/docker-compose.yml up -d",
2424
"services:down": "docker-compose -f ./local/docker-compose.yml down",
2525
"services:logs": "docker-compose -f ./local/docker-compose.yml logs",
26-
"local:init": "npm run create-index && npm run init-db",
26+
"local:init": "npm run local:reset && npm run data:import -- --force",
27+
"local:reset": "npm run delete-index -- --force && npm run create-index -- --force && npm run init-db force",
2728
"cov": "nyc --reporter=html --reporter=text mocha test/unit/*.test.js --timeout 30000 --exit"
2829
},
2930
"keywords": [],

0 commit comments

Comments
 (0)