Add additional states and cities to seed data in Prisma
This commit is contained in:
@@ -33,11 +33,46 @@ async function main() {
|
||||
update: {},
|
||||
create: { countryXid: india.id, stateName: 'Maharashtra' },
|
||||
});
|
||||
const uttarpradesh = await prisma.states.upsert({
|
||||
where: { stateName: 'Uttar-Pradesh' },
|
||||
update: {},
|
||||
create: { countryXid: india.id, stateName: 'Uttar-Pradesh' },
|
||||
});
|
||||
const Rajasthan = await prisma.states.upsert({
|
||||
where: { stateName: 'Rajasthan' },
|
||||
update: {},
|
||||
create: { countryXid: india.id, stateName: 'Rajasthan' },
|
||||
});
|
||||
const Uttarakhand = await prisma.states.upsert({
|
||||
where: { stateName: 'Uttarakhand' },
|
||||
update: {},
|
||||
create: { countryXid: india.id, stateName: 'Uttarakhand' },
|
||||
});
|
||||
const HimachalPradesh = await prisma.states.upsert({
|
||||
where: { stateName: 'Himachal Pradesh' },
|
||||
update: {},
|
||||
create: { countryXid: india.id, stateName: 'Himachal Pradesh' },
|
||||
});
|
||||
const Gujrat = await prisma.states.upsert({
|
||||
where: { stateName: 'Gujrat' },
|
||||
update: {},
|
||||
create: { countryXid: india.id, stateName: 'Gujrat' },
|
||||
});
|
||||
|
||||
// ✅ Cities
|
||||
await prisma.cities.createMany({
|
||||
data: [
|
||||
{ stateXid: maharashtra.id, cityName: 'Mumbai' },
|
||||
{ stateXid: uttarpradesh.id, cityName: 'Azamgarh' },
|
||||
{ stateXid: uttarpradesh.id, cityName: 'Lucknow' },
|
||||
{ stateXid: uttarpradesh.id, cityName: 'Prayagraj' },
|
||||
{ stateXid: Rajasthan.id, cityName: 'Jaipur' },
|
||||
{ stateXid: Rajasthan.id, cityName: 'Jaisalmer' },
|
||||
{ stateXid: Uttarakhand.id, cityName: 'Haridwar' },
|
||||
{ stateXid: HimachalPradesh.id, cityName: 'Manali' },
|
||||
{ stateXid: Gujrat.id, cityName: 'Surat' },
|
||||
{ stateXid: Gujrat.id, cityName: 'Ahemdabad' },
|
||||
{ stateXid: Gujrat.id, cityName: 'Rajkot' },
|
||||
],
|
||||
skipDuplicates: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user