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