From 1459303d2a0ac23a50cb0afb8169d9e6d886a6ae Mon Sep 17 00:00:00 2001 From: Francis Li Date: Tue, 3 Sep 2024 18:39:01 -0700 Subject: [PATCH] Add Hospitals list to seeds --- server/prisma/seed.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/prisma/seed.js b/server/prisma/seed.js index 0f03665d..2d81ba41 100644 --- a/server/prisma/seed.js +++ b/server/prisma/seed.js @@ -157,6 +157,27 @@ async function seedMedications() { } } +async function seedHospitals() { + const hospitals = [ + 'SF General', + 'CPMC Van Ness', + 'CPMC Davies', + 'CPMC Mission Bernal', + 'Kaiser SF', + 'St. Francis', + "St. Mary's", + 'Chinese Hospital', + 'VA Med. Center', + 'UCSF Parnassus', + ]; + const data = {}; + for (const name of hospitals) { + data.name = name; + await prisma.hospital.create({ data }); + } + console.log('Hospitals seeded successfully'); +} + async function seedAdminUser() { const now = new Date(); const data = {}; @@ -217,6 +238,7 @@ async function main() { await seedMedicationAllergies(); await seedEnvFoodAllergies(); await seedMedications(); + await seedHospitals(); await seedUsers(); }