Merge and added artefact name
This commit is contained in:
parent
1bd327ea1a
commit
f26dbb465a
@ -85,6 +85,7 @@ model Observatory {
|
||||
|
||||
model Artefact {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
type String @db.VarChar(50) // Lava, Tephra, Ash, Soil
|
||||
|
||||
@ -10,12 +10,13 @@ const csvFilePath = path.resolve(process.cwd(), "public/artefacts.csv");
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
type CsvRow = {
|
||||
Type: string;
|
||||
WarehouseArea: string;
|
||||
EarthquakeId: string;
|
||||
Required?: string;
|
||||
ShopPrice?: string;
|
||||
PickedUp?: string;
|
||||
Name: string;
|
||||
Type: string;
|
||||
WarehouseArea: string;
|
||||
EarthquakeId: string;
|
||||
Required?: string;
|
||||
ShopPrice?: string;
|
||||
PickedUp?: string;
|
||||
};
|
||||
|
||||
function stringToBool(val: string | undefined, defaultValue: boolean = false): boolean {
|
||||
|
||||
@ -45,7 +45,6 @@ export async function POST() {
|
||||
// 4. Bulk create users in database
|
||||
await prisma.user.createMany({
|
||||
data: users,
|
||||
skipDuplicates: true, // because email is unique
|
||||
});
|
||||
|
||||
return NextResponse.json({ success: true, count: users.length });
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Artefacts
|
||||
|
Loading…
x
Reference in New Issue
Block a user