This uses mysql2-async and await to retreive data from a mysql instance contained within a docker container. To use:
- Install docker desktop or docker.io on linux (first time only).
- Run
docker-compose up
in the project folder to start the database. - The first time you use this run
npm install
- To run the migrations run
npm run migrate
- To run tests run
npm run test
- Install mysql workbench if you prefer and set up a connection to localhost to view the data
To create more migrations:
- run
node migrate.js create <migration_name>
- I noticed that when I did that the migration was created, but I needed to do ^c to stop it.
- put sql in the up.sql file and the down.sql file