diff --git a/README.md b/README.md index e296a80a..fecd2bd9 100644 --- a/README.md +++ b/README.md @@ -117,10 +117,11 @@ npm run local:init ``` - This command will do 2 things: + This command will do 3 things: - - create Database table - - create Elasticsearch indexes + - create Database tables (drop if exists) + - create Elasticsearch indexes (drop if exists) + - import demo data to Database and index it to ElasticSearch (clears any existent data if exist) 5. 🚀 Start Topcoder TaaS API @@ -153,7 +154,8 @@ | `npm run services:up` | Start services via docker-compose for local development. | | `npm run services:down` | Stop services via docker-compose for local development. | | `npm run services:logs -- -f ` | View logs of some service inside docker-compose. | -| `npm run local:init` | Creates Elasticsearch indexes and initializes Database. | +| `npm run local:init` | Recreate Database and Elasticsearch indexes and populate demo data for local development (removes any existent data). | +| `npm run local:reset` | Recreate Database and Elasticsearch indexes (removes any existent data). | | `npm run cov` | Code Coverage Report. | | `npm run migrate` | Run any migration files which haven't run yet. | | `npm run migrate:undo` | Revert most recent migration. | diff --git a/package.json b/package.json index 28fdc09d..26c34c85 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "services:up": "docker-compose -f ./local/docker-compose.yml up -d", "services:down": "docker-compose -f ./local/docker-compose.yml down", "services:logs": "docker-compose -f ./local/docker-compose.yml logs", - "local:init": "npm run create-index && npm run init-db", + "local:init": "npm run local:reset && npm run data:import -- --force", + "local:reset": "npm run delete-index -- --force && npm run create-index -- --force && npm run init-db force", "cov": "nyc --reporter=html --reporter=text mocha test/unit/*.test.js --timeout 30000 --exit" }, "keywords": [],