diff --git a/ExpressAPI/prisma/seed.ts b/ExpressAPI/prisma/seed.ts index 603712461e4588d80a27b4b282f32922ae0e230b..ec4b605c97444027c3ce74f6cde381da9b6d7f1e 100644 --- a/ExpressAPI/prisma/seed.ts +++ b/ExpressAPI/prisma/seed.ts @@ -1,25 +1,20 @@ -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 logger from '../src/shared/logging/WinstonLogger'; -import * as bcrypt from 'bcryptjs'; -import db from '../src/helpers/DatabaseHelper'; +import { UserRole } from '@prisma/client'; +import logger from '../src/shared/logging/WinstonLogger'; +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', - deleted : false + id : 142, + gitlabUsername: 'michael.minelli', + gitlabLastInfo: {}, + role : UserRole.ADMIN, + deleted : false } }); }