Data Migrations for Elacticsearch
Vue Storefront uses Elasticsearch as a primary data store. We're using Redis as a cache layer and Kue for queue processing.
Although all of these data stores are basically schema-free, some mappings and meta data should be used for setting ES indices and so forth.
Vue Storefront uses a data-migration mechanism based on node-migrate.
We use node-migrate, which is pre-configured with npm, so we're using the following alias:
npm run migrate
which runs the migrations against
How to add new migration?
You can add a new migration by simply adding a file to the
migrations directory (not recommended) or using the command line tool:
npm run migrate create name-of-my-migration
The tool automatically generates the file under the
The example migrations show how to manipulate products and mappings. Let's take a look at the mapping modification:
... and that's it 😃