IT als land hinzugefügt

This commit is contained in:
PxlLoewe
2025-07-04 09:32:06 -07:00
parent bb893c9b1e
commit ac59b9b0fa
4 changed files with 43 additions and 25 deletions

View File

@@ -9,32 +9,36 @@ const router: Router = Router();
router.use("/mail", mailRouter); router.use("/mail", mailRouter);
router.use("/event", eventRouter); router.use("/event", eventRouter);
router.get("/import", (req, res) => { router.get("/import", (req, res) => {
DATA.forEach((station) => { DATA.forEach(async (station) => {
prisma.station.create({ try {
data: { await prisma.station.create({
aircraftRegistration: "D-H", data: {
aircraft: station.aircraft, aircraftRegistration: "D-H",
aircraftSpeed: station.aircraftSpeed, aircraft: station.aircraft,
atcCallsign: station.atcCallsign, aircraftSpeed: station.aircraftSpeed,
bosCallsign: station.bosCallsign, atcCallsign: station.atcCallsign,
bosCallsignShort: station.bosCallsignShort, bosCallsign: station.bosCallsign,
bosRadioArea: station.bosRadioArea, bosCallsignShort: station.bosCallsignShort,
fir: station.fir, bosRadioArea: station.bosRadioArea,
operator: station.operator, fir: station.fir,
bosUse: "PRIMARY", operator: station.operator,
country: station.country as Country, bosUse: "PRIMARY",
hasNvg: station.hasNvg, country: station.country as Country,
hasRope: station.hasRope, hasNvg: station.hasNvg,
hasWinch: station.hasWinch, hasRope: station.hasRope,
is24h: station.is24h, hasWinch: station.hasWinch,
hideRangeRings: station.hideRangeRings, is24h: station.is24h,
locationState: station.locationState, hideRangeRings: station.hideRangeRings,
locationStateShort: station.locationStateShort, locationState: station.locationState,
locationStateShort: station.locationStateShort,
latitude: station.latitude, latitude: station.latitude,
longitude: station.longitude, longitude: station.longitude,
}, },
}); });
} catch (error) {
console.error(`Error creating station ${station.aircraft}:`, error);
}
}); });
}); });

View File

@@ -0,0 +1,11 @@
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "Country" ADD VALUE 'NL';
ALTER TYPE "Country" ADD VALUE 'LU';
ALTER TYPE "Country" ADD VALUE 'LI';

View File

@@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "Country" ADD VALUE 'IT';

View File

@@ -11,6 +11,7 @@ enum Country {
NL NL
LU LU
LI LI
IT
} }
model Station { model Station {