chore: added some fake Feed data for testing - more robust testing will obsolete this in the future
This commit is contained in:
parent
87da78286c
commit
3b9368dc22
30
prisma/seed.ts
Normal file
30
prisma/seed.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import Prisma, { PrismaClient } from "../generated/prisma";
|
||||||
|
|
||||||
|
const client = new PrismaClient();
|
||||||
|
|
||||||
|
async function createManyFeeds() {
|
||||||
|
const records: any = { data: [] };
|
||||||
|
|
||||||
|
for (let i = 0; i < 35; i++) {
|
||||||
|
records.data.push(<Prisma.Prisma.FeedCreateInput>{
|
||||||
|
name: `News Network ${i}`,
|
||||||
|
url: `https://news-network-${i}.com/rss`,
|
||||||
|
guild_id: "1204426362794811453",
|
||||||
|
active: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await client.feed.createMany(records);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
await createManyFeeds();
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
.then(async () => { await client.$disconnect() })
|
||||||
|
.catch(async (error: unknown) => {
|
||||||
|
console.log(error);
|
||||||
|
await client.$disconnect();
|
||||||
|
process.exit(1);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user