Skip to content
Snippets Groups Projects
Commit cbf8dfc4 authored by michael.minelli's avatar michael.minelli
Browse files

DB => Update seed for new schema

parent ff70aec0
No related branches found
No related tags found
No related merge requests found
require('dotenv').config(); // ATTENTION : This line MUST be the first of this file require('../src/InitialImports'); // ATTENTION : These lines MUST be the first of this file
require('../src/shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be the second of this file
import Config from '../src/config/Config'; import { UserRole } from '@prisma/client';
import logger from '../src/shared/logging/WinstonLogger'; import logger from '../src/shared/logging/WinstonLogger';
import * as bcrypt from 'bcryptjs';
import db from '../src/helpers/DatabaseHelper'; import db from '../src/helpers/DatabaseHelper';
async function main() { async function main() {
await db.user.upsert({ await db.user.upsert({
where : { gitlabId: 142 }, where : { id: 142 },
update: {}, update: {},
create: { create: {
id : 1, id : 142,
firstname: 'Michaël', gitlabUsername: 'michael.minelli',
lastname : 'Minelli', gitlabLastInfo: {},
mail : 'michael@minelli.me', role : UserRole.ADMIN,
password : bcrypt.hashSync('123456', Config.userPasswordSaltRounds),
gitlabId : 142,
role : 'colsci',
deleted : false deleted : false
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment