HomePhabricator
Diffusion Comm 40f76e5fe03a

[keyserver] Factor out create-db.js script into setupDB function

Description

[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:

  1. mysql -uroot -p and then run CREATE DATABASE comm3; GRANT ALL ON comm3.* TO comm@localhost;
  2. Update keyserver/secrets/db_config.json to use the new comm3 database
  3. Run yarn dev or yarn prod-build in the keyserver directory
  4. 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

Details