[keyserver] Factor out create-db.js script into setupDB function
Summary:
Today, the only way to setup the MySQL database is via the create-db.js script. In a following diff, I'm working on making Node automatically setup the database if it is not set up.
Depends on D4141
Test Plan:
- mysql -uroot -p and then run CREATE DATABASE comm3; GRANT ALL ON comm3.* TO comm@localhost;
- Update keyserver/secrets/db_config.json to use the new comm3 database
- Run yarn dev or yarn prod-build in the keyserver directory
- mysql -uroot -p and then run USE comm3; SHOW TABLES; and see if the tables were all created
Reviewers: palys-swm, atul
Reviewed By: palys-swm
Subscribers: Adrian, yayabosh
Differential Revision: https://phabricator.ashoat.com/D4142