mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 12:35:38 +01:00
added seeder script
This commit is contained in:
parent
b006747a45
commit
baf8e2ac81
3 changed files with 56 additions and 2 deletions
21
scripts/seed.js
Normal file
21
scripts/seed.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* eslint-disable no-console */
|
||||
require('dotenv').config();
|
||||
const { client: prismaClient } = require('@umami/prisma-client');
|
||||
|
||||
const { seedAdminUser } = require('./seeds/admin-user');
|
||||
|
||||
async function main() {
|
||||
// seed admin user
|
||||
await seedAdminUser();
|
||||
|
||||
console.log('Seeding complete.');
|
||||
}
|
||||
|
||||
main()
|
||||
.catch(e => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
await prismaClient.$disconnect();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue