From 373480b9e1a6496a945c5174584f4d60fafbe01a Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Mon, 7 Nov 2022 10:17:45 +0800 Subject: [PATCH] [offers][misc] update seed script --- .../20221107014555_company_website/migration.sql | 2 ++ apps/portal/prisma/schema.prisma | 1 + apps/portal/prisma/seed-salaries.ts | 8 ++++---- apps/portal/prisma/seed.ts | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 apps/portal/prisma/migrations/20221107014555_company_website/migration.sql diff --git a/apps/portal/prisma/migrations/20221107014555_company_website/migration.sql b/apps/portal/prisma/migrations/20221107014555_company_website/migration.sql new file mode 100644 index 00000000..8504ebbc --- /dev/null +++ b/apps/portal/prisma/migrations/20221107014555_company_website/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Company" ADD COLUMN "website" TEXT; diff --git a/apps/portal/prisma/schema.prisma b/apps/portal/prisma/schema.prisma index b7264b71..04493fa9 100644 --- a/apps/portal/prisma/schema.prisma +++ b/apps/portal/prisma/schema.prisma @@ -98,6 +98,7 @@ model Company { slug String @unique description String? @db.Text logoUrl String? + website String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt diff --git a/apps/portal/prisma/seed-salaries.ts b/apps/portal/prisma/seed-salaries.ts index 69aa8a72..369ea51d 100644 --- a/apps/portal/prisma/seed-salaries.ts +++ b/apps/portal/prisma/seed-salaries.ts @@ -96,13 +96,13 @@ const getLevel = (type: string) => { processedType.includes('FRESH GRAD') || processedType.includes('JUNIOR') ) { - return 'L1'; + return 'Junior'; } else if (processedType.includes('MID')) { - return 'L2'; + return 'Mid'; } else if (processedType.includes('SENIOR')) { - return 'L4'; + return 'Senior'; } else { - return 'L0'; + return 'N/A'; } }; diff --git a/apps/portal/prisma/seed.ts b/apps/portal/prisma/seed.ts index e008fd28..c981356f 100644 --- a/apps/portal/prisma/seed.ts +++ b/apps/portal/prisma/seed.ts @@ -16,6 +16,7 @@ async function main() { name: company.name, slug: company.slug, description: company.description, + website: company.website, logoUrl: company.logoUrl, })), skipDuplicates: true,