Merge and added artefact name

This commit is contained in:
IZZY 2025-05-19 14:41:14 +01:00
parent 1bd327ea1a
commit f26dbb465a
4 changed files with 8 additions and 8 deletions

View File

@ -85,6 +85,7 @@ model Observatory {
model Artefact { model Artefact {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
type String @db.VarChar(50) // Lava, Tephra, Ash, Soil type String @db.VarChar(50) // Lava, Tephra, Ash, Soil

View File

@ -10,12 +10,13 @@ const csvFilePath = path.resolve(process.cwd(), "public/artefacts.csv");
const prisma = new PrismaClient(); const prisma = new PrismaClient();
type CsvRow = { type CsvRow = {
Type: string; Name: string;
WarehouseArea: string; Type: string;
EarthquakeId: string; WarehouseArea: string;
Required?: string; EarthquakeId: string;
ShopPrice?: string; Required?: string;
PickedUp?: string; ShopPrice?: string;
PickedUp?: string;
}; };
function stringToBool(val: string | undefined, defaultValue: boolean = false): boolean { function stringToBool(val: string | undefined, defaultValue: boolean = false): boolean {

View File

@ -45,7 +45,6 @@ export async function POST() {
// 4. Bulk create users in database // 4. Bulk create users in database
await prisma.user.createMany({ await prisma.user.createMany({
data: users, data: users,
skipDuplicates: true, // because email is unique
}); });
return NextResponse.json({ success: true, count: users.length }); return NextResponse.json({ success: true, count: users.length });

View File

@ -1 +0,0 @@
Artefacts
1 Artefacts