feat(cli): create DB in start command if not exists (#285)

This commit is contained in:
Ali BARIN
2022-04-08 11:36:35 +02:00
committed by GitHub
parent 75eda7f2af
commit c227dc86bb
19 changed files with 211 additions and 126 deletions

View File

@@ -1,15 +1,3 @@
import User from '../../src/models/user';
import '../../src/config/orm';
import logger from '../../src/helpers/logger';
const userParams = {
email: 'user@automatisch.io',
password: 'sample',
};
async function createUser() {
const user = await User.query().insertAndFetch(userParams);
logger.info(`User has been saved: ${user.email}`);
}
import { createUser } from './utils';
createUser();