2018-02-16 12:01:04 +00:00
|
|
|
const mysql = require('mysql2/promise');
|
|
|
|
const fs = require('fs-extra');
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
try {
|
|
|
|
const connection = await mysql.createConnection({
|
|
|
|
host: 'localhost',
|
|
|
|
user: 'root',
|
|
|
|
multipleStatements: true
|
|
|
|
});
|
2018-04-26 13:13:56 +00:00
|
|
|
sql = await fs.readFile(`install/dump/fixtures.sql`, 'utf8');
|
2018-02-16 12:01:04 +00:00
|
|
|
await connection.query(sql);
|
|
|
|
await connection.end();
|
|
|
|
process.exit();
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
})();
|