Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

chore: edit seed script

bautistaaae263bd47cf7f
diff --git a/packages/db/schema.prisma b/packages/db/schema.prisma
index 1d60c8b1..d179ea5c 100644
--- a/packages/db/schema.prisma
+++ b/packages/db/schema.prisma
@@ -407,7 +407,7 @@ model TrackChallenge {
model Track {
id Int @id @default(autoincrement())
title String
- description String
+ description String @db.MediumText
visible Boolean @default(true)
trackChallenges TrackChallenge[]
enrolledUsers User[]
diff --git a/packages/db/seed/index.ts b/packages/db/seed/index.ts
index 860dad48..fa89125d 100644
--- a/packages/db/seed/index.ts
+++ b/packages/db/seed/index.ts
@@ -39,14 +39,41 @@ await prisma.challenge.createMany({
export const trashId = uuidByString('trash');
export const gId = uuidByString('g');
-const TRACK_AMOUNT = 10;
-for (let i = 0; i < TRACK_AMOUNT; i++) {
- const challenges = await getRandomChallenges(i);
-
- const track = await prisma.track.create({
+const tracks = [
+ {
+ name: 'Crafting TypeScript Utility Types',
+ description:
+ "This collection guides you through hands-on exercises to recreate Typescript's built-in utility types.",
+ },
+ {
+ name: 'Typescript Wizardry',
+ description:
+ "Dive into the elite realm of TypeScript mastery with our 'Pro-Level TypeScript Challenges.' Designed for seasoned professionals, this collection offers a formidable gauntlet of intricate exercises, pushing the boundaries of your TypeScript expertise to the limit.",
+ },
+ {
+ name: 'Javascript Built in Methods',
+ description:
+ "This collection of challenges equips you to develop and enhance standard JavaScript methods, all while harnessing TypeScript's advanced type system to achieve a fully typesafe developer experience.",
+ },
+ {
+ name: 'Understanding Typescript Syntax',
+ description:
+ 'A collection of challenging exercises that dive into type annotations, generics, and more to level up your typescript abilities.',
+ },
+ {
+ name: 'Typescript Foundations',
+ description:
+ "'Typescript Foundations' is a curated set of challenges designed to build a strong foundation. From basic syntax to advanced concepts, this collection offers hands-on exercises to help you become a TypeScript Hero.",
+ },
+];
+
+for (const [index, track] of tracks.entries()) {
+ const challenges = await getRandomChallenges(index);
+
+ const createdTrack = await prisma.track.create({
data: {
- title: faker.lorem.words(2),
- description: faker.lorem.sentences(1),
+ title: track.name,
+ description: track.description,
visible: true,
},
});
@@ -54,7 +81,7 @@ for (let i = 0; i < TRACK_AMOUNT; i++) {
await prisma.trackChallenge.createMany({
data: challenges.map((challenge, index) => ({
challengeId: challenge.id,
- trackId: track.id,
+ trackId: createdTrack.id,
orderId: index,
})),
});